Question
C++ Write a program that reads a telephone number from a file called number.dat. This program should determine whether the input is a valid telephone
C++
Write a program that reads a telephone number from a file called number.dat. This program should determine whether the input is a valid telephone number. A valid telephone number has the following syntax:
D D D - D D D - D D D D : the first D can't be a zero (0).
If the telephone number is valid, the program should print the telephone number followed by a colon (:) followed by a space and the word Valid.
If the telephone number is invalid, the program should print the telephone number follow by a colon (:) followed by a space and the words Not Valid and ask for another telephone number but this time the input should come from the keyboard.
The programs should keep ask until the telephone number is valid.
Please provide "screen shot" image and edited telephone_LastNameFirstName.cpp file.
orry the first number cannot be a zero 032-997-3086 Not Ualid Please enter a valid number in the format DDD-DDD-DDDD: 333-333-333P 333-333-333P: Not Ualid Please enter a valid number in the format DDD-DDD-DDDD: 333-333-3333 333-333-3333: Ualid Press any key to continueStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started