The first step to this program is to read in the list of animals that are currently in the system
already. You must use command line arguments to provide the file name of the input file you
are reading in.
Here is an example input file:
[login to view URL]
Each line contains information about one animal.
As part of this program, you are required to use inheritance and polymorphism. To do so you
will implement an Animal base class that contains information that pertains to all animals. In
your shelter ALL animals have a name, an age, and a dailyFee that represents the fee for
keeping the animal at daycare. The fee for each animal is as follows:
Your derived classes will be the specific types of animals housed in your daycare: Cat, Dog and
Rabbit. Each animal has additional data that only corresponds to that specific animal.
A Cat has a property called isOutdoor. This value will be true if the cat is an outdoor cat and
false if the cat is an indoor cat.
The input line for a cat is: cat,<name>,<age>,<isOutdoor>
A Dog has a property called favoriteToy. This value is a string that will hold the name of his
favorite toy (Ex: A bone, A ball, etc)
The input line for a dog is: dog,<name>,<age>,<favoriteToy>
A Rabbit has a property called numberOfCarrots. This value is an integer that represents the
number of carrots a rabbit is allowed to be fed per day.
The input line for a rabbit is: rabbit,<name>,<age>,<numberOfCarrots>
Pet Daycare User Interface
After reading in the input file, you will prompt the use to select from a list of options:
Option ‘0’ – when the user enters 0 (zero) the program will end.
Option ‘1’ – when the user enters 1, the user will be given a list of all animals currently at the
Option ‘2’ – When the user enters 2, the user will be prompted for what type of animal they are
dropping off (c/d/r) and then provide the information for that animal. You may assume that a
user will enter in the correct information in the correct format for each animal type (cat, dog,
Once the user submits the information you will create a new animal of that type and add it to
the linked list that contains all the animals in the shelter. If the user selects option 1 again, they
should be provided with an updated list of all animals plus the ones the user has just entered
appended to the end of the list.
Option ‘3’.- When the user enters 3, the user will be prompted for the cage number of the
animal that they are picking up. When the user enters the number that animal will be removed
from the linked list.
In your Animal class, you will need to define a virtual print method that will be overridden in
your derived classes (Cat,Dog,Rabbit). Each one of these classes should provide their own print
method that will be called when iterating through the linked list to print out all animals in the
All data members in your class definitions must be private or protected. No public data
members are allowed! This means that you must provide getters and setters for your data
members so that you may access them outside of your class definition and implementation.
In your program you will be storing all animals in your own custom Linked List. You may NOT
use the list ADT provided by the C++ STL. For your linked list implementation you will at a
minimum need an insert method, a removeAt method, and a print method. If implemented as a
class you must also include a separate .h and .cpp file for your LinkedList class.
9 pekerja bebas membida secara purata $40 untuk pekerjaan ini
Dear, sir I have already studied your task in detail. I can make result for a few hours. I already bidded this task. I'll complete this , sure! Thanks, sir Waiting for your good reply.