Question: //create module, variable declaration, and input Module main Declare String phone Display Enter 10 Digit Phone Number (xxx-xxx-xxxx): Input phone //create if for changing letters

//create module, variable declaration, and input
  • Module main
  • Declare String phone
  • Display Enter 10 Digit Phone Number (xxx-xxx-xxxx):
  • Input phone
  • //create if for changing letters to numbers
  • If isLetter(phone) Then
  • change (phone)
  • Display Your numeric number is, phone
  • Else
  • Display Your phone number is already in a numeric set.
  • End If
  • End Module
  • //create module of changing the number
  • Module change (String Ref phone)
  • Declare Integer Index
  • Declare String phone
  • For index = 0 to length(phone) 1
  • If phone == A OR B OR C then
  • Set phone = 2
  • Else
  • If phone == D OR E OR F Then
  • Set phone = 3
  • Else
  • If phone == G OR H OR I Then
  • Set phone = 4
  • Else
  • If phone == J OR K OR L Then
  • Set phone = 5
  • Else
  • If phone == M OR N OR O Then
  • Set phone = 6
  • Else
  • If phone == P OR Q OR R OR S Then
  • Set phone = 7
  • Else
  • If phone == T OR U OR V Then
  • Set phone = 8
  • Else
  • If phone == W OR X OR Y OR Z Then
  • Set phone = 9
  • End If
  • End If
  • End If
  • End If
  • End If
  • End If
  • End If
  • End If
  • End For
  • End Function
  • Step by Step Solution

    There are 3 Steps involved in it

    1 Expert Approved Answer
    Step: 1 Unlock blur-text-image
    Question Has Been Solved by an Expert!

    Get step-by-step solutions from verified subject matter experts

    Step: 2 Unlock
    Step: 3 Unlock

    Students Have Also Explored These Related Programming Questions!