Question: Phone numbers and PIN codes can be easier to remember when you find words that spell out the number on a standard phone pad. For

Phone numbers and PIN codes can be easier to remember when you find words that spell out the number on a standard phone pad. For example, instead of remembering the combination 5282, you can just think of JAVA.

Write a recursive method that given a number, yields all possible spellings (which may or may not be real words).

Please use the file included as a starting point.

Possible testing values are:

5282 26678837 7764726

import java.util.Scanner;

/** Converts a numeric pin to an equivalent word using the digit to letter mapping on a standard telephone keypad. */ public class PinWordEnumerator { public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.print("Enter a pin number-> "); String num = scan.nextLine(); System.out.println(); System.out.printf("The keypad encodings for %s are:%n",num); enumerateWords(num); } /** A wrapper for a recursive method that enumerates all the phone keypad encodings for a number. @param n a string representing the number */ public static void enumerateWords(String n) { // Implement a recursive method that generates // all possible phone keypad encodings for a // number. Implement additional auxiliary methods // if necessary. } ... }

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!