Question: this needs to be done in C language This was the previous code: #include int main() { int n; char buffer[1000]; while(1) { printf(Enter phone
this needs to be done in C language This was the previous code:
#includeint main() { int n; char buffer[1000]; while(1) { printf("Enter phone number: "); if(scanf("%d", &n)) { if(n == 0) { break; } if(n >= 1000000 && n Remember what we learned in Lab#02? North American telephone numbers always follow the following structure 3-digit area code 3-digit central office code + 4-digit subscriber For example, the Algonquin College main phone number is "(613) 727-4723" where the area code is "613", the central office (or exchange) is "727" and the subscriber is "4723". Neither the area code nor the central office code will ever start with the digit "O" or "1 Print your 10 digit number in the format: "(613) 727-4723 . . You will . Represent each phone entry by a unique 7 digit phone number (3-digit central office code 4- digit subscriber), 3 digit Area code, Last Name and First Name Represent each Area with 3 digit Area code (416) and Area Name (e.g., Toronto). You will create five Areas as mentioned above . When your program will run it will ask for 5 choices 1. 2. If you choose option 2 you wil have to enter 3 digit area code to get the details of all the 3. 4. If you choose option 1 you will have to enter 3 digit area code +7 digit phone number to get the details of that student students who have phone numbers with that area code If you choose option 3 you will have to enter last name of the student to get the details of that student. If you choose option 4 you will get the details of all the listed area codes Enter 'q' to quit your program 5. Sample output may look like s ./asgl Choose one of the five following options: Press [1] to get information based on phone number: Press [2] to get information based on Area Code: Press [3] to get information based on Last Name: Press [4] to print all area-code information Press [q] to quit: You pressed: 1 Enter Area Code: 416 Enter 7 digit number: 2345678 Your 10-digit phone number was: 416-2345678 Phone number: 416-2345678 belongs to the Student Lastl, Firstl and his number is from Toronto
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock

