1. Write a C++ program that converts uppercase letters to their corresponding telephone digits . The program should reads the letter 'A' through 'Z' and print the corresponding telephone digit. To stop the program, the user is prompted for the sentinel. which is '#'.
Sample Run:
*****************
Telephone Digits
*****************
Program to convert uppercase letters to their corresponding telephone digits.
To stop the program enter #.
Enter a letter: S
The letter you entered is S
The corresponding telephone digit is :7
Enter another uppercase letter to find its corresponding telephone digit. To stop the program enter #.
Enter a letter: @
Invalid input
Enter another uppercase letter to find its corresponding telephone digit. To stop the program enter #.
Enter a letter: A
The letter you entered is A
The corresponding telephone digit is :2
Enter another uppercase letter to find its corresponding telephone digit. To stop the program enter #.
Enter a letter: #
Thank you .
2. Write a C++ program that reads in the side of a square and prints the square out of asterisks. Your program should work for square of all sizes between 1 and 20, when the user enter other sizes the program should display an error message.
Sample Run 1:
Enter the square side: 5
*****
*****
*****
*****
*****
Sample Run 2:
Enter the square side:21
invalid input. the side of a square should be between 1 and 20.