Answered step by step
Verified Expert Solution
Question
1 Approved Answer
create a c++ program that: 1. Has a main() 2. Includes the proper header and namespace declarations 3. Create a program using the following requirements:
create a c++ program that: 1. Has a main() 2. Includes the proper header and namespace declarations 3. Create a program using the following requirements: a. Request a 7-character telephone number from the user using an informational prompt and translate the characters into a 7-digit telephone number. The user will not enter the dash, the program will format the telephone number properly. For example, aaadddd would translate to 222-3333. Do not code anything for 0 or 1. This is simply to exercise knowledge of the different while loops, switches and nested loops. b. Ensure the solution is not case sensitive, i.e., the user may enter AAAADDDD or aaadddd. c. Include an outer DO-WHILE loop that asks the user if they would like to continue entering telephone numbers. If the user enters y or Y, continue. Any other entry will exit the program. d. Include an inner/nested WHILE loop that processes the entered characters until the entered characters are translated into the proper telephone number. e. Use a SWITCH statement to translate characters to numbers. If the user enters something other than A-Z or a-z, display an error message and exit the WHILE loop, continuing with asking the user if they would like to continue. f. Output/display to the console the translated telephone number.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started