Question: (20 points) Write a function that returns the digit value (an integer) corresponding to the letter passed to it as an argument based on the
(20 points) Write a function that returns the digit value (an integer) corresponding to the letter passed to it as an argument based on the encoding on your telephone handset. For example, if the argument is the letter a, b, or c (upper or lowercase), your function should return the digit 2. If the argument is not one of the letters of the alphabet, return a -1. Write a program that test your function using a switch statement. (20 points) Re-write program 4 using a nested if statement. 4. 5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
