Main Function Declare the char variables for the 8 digits of the phone number while true Call the ReadDials function passing the 8 digits by reference. ReadDials returns an error code by value. If the return value is-5, exit the do while loop If the error code is-1, display the error message " ERROR- An invalid character was entered ". If the error code is-2, display the error message " ERROR- Phone number cannot begin with 0 ". If the error code is-3, display the error message " ERROR- Phone number cannot begin with 555 ". If the error code is-4, display the error message " ERROR- Hyphen is not in the correct position ". Otherwise, call the AcknowledgeCall function End-While ReadDials function Input the first digit If a Q was entered, return-5. Input the rest of the phone number Call the ToDigit function for each of the 7 digits not for digit 4 If ToDigit returns-1, return-1 If digit 4 is not a hyphen, return-4. If digit 1 is 0, return-2. If digits 1- 3 are 5, return-3 Otherwise, return 0 ToDigit function Convert the digit to upper case Use a switch statement to determine if the digit is valid and convert the letters to digits If the digit is invalid, return-1. If the digit is valid, return 0. AcknowledgeCall function Display the Phone Number.
Step 3: Create a New Project Create a new project and name it LAB4. Write your code using the processing logic in Step 2( above). Make sure that you save your program.
Step 4: Compile and Execute a) Compile your program. Eliminate all the syntax errors.