Question: Help with this C++ A small private elementary school would like to hire you to write a C++ program that stores students emergency phone numbers
Help with this C++
A small private elementary school would like to hire you to write a C++ program that stores students emergency phone numbers for school purposes. The students are required to provide the school with 3 phone numbers in case of an emergency.
a. Phone: Specify a structure named Phone to store the area code, prefix, and last four digits of the phone number (suffix). You will use this structure as the data type for the required phone numbers in the StudentPhoneRecord structure.
b. Specify a structure named StudentPhoneRecord to store the following data for each student:
1. Name
2. Home Phone Number. (Use the structure data type Phone. Refer to Nested Structures.)
3. Emergency Phone Number. (Use the structure data type Phone. Refer to Nested Structures.)
4. Students Doctor Phone Number. (Use the structure data type Phone. Refer to Nested Structures.)
c. Specify a one-dimensional array to store the student phone information records. Set the maximum number of student records to 50 (the school can only accommodate 50 students each school year), but let the user specify how many student records need to be entered.
d. Use main( ) as your driver function. The program does not need to be repeatable.
e. Write appropriate functions that main( ) calls to accomplish the following tasks:
1. Read the number of students in the school.
2. Read and store the name and required phone numbers for each student.
3. Display each students name and required phone numbers.
Sample Input:
Number of students (must be a positive number less than or equal to 50) = ? 3
Please enter the information for student 1.
Name: Mary Jones
Home Phone:
Area Code: 501
Prefix: 329
Suffix: 4823
Emergency Phone:
Area Code: 870
Prefix: 345
Suffix: 1120
Doctor Phone:
Area Code: 501
Prefix: 329
Suffix: 7800
Please enter the information for student 2.
Name: Lisa Mills
Home Phone:
Area Code: 870
Prefix: 345
Suffix: 6786
Emergency Phone:
Area Code: 501
Prefix: 234
Suffix: 7654
Doctor Phone:
Area Code: 654
Prefix: 445
Suffix: 3333
Please enter the information for student 3.
Name: Mike Hester
Home Phone:
Area Code: 501
Prefix: 450
Suffix: 6789
Emergency Phone:
Area Code: 501
Prefix: 234
Suffix: 5674
Doctor Phone:
Area Code: 870
Prefix: 345
Suffix: 7654
Sample Output:
The Student Phone report is:
Mary Jones
Home: 501-329-4823
Emergency: 870-345-1120
Doctor: 501-329-7800
Lisa Mills
Home: 870-345-6786
Emergency: 501-234-7654
Doctor: 654-445-3333
Mike Hester
Home: 501-450-6789
Emergency: 501-234-5674
Doctor: 870-345-7654
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
