Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Design a base class named Animal to allow the following public data members: The

ID: 3536397 • Letter: D

Question

Design a base class named Animal to allow the following public data members:

The Animal class must also allow a public void function named printValues with no parameters.

Design a derived class named vetPatient that inherits all of the properties of the base class Animal as public members and has the following additional private members:

Design a derived class named Pet that inherits all of the properties of the base class Animal as private members and has the following additional public members:

Because the base class data members are private for the derived class Pet, the function printValues needs parameters for the Animal class data members.

Design three printValues functions - one for each class: Animal, vetPatient, and Pet - that will display all data members for the object of that class and then call the printValues function of the Animal class when necessary to display private data members of the base class.

Design a main function to test he classes that you created. Include all comments for documentation and identification of the program in your design. Create an object name elephant of the type Animal, an object named horse as the type vetPatient, and an object named dog as the type Pet. For gender, use 'm' for male, 'f' for female, 'n' for a neutered male, and 's' for a spayed female. You can expect a male elephant to live 65 years and weigh around 7 tons(14,000 pounds). Depending on the breed you can expect a dog that has been spayed to live 12 years and weigh around 20 pounds. A dog can be an indoor or outdoor pet and may or may not bite. You can expect a female racehorse to live 25 years, weigh around 1,000 pounds, and have regular exams by a veterinarian. Using thes facts, assign values to each data member in the class and call the printValues functions to output the values after they have been assigned.

Write a C++ program based on the designs you created.

Explanation / Answer

working..

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote