Question: import java.io.*; import java.util.*; public class PhoneMnemonics { public static String generateRandomMnemonic(String digits) { //Modify this method if(digits.isEmpty()) { return ; } else { String

import java.io.*; import java.util.*;
public class PhoneMnemonics { public static String generateRandomMnemonic(String digits) { //Modify this method if(digits.isEmpty()) { return ""; } else { String s = getCode(digits.charAt(0)); return s.charAt(new Random().nextInt(s.length())) + generateRandomMnemonic(digits.substring(1)); } } public static void recursiveMnemonics(Vector
The digits on the dial pad of a phone are associated with letters that can be used to generate mnemonics for telephone numbers. Mnemonics are helpful to remember the phone number, and also provide associations such as 1-800-FLOWERS that can help with promotions. Your task is to design and implement a program that will use recursion to Your program will take the set of digits as a command line argument and print out all the possible mnemonics on the console. Note that a mnemonic is simply a combination of letters associated with the digits and does not have to make sense. For example, few mnemonic possibilities for 423 are "GAD "GAE" and "GCD Your program should be able to deal with different number of digits. You can assume that the input will only contains digits 0 to 9. Use the digit and letter associations as shown in the figure. Ignore a digit if it does not have any letter associations. Your recursive function should have the following signature Vector
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
