Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in this project you will be creating 10-digit phone number a contact list. The contact list will include the name of the contact and their

image text in transcribed
in this project you will be creating 10-digit phone number a contact list. The contact list will include the name of the contact and their Begin by creating a project with a source code file named contoctuist.cpp Apply all the coding standards: such as a leading comment with name, date, a that describe code after the main function. your functions. All functions must be declared before the main function and the function efine a structure, called Contact, with the name of the contact as a string and the phone number as threde ger values: area code (first 3 digits), exchange (next 3 digits) and the line number (last 4 digits). [HINT:a 10-digit number will not fit into a single integer data type. Use three, one for e exchange, and line number] Declare and define a function, ad number (area code, exchange, line nu using call-by-reference parameters. Declare and define a function, outputContacts, to add your contact information for a new contact values should be passed as a structure using call-by-reference parameter. The and phone numbers in your contact list in the following format ach part: area code, dContact. This method will prompt the user to enter the name and phone mber) for a contact. These values should be passed as a structure 4. contact. The new output the names tThe heading should be displayed only once for each run of your program PHONE NUMBER 913-555-1212 NAME John 6. The main function should do the following: a. Add a contact. Output the contact. Repeat these steps until the user indicates that they are finished entering data. b. c. Make the changes necessary to cause the outputContacts funct name of the output file will be provided by the user at execution time program will prompt the user for the file name (in function main) and you will append "xt 7. ion to write the contact list to a file. The - using a string for the filename. Your That is: if the user enters "MyContacts', you willappend " txt" making the output file name "MyContacts.txt" Create a function to validate the phone number. a. 8. This function will have 3 pointe rs as parameters: for the area code, exchange, and line number. b. It should have a Boolean return value to indicate if the number is a valid phone number. c. A valid area code and exchange will be values between 200 and 999. A valid line number for our purposes will be values from 1000 to 9999 If the number is not valid, the function should return a value of false otherwise true. e. The function to validate the the phone number is not valid the user should be notified and prompted to reenter the name and phone number until a valid phone number is entered or the user decides to exit the application. 9. phone number (#8) should be called within the add Contact function, and if 10. Make sure you use Co ntact structure in the addContact and outputContact functions and that the validate function parameters are passed as pointers 11. Submit your contactList.cpp source file and your MyContacts.txt file

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Constraint Databases

Authors: Peter Revesz

1st Edition

1441931554, 978-1441931559

More Books

Students also viewed these Databases questions