Using functional decomposition, write a C++ program that inputs a single letter and prints out the corresponding digit on the telephone.

profileJBRADDEN
 

Using functional decomposition, write a C++ program that inputs a single letter and prints out the corresponding digit on the telephone. The letters ad digits on a telephone are groups this way :

2 = ABC           4 = GHI             6 = MNO             8 = TUV

3 = DEF             5 = JKL               7 = PRS                 9 = WXY

No digits corresponding to either Q or Z. For these two letters, your program should print a message indicating that they are not used on a telephone.

The program might operate like this :

         Enter a single letter, and I will tell you what the corresponding digit is on the telephone.

       R

         The digit 7 corresponds to the letter R on your telephone.

Another example :

       Enter a single letter, and I will tell you what the corresponding digit is on the telephone.

         Q

         There is no digit on the telephone that corresponds to Q.

You program should print a message indicating that there is no matching digit for any nonalphabetical character the user enters. Also, the program should recognize only uppercase letters. Include the lowercase letters with invalid characters.

       Prompt the user with the informative message for the input value, as shown above. The program should echo-print the input letter as part of the output.

       Use proper indentation, appropriate comments, and meaningful identifiers thought the program.

Save your program in the proper file(s). In the additional .doc file YourFirstInitialYourLastName_HW2.doc (e.g., JDow_HW2.doc) provide explanations and comments on your solution.

Zip all  the  files  in one YourFirstInitialYourLastName_HW2.zip archive(e.g., JDow_HW2.zip) and submit the .zip file for grading.

When using Microsoft Visual C++ Express : name the project as YourFistInitialYourLastName_HW2 , when completed - zip the whole project folder for deliverable ( add the .doc file to the project folder).

  
 
  
 
    • 8 years ago
    • 21
    Answer(0)
    Bids(0)