Question: undefined . . Objectives: The major advantage of using structs is to make the CH code simpler, easier to read, and easier to work with.


undefined
. . Objectives: The major advantage of using structs is to make the CH code simpler, easier to read, and easier to work with. After completing this assignment, students will be able to: use structs to create and/or introduce new custom data types implement structs to group fixed numbers of pieces of data of different types implement structs within structs chaining using the dot operators to access nested fields copy an entire structure create an array of a structured data type combine structs and arrays with one another . . . . . Task Description: A Zookeeper wants you to create a program to keep track of all of the animals in the zoo and people working for him. You are given 4 files: Mammals.txt, Birds.txt, Reptiles.txt, and Per- sonnel.txt. Your task is to create an array of structs for each file to hold the entries. The first line of each file will be a number indicating how many entries are in the file. Mammals.txt 1. Species 2. Date of Birth (month:day.year) 3. Weight in pounds 4. Size of Enclosure (length:width: height) in meters 5. Exhibit Name Birds.txt 1. Species 2. Date of Birth (month day year) 3. Weight in pounds 4. Capable of Flight (yes 'Y' or no 'N') 5. Exhibit Name Reptiles.txt 1. Species 2. Danger Assessment ( [venomous V, nonvenomous "N"J:aggressiveness 0-10) 3. Date of Birth (month:day.year) 4. Size of Enclosure (length:width:height) in meters 5. Exhibit Name Personnel.txt 1. Name 2. Date of Hire (month:day:year) 3. Job Title 4. Assigned Exhibit Name Write a CH program to help the Zookeeper. Create four arrays of structs named personnel, reptiles, birds, and mammals. The size of the array should be read in from the file. Structs should be created to hold the variables that won't fit a standard data type. The main() function of your program should be very simple. The main function should be a collection of variables declaration and functions call. You will need to use four different functions to read the data from the four files. You can add more functions if you want. You are to give the user the ability to print out each section's records (personnel, reptiles, birds, and mammals). Do NOT use global variables. If you do so there will be a deduction of 10 points from your total points. Please check the attached Grading Rubric for the grading criteria. This is Assignment 1 (Structs) Zookeeper Select which option you would like to see 1. Print all Mammals 2. Print all Birds 3. Print all Reptiles 4. Print all Personnel 5. Exit Enter Option (1-5): 2 ===================== Birds ===== Species I Date of Birth I Weight | Flying | Exhibit Name I Eagle Falcon Parrot Emu 04:01:2010 03:10:2013 06:21:2000 06:01:2005 10 03 03 80 ! I I Y Y Y N Americas Americas I Australia i Australia I 1 Select which option you would like to see 1. Print all Mammals 2. Print all Birds 3. Print all Reptiles 4. Print all Personnel 5. Exit Enter Option (1-5): 1 =========================== ====================== Mammals Species I Date of Birth I Weight I Enclosure Size | Exhibit Name Rhino Lion Tapir Otter Fox 1 01:16:2000 : I 05:14:2006: | 10:21:2015 I 09:08:2011: I 06:03:2013: 5100 420 550 7 6 I 100:260: 50 I 150: 64: 55 90: 50: 30 50: 30: 20 30: 25: 34 I I I I ! Africa Africa Asia Americas Americas . . Objectives: The major advantage of using structs is to make the CH code simpler, easier to read, and easier to work with. After completing this assignment, students will be able to: use structs to create and/or introduce new custom data types implement structs to group fixed numbers of pieces of data of different types implement structs within structs chaining using the dot operators to access nested fields copy an entire structure create an array of a structured data type combine structs and arrays with one another . . . . . Task Description: A Zookeeper wants you to create a program to keep track of all of the animals in the zoo and people working for him. You are given 4 files: Mammals.txt, Birds.txt, Reptiles.txt, and Per- sonnel.txt. Your task is to create an array of structs for each file to hold the entries. The first line of each file will be a number indicating how many entries are in the file. Mammals.txt 1. Species 2. Date of Birth (month:day.year) 3. Weight in pounds 4. Size of Enclosure (length:width: height) in meters 5. Exhibit Name Birds.txt 1. Species 2. Date of Birth (month day year) 3. Weight in pounds 4. Capable of Flight (yes 'Y' or no 'N') 5. Exhibit Name Reptiles.txt 1. Species 2. Danger Assessment ( [venomous V, nonvenomous "N"J:aggressiveness 0-10) 3. Date of Birth (month:day.year) 4. Size of Enclosure (length:width:height) in meters 5. Exhibit Name Personnel.txt 1. Name 2. Date of Hire (month:day:year) 3. Job Title 4. Assigned Exhibit Name Write a CH program to help the Zookeeper. Create four arrays of structs named personnel, reptiles, birds, and mammals. The size of the array should be read in from the file. Structs should be created to hold the variables that won't fit a standard data type. The main() function of your program should be very simple. The main function should be a collection of variables declaration and functions call. You will need to use four different functions to read the data from the four files. You can add more functions if you want. You are to give the user the ability to print out each section's records (personnel, reptiles, birds, and mammals). Do NOT use global variables. If you do so there will be a deduction of 10 points from your total points. Please check the attached Grading Rubric for the grading criteria. This is Assignment 1 (Structs) Zookeeper Select which option you would like to see 1. Print all Mammals 2. Print all Birds 3. Print all Reptiles 4. Print all Personnel 5. Exit Enter Option (1-5): 2 ===================== Birds ===== Species I Date of Birth I Weight | Flying | Exhibit Name I Eagle Falcon Parrot Emu 04:01:2010 03:10:2013 06:21:2000 06:01:2005 10 03 03 80 ! I I Y Y Y N Americas Americas I Australia i Australia I 1 Select which option you would like to see 1. Print all Mammals 2. Print all Birds 3. Print all Reptiles 4. Print all Personnel 5. Exit Enter Option (1-5): 1 =========================== ====================== Mammals Species I Date of Birth I Weight I Enclosure Size | Exhibit Name Rhino Lion Tapir Otter Fox 1 01:16:2000 : I 05:14:2006: | 10:21:2015 I 09:08:2011: I 06:03:2013: 5100 420 550 7 6 I 100:260: 50 I 150: 64: 55 90: 50: 30 50: 30: 20 30: 25: 34 I I I I ! Africa Africa Asia Americas Americas
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
