Question
Telephone numbers can include one or more alphabetic characters, such as A, c. Write a program that will transform a 10-digit telephone number (may contain
Telephone numbers can include one or more alphabetic characters, such as A, c. Write a program that will transform a 10-digit telephone number (may contain one or more alphabetic characters, may contain numeric characters). The user is supposed to enter the 10-digit telephone number one by one digit (loop). Display the telephone number using numerals only and in format (***)-***-****. Please consider that both upper case and lower case could be entered.
The numbers and letters are associated as follows on your telephone:
ABC: 2
DEF: 3
GHI: 4
JKL: 5
MNO: 6
PQRS: 7
TUV: 8
WXYZ: 9
Implement the following steps:
(in JAVA)
Prompt user to enter digits of telephone number (may contain one or more alphabetic characters, may contain numeric characters) (loop).
Convert each alphabetic character to associated numbers (if/else or switch case).
Allow both upper case and lower case to be entered.
Display the telephone number using numerals only and in right format.
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