Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Description: Standard telephone keypads containe the digits zero through nine. T

ID: 646985 • Letter: D

Question

Description:

Standard telephone keypads containe the digits zero through nine. The numbers two through nine each have three letters associated with them. Many people find it difficult to memorize phone numbers, so they use the correspondence between digits and letters to develop seven-letter words that correspond to their phone numbers. For example, a person whose telephone number is 686-2377 might remember it as "NUMBERS".

Each seven-letter word or word combination corresponds to exactly one seven-digit telephone number, but a seven-digit number corresponds to many seven-letter words, most of which are not English words. It is possible, for example, that the owner of a barbershop would be pleased to know that the shop's telephone number 424-7288 corresponds to "HAIRCUT", or a liquor store's number 233-7226 corresponds to "BEERCAN".

Objective:

Write a program that asks a user to enter a seven-digit phone number and then writes to the file 'numbers.txt' every possible seven-letter word combination corresponding to that number. There are 2187 (i.e. 37) such combinations. Treat the digits 0 & 1 as spaces, and the rest as shown:

Explanation / Answer

import java.util. Scanner;

public class PhoneNumberAsString
{
public static void main (String[] args)
{
int first3, mid3, last4 result, userInput;
Scanner.keyboard = new Scanner(System.in);
System.out.println("Please input the 10 digits of your phone number");
userInput = keyboard.nestInt();
first3=userInput/


}//end main
}//end class