Question: For this C++ lab, write a program that prompts the user to enter a phone number as a string. The input number may contain letters.

For this C++ lab, write a program that prompts the user to enter a phone number as a string. The input number may contain letters. The program translates a letter (upper case or lowercase) to a digit and leaves all other characters intact. You must use at least one function to complete this programming assignment.

Example

Enter a string : 1-800-FLOWERS

1-800-3569377

Want to process another phone? Y=Yes, N=No : y

Enter a string : 1800flowers

18003569377

Want to process another phone? y=yes, n=no : y

Enter a string : 1-800-GOTJUNK

1-800-4685865

Enter a string : 1-800-FLOWERS

Want to process another phone? y=yes, n=no : n

Have a nice day!

For this C++ lab, write a program that prompts the user toenter a phone number as a string. The input number may containletters. The program translates a letter (upper case or lowercase) to a

#include using namespace std; // prototype char getDigit(char); int main() string phone; int i, len; char c cout > phone; phone.length); len cout using namespace std; // prototype char getDigit(char); int main() string phone; int i, len; char c cout > phone; phone.length); len cout

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 Databases Questions!