Question: Complete the program by providing the additional if-else branches for decoding other letters in a phone number. Try incrementally writing the program by adding one
Complete the program by providing the additional if-else branches for decoding other letters in a phone number. Try incrementally writing the program by adding one "else if" branch at a time, testing that each added branch works as intended.

1 import java.util.Scanner 3 public class PhoneNumberDecoder t 4 public static void main(String[] args) t Scanner scnr new Scanner(System.in); String phoneStr; I/ User input: Phone number string int i char currChar; 7 / Current index in phone number string // Current char in phone number string System.out.println("Enter phone number: "); phonest r scnr.next(); 10 12 13 14 15 System.out.print("Numbers only: "); for (0; i , phoneStr.Length();) { // For each element currChar phoneStr.charAt(i); 17 System.out.print(currChar); // Print character as is 19 20 21 else if ( ( (currChar >= ((currChar'A')&&(currChar 'C'))) 'a') && (currChar c')) 11
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
