Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Objectives: The major advantage of using structs is to make the C++ code simpler, easier to read, and easier to work with. After completing this

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Objectives: The major advantage of using structs is to make the C++ 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"]: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 C++ 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. 16 Eagle 04:01:2010 10 Y Americas Falcon 03:10:2013 3 Y Americas Parrot 06:21:2000 3 Y Australia Emu 06:01:2005 80 N Australia Swan 07:06:2006 25 Y Europe Mallard 02:26:2008 3 Y Europe Pheasant 02:27:2015 2 Y Europe Thrush 07:13:2012 1 Y Asia Kiwi 08:17:2015 7 N Australia Treeswift 06:06:2016 1 Y Asia Penguin 03:22:2015 51 N Antartica Bluejay 06:13:2013 1 Y Americas Petrel 04:14:2017 2 Y Antartica GoldFinch 07:23:2016 1 Y Americas Gull 03:20:2010 3 Y Antartica Ostrich 02:28:2014 50 N Africa :N 15 Rhino 01:16:2000 5100 100:260:50 Africa Lion 05:14:2006 420 150:64:55 Africa Tapir 10:21:2015 550 90:50:30 Asia Otter 09:08:2011 7 50:30:20 Americas Fox 06:03:2013 6 30:25:34 Americas Sheep 11:10:2004 200 50:50:20 Europe Vole 12:06:2014 1 1:2:2 Europe Cheetah 06:12:2003 80 30:30:20 Africa Hedgehog 07:18:2006 1 2:2:3 Europe Serval 08:22:2007 26 10:20:4 Africa Shrew 08:23:2015 1 2:2:3 Europe Bat 06:25:2016 2 6:7:15 Europe Rabbit 04:23:2015 3 3:3:2 Europe Seal 08:26:2014 200 50:50:20 Antartica Dolphin 09:01:2017 330 200:200:60 Antartica 17 Malee 11:09:2005 Veterinarian Africa Trevor 05:16:2010 Cleaner Americas Mohammad 09:01:2015 Keeper Africa Aaron 09:05:2002 Veterinarian Asia Ana 10:21:2016 Keeper Australia Travis 11:09:2005 Veterinarian Africa Justin 11:10:2004 Veterinarian Africa Vincent 05:16:2010 Cleaner Americas Billur 11:09:2005 Keeper Africa Jen 05:16:2010 Cleaner Americas Logan 12:11:2016 Veterinarian Europe Ben 06:04:2002 Keeper Antartica Miranda 02:06:2000 Veterinarian America Quinton 10:21:2014 cleaner Europe Ron 06:04:2002 Keeper Europe Laura 03:05:1999 Cleaner Antartica Ashley 06:04:2002 Keeper Antartica 15 Chameleon N:0 07:02:2015 1:2:1 Asia Monitor V:4 06:15:2014 10:5:5 Asia Gecko N:1 06:25:2017 1:2:3 Australia Mamba V:10 08:29:2015 3:3:4 Africa Viper V:8 05:01:2010 4:3:2 Australia Python N:7 04:19:2011 3:3:2 Africa Tortoise N:1 09:05:2002 6:5:3 Africa Crocodile N:7 05:20:2010 30:30:3 Africa Grass Snake N:2 03:11:2016 2:2:1 Europe Blanus N:1 06:24:2013 3:2:1 Europe Anaconda N:6 03:29:2016 10:10:5 Americas Bothrops V:7 06:15:2013 3:3:4 Americas Turtle N:1 08:21:2012 3:2:1 Americas Teiidae N:2 10:22:2013 3:3:2 Americas Skink N:1 09:22:2013 3:2:4 Australia 3

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

Step: 3

blur-text-image

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 Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago