Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help with this C++ code A local university would like to hire you to write a C++ program that stores the home address and current

Help with this C++ code
A local university would like to hire you to write a C++ program that stores the home address and current college address for their students and displays this information in a report.
a. Address: Specify a structure named Address to store the street address, the city/state, and the zip code. You will use this structure as the data type for the required addresses in the StudentAddress structure. (See lecture notes concerning a structure within a structure or P. 613Nested Structures.)
a. Specify a structure named StudentAddress to store the following data for each student:
1. Name
2. Home Address. (Use the structure data type Address.Refer to Nested Structures.)
3. College Address. (Use the structure data type Address.Refer to Nested Structures.)
b. Specify a one-dimensional array to store the student address 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.
c. Use main( ) as your driver function. The program does notneed to be repeatable.
d. 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 addresses for each student.
3. Display each students name and both addresses.

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 Address:

Street Address: 45 Ash

City, State: City, State

Zip Code: ZIP

College Address:

Street Address: 32 Elm

City, State: City, state

Zip Code: zip

Please enter the information for student 2.

Name: Lisa Mills

Home Address:

Street Address: 34 Spruce

City, State: City, State

Zip Code: 72173

College Address:

Street Address: 56 Pine

City, State: city, state

Zip Code: 72032

Please enter the information for student 3.

Name: Mike Hester

Home Address:

Street Address: 3 Oak

City, State: City, state

Zip Code: 72058

College Address:

Street Address: 5 Cedar

City, State: city, state

Zip Code: 72034

Sample Output:

The Student Address report is:

Mary Jones

Home: 45 Ash

City, AR 72110

College: 32 Elm

City, AR 72034

Lisa Mills

Home: 34 Spruce

City, AR 72173

College: 56 Pine

City, AR 72032

Mike Hester

Home: 3 Oak

City, AR 72058

College: 5 Cedar

City, AR 72034

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_2

Step: 3

blur-text-image_3

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

Database Support For Data Mining Applications Discovering Knowledge With Inductive Queries Lnai 2682

Authors: Rosa Meo ,Pier L. Lanzi ,Mika Klemettinen

2004th Edition

3540224793, 978-3540224792

More Books

Students also viewed these Databases questions