Write pseudocode for a function that translates a telephone number with letters in it (such as 1-800-FLOWERS) into the actual phone number. Use the standard letters on a phone pad.

Answers

Answer 1

Answer:

Explanation:

Function telToNumbers with one parameter of a String input for the telephoneNumber

String var newTelephoneNum;

for loop through telephoneNumber {

Char var currentChar = current Character in the loop;

currentChar to lower Case;

Switch statement (currentChar) {

 case "a" or "b" or "c" : newTelephoneNum += "2"; break;

 case "d" or "e" or "f" : newTelephoneNum += "3"; break;

 case "g" or "h" or "i" : newTelephoneNum += "4"; break;

 case "j" or "k" or "l" : newTelephoneNum += "5"; break;

 case "m" or "n" or "o" : newTelephoneNum += "6"; break;

 case "p" or "q" or "r" or "s" : newTelephoneNum += "7"; break;

 case "t" or "u" or "v" : newTelephoneNum += "8"; break;

 case "w" or "x" or "y" or "z" : newTelephoneNum += "9"; break;

 default : newTelephoneNum += currentChar; break;

 }

}

print newTelephoneNum;


Related Questions

Acrostics, acronyms, and rhymes are a few examples of __________. A. a visual strategy B. the misinformation effect C. memory reconstruction D. a mnemonic device Please select the best answer from the choices provided A B C D

Answers

Answer:

The answer is D) A mnemonic device

Answer:

D

Explanation:

I hope this helps! Sorry if it is wrong ;-;

Other Questions
PATTYCAKE PATTYCAKE PASTAMAN, GIMME PASTA POWER AS FAST AS U CAN identiy why trade improved during the middleages.this is the question. Who are the mountain men?1.settlers2.independent trappers3.guides4.business leaders. What would happen to the sea otter population if the amount of light available to the kelpdecreased due to construction of new buildings near the coast? HELP PLEASEEEE what is a normal body temperature for most people? reflection paper on the movie lorax help i will give brainlist. A train traveled from one city to another city in 4 hours at a speed of 70 mph.The retum trip was made in 5 hours. Find the speed for the return trip. what chapter did tobias cousin have to marry someone in castle diary? Average ant weight 4x10^-3 grams. Ant population is 10,000 trillion (10,000,000,000,000,000). What is the total mass of all ants? Show work for mass of ants (grams): Gwen usually models good sportsmanship and fair play during her team's soccer games. Her coach was very surprised to discover Gwen's intentions during practice that were out of character with her normal personal conduct. How did Gwen demonstrate this uncharacteristic behavior? a Help carry an injured teammate to the locker-room after they suffered a severe injuryb Motion for the trainer to come onto the field after noticing a teammate may be overheatingc Offer to help a teammate up off the ground after they collided together during a drilld Plan to kick another player that wasn't working her hardest in practice drills Simplify x^-5 please please I need it please please please please please please Which group of European colonists did NOT receive any aid from the Trustees? The writer in Frankenstein describes his one crewman as being "as silent as a Turk." What literarydevice is this?A. MetaphorB. IronyC. PersonificationD. Simile Do someone know the answer What does the Primary process do? What are the major steps to getting nominated by your political party? ____ laid the ground work for tribal government and promoted the preservation of Native Americantraditions.A. The Indian Removal ActB. The Wheeler-Howard ActC. The first tribal constitutionD. both B and C A farmer with 5000 feet of fencing wants to enclose a rectangular field and then divide it into two plots by adding a fence in the middle parallel to one of the sides. Using the function A(x) , analytically find the WIDTH of the field that would maximize its area. (Round your answer to the nearest whole number) 29 + 15x = -x - 3. Simplified PLEASE PLEASE HELP ME!!! THIS IS DUE TODAY!!What makes Shrek have strength in the first movie of Shrek? i'll make you brainliest!!