[Solved]Goal Homework Write Small Database System Animal Shelter Kill Shelter Like One West Additi Q37256804
The goal of this homework is to write a small database systemfor an Animal Shelter. This is a no-kill
shelter like the one just west of the Addition Airport. You willaccept animal “donations” to the
shelter, but mostly only dogs and cats. (But yes, there may be theoccasional hamster or other nondog,
non-cat animal donation.) At present, all we need to do is writethe skeleton of a database that
will track all the animals in the shelter. We will add animals tothe database and print reports based
on the database. (Clearly there is a lot more functionality wecould add to this program, but for
now, we will just do the above.)
Approach:
1. Use three classes for this project: Animal, Cat, and Dog. Catand Dog will be subclasses of
Animal.
2. Each animal in the database will have the followingattributes:
a. Type (dog, cat, hamster, etc.)
b. Name
c. Age
d. Weight
e. Breed
f. Color
g. Health
3. There is a data file that you will need to read and parse tocreate the animal objects and set
their data attributes in the database. An example file input willlook like this:
AnimalType,Name,Age,Weight,Breed,Color,Health,Sound
cat,Morris,9,3,mixed,yellow,good,meow
cat,Mittens,1,,Calico,brown and white,good,Mew mew
cat,Junior,1,2,Tabby,black,needs shots,Meow
chipmunk,Chippy,2,1,white and gold,good,sniff sniff
dog,Priss,,3,Heinz,white,good,bark
cat,Charcoal,1,2,Siamese,white and yellow,good
The data file will be a CSV (comma-separated-values) file savedfrom an Excel file; thus it will
be a plain text file with commas used as field separators. Note asin the above example that
some of the values might be empty, meaning “unknown.” Each line ofthe data file will
represent one animal – a cat, a dog, or some other animal. Dogs andCats will be created
using their own Class definitions; other animals will simply beAnimals and only animals.
The final data file that you are to use will be uploaded to theeLearning site and called
AnimalShelterData.csv.
4. Keep track of the number of objects created for each type; thusyou will know how many
cats have been created, how many dogs, and how many total animals(you don’t have to
count “other” animals since you can always compute that with
Nbr “others” created = nbr Animals created – nbr Dogs created + nbrCats created
5. Use a separate static variable within each class to count theobjects created, and create a
method to keep count of the number of objects and to assign aunique number to every
newly created object. For example, there will be both anumberOfCats member and a
myCatNumber member in the Cat class.
6. Create a .h file and a .cpp file for each of the three classesand link them into the main.cpp
file.
7. Create and maintain three separate vectors of objects – one eachfor Animal, Cat, and Dog.
Store every animal in the Animal vector (the Animal vector willstore all three types of
objects – animals, cats, and dogs).
8. In addition, keep a separate vector of Cats and one of Dogs.Store all cats in the Cat vector
and all dogs in the Dog vector (that’s in addition to storing themin the Animal vector). You
won’t need any other classes.
9. Read the data input file line by line, collecting the animalattributes. Create an object of the
appropriate type and set all the attributes to the values you readfrom the file.
10. For each class, create an Introduction method that will havethe animal/cat/dog speak and
then say its name, age, color, health, etc.
11. Once you’ve read the entire database and created all theobjects and vectors, create four
reports:
a. Report 1: total number of animals created, number of catscreated, number of dogs
created
b. Report 2: An Animal report. Have each animal in the Animalvector introduce itself
(by “speaking”, giving its name, age, etc.)
c. Report 3: A Cat report: same as above but using all Catattributes.
d. Report 4: A Dog report: same as above but using all Dogattributes.
12. Print the reports to both the console and to a disk file.Submit the disk file with your project
submission. Remember, both a disk file output stream and theconsole are ostream objects!
So all you need is one set of output routines that you can use forboth, as we saw in class.
Annotations for the code:
1. Create and submit with your project a README.txt file thatcontains any special notes you
want me and/or the grader to be aware of when examining, executing,and grading your
program.
2. The main function can be at either the beginning or the end ofthe program. I don’t care which.
3. Add comments at the top of your program file to include yourname, the name of the program,
and any relevant notes on how your design works whenexecuted.
4. Add a change log in your comments that list the major changesyou make to your logic and
when – nothing too terribly detailed, but a list of breadcrumbsthat will remind you and others
of what you’ve done as your program becomes more sophisticatedand/or nearly complete.
5. Point out (in the comments at the top of your program) anyspecial features or techniques you
added using a comment saying something like “// SpecialFeatures:”
6. Comment your code effectively, as we discussed in class. Usedescriptive variable names
everywhere so that the code becomes as self-documenting aspossible. Use additional
commentary only to improve readability and comprehensibility byother people.
7. You absolutely MUST use consistent indentation and coding stylesthroughout the program.
Failure to do so will result in a loss of three points.
8. If the program does not work at all, or works incorrectly, atleast 5 points will be deducted.
9. No late submissions will be accepted since this is the end ofthe semester. Please meet the
deadline.
Expert Answer
Answer to The goal of this homework is to write a small database system for an Animal Shelter. This is a no-kill shelter like the … . . .
OR

