The purpose of this lab is to reinforce error handling and file processing. Spec
ID: 3624847 • Letter: T
Question
The purpose of this lab is to reinforce error handling and file processing. Specifically, this assignment is to write a program that does the following:
reads a series of phone numbers (just 10 digits) from the file phone_numbers.txt
if the phone number is not a valid phone number (correct format is just 10 digits) then write the invalid data to a log file
for all valid phone numbers, keep track of the number of phone numbers with each possible area code
display the area codes that have at least 1 phone number and the number of phone numbers. The output should look something like
068 : 1
404 : 3
678 : 4
770 : 2
800 : 7
phone_numbers.txt file :
2348765435
7704236005
7704236160
67899989
6666786543x234
abc
4046666666
0067865432
0178765432
Explanation / Answer
for example at phone no +923347288509 there are total 10 specific digits and two international code digits the +92 now mix these all digits in a grander and add some milk, some salt, a mango then shake it well and enjoy the milk shake
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.