Question: JAVA Program!!! PART 1: Prompt the user for a phone number. Output all the possible phone numbers that use the letters on the keyboard. For
JAVA Program!!!
PART 1:
Prompt the user for a phone number. Output all the possible phone numbers that use the letters on the keyboard. For example, the phone number 123-4567 will have as one of its combinations 1CFILOQ. Use recursion, not loops.
Input: 123 |
Required Output
Enter a phone number (numbers only). 1AD 1AE 1AF 1BD 1BE 1BF 1CD 1CE 1CF
PART 2:
Allow the user to enter as many phone numbers as they wish (until exit is entered). Loops allowed in main method.
Input:
123 456 789 exit |
Required Output
Enter a phone number (numbers only). Type "exit" to end. 1AD 1AE 1AF 1BD 1BE 1BF 1CD 1CE 1CF 9 option(s) are available Enter a phone number (numbers only). Type "exit" to end. GJM GJN GJO GKM GKN GKO GLM GLN GLO HJM HJN HJO HKM HKN HKO HLM HLN HLO IJM IJN IJO IKM IKN IKO ILM ILN ILO 27 option(s) are available Enter a phone number (numbers only). Type "exit" to end. PTW PTX PTY PTZ PUW PUX PUY PUZ PVW PVX PVY PVZ QTW QTX QTY QTZ QUW QUX QUY QUZ QVW QVX QVY QVZ RTW RTX RTY RTZ RUW RUX RUY RUZ RVW RVX RVY RVZ STW STX STY STZ SUW SUX SUY SUZ SVW SVX SVY SVZ 48 option(s) are available Enter a phone number (numbers only). Type "exit" to end. Bye!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
