Question: (C++)Nested Structures, Functions Required Save your program as Lab12-2-YourLast Name.cpp) A small private elementary school would like to hire you to write a C++ program
Save your program as Lab12-2-YourLast Name.cpp) 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 ope for the required phone numbers in the StudentPhoneRecord structure. (See lecture notes concerning a structure within a structure" or P. 613 Nested Structures".) b. Specify a structure named StudentPhoneRecord to store the following data for each student: . 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. Student's 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 maximunm 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 student's 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
Step by Step Solution
There are 3 Steps involved in it
To solve this problem youll need to create nested structures and write a program that follows the outlined requirements Heres a stepbystep solution Step 1 Define Structures Define the Phone structure ... View full answer
Get step-by-step solutions from verified subject matter experts
