Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions