CIS170C All Assignments CIS170C All Assignments | Page 26
• ERROR - Phone number cannot begin with 555
• ERROR - Phone number cannot begin with 0
• ERROR - Hyphen is not in the correct position
• ERROR - An invalid character was entered
It will then prompt the user to try again.
This should be a lot of fun!
Here are some great things to think about as you begin your program!
Define a function named ReadDials() that reads each digit and letter dialed into 8 separate char
variables (DO NOT USE ARRAYS). All the digits are sent back through parameters by reference.
Then, for each digit, the program will use a function named ToDigit(), which receives a single
char argument (pass by reference) that may be a number or a letter of one of the digits dialed.
If it is a number, then return 0 by value indicating that it is a valid digit. If the digit is a letter,
then the number corresponding to the letter is returned by reference, and return 0 by value
indicating that it is a valid digit. Here are the letters associated with each digit.
0 5 J K L
1 6 M N O
2 A B C 7 P Q R S
3 D E F 8 T U V