Program Scenario: A group of USA Astronauts have been selected at random for a special operative training mission called Net-Way Logistic Maneuvers. A detailed report had been requested listing all of the members of the newly organized team.
File input/output:
Input file: Astronaut.data ASCII text file in ascending order by the Astronaut ID. For each astronaut, the input data in the following format with 2 lines per astronaut. Fields are separated by spaces.
Astronaut Astro First name Astro Middle Name Astro Last Name '\n'
ID
integer>=0
Height Weight '\n'
Input file: NetWay.data ASCII text file identifying the astronauts selected for the special mission. records are in random order in the following format:
Astronaut ID '\n'
Output file: an ASCII text file in report format with good title and column heading. All data for each astronaut must be printed.
Data from the Astronaut.data must be read into a 1-D array of structures(or classes) named ASTRONAUT and thereafter all processing must be performed on the array of structures.
The following hierarchical/nested structures must be used:
a) NAME which consist of the first, middle and last names of astronaut. the first, middle and last name members must be C++ strings.
b) BODYSTATS which consists of height and weight.
there is a max of 35 astronauts in the program
No calculations performed in the fill array function.
The records(data lines) in the input file, NetWay.data must be read one after another and processed until the end of file is reached. As an ID is read from the file it must be matched(using the ordered linear search) in the 1-D array of ASTRONAUT structures for inclusion in the output report. Error checking of the ID is required.
The Ordered linear search (search is optimized to stop if match cannot be made) algorithm is required to search the ASTRONAUT array to find a member of the team.
Sample run: ID First Name Middle Name Last Name Height
1234 Sarah Maggie Lowe 124 65
1235 Nate Sam Miller 132 70
1254 Matt Kyle Boone 130 72
1260 Marissa Sandra Hogan 145 78
1290 Matthew Sampson Higgins 150 90