Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote