CIS 170 (Devry) help Making Decisions/uophelp.com CIS 170 (Devry) help Making Decisions/uophelp.com | Page 15
Phone Number Dialed: UN9-3177 *the number entered
If all of the rules are not met, then you output one of the following error
messages to the console.
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.
5
JKL
1