Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSE 1325 Homework #6 Inheritance and Multiple Inheritance In this homework assignment, you will be creating multiple derived classes of the Animal class. An image

CSE 1325 Homework #6 Inheritance and Multiple

image text in transcribedInheritance In this homework assignment, you will be creating multiple derived classes of the Animal class. An image of the UML diagram is provided for reference.

Part 1: Animal Class For this part, change the private variables to protected. Also you will add the species field, as well as the get and set functions for the species. More on how this species field will be used in HW 7.

Part 2: Derived Classes For this part, you will implement 4 derived classes, Aquatic, Avian, Terrestrial, and Amphibious. See the Animal Class for how to format the operator or if an aquatic was than Goldeen, then it would Goldeen swims.

Part 3: Main For this part, you will create a main function. In this main function, you will create one of each of the classes, for a total of 5. You will then print out each animal. After that, you will do the following: For the animal, you will print out the following is an animal. For the Aquatic, print out the swim function. For the Avian, print out the fly function. For the Terrestrial, print out the walk function. For the Amphibious, call the swim and walk functions. Bonus (10pts) Create an Enum Class called Animal_Types. This Enum Class will contain the names of each of the derived classes. Change the string type field in the Animal class to be an Animal_Types. Modify the get_type, set_type, operator

Makefile You are REQUIRED to provide a simple makefile that can build AND execute your program given the command make. The only command the GTA will type is make to run and execute your program. Deliverables You will submit your code via Blackboard. You will upload a zip file, named abc1234_HW6.zip, which contains the following files. abc1234 o abc1234_Animal.h and abc1234_Animal.cpp o abc1234_Aquatic.h and 1234_Aquatic.cpp o abc1234_Avain.h and abc1234_Avian.cpp o abc1234_Terrestrial.h and abc1234_ Terrestrial.cpp o abc1234_Amphibious.h and abc1234_Amphibious.cpp o abc1234_Animal_Types.h (bonus only for the Enum Class) o abc1234_main.cpp o makefile Full credit files named incorrectly result in a loss of 5 points each.

Animal # id number : int # gender: bool age: int e health_status: string # type : string +Animal() + Animalin : string, id : int, g : bool, a : int, hs : string, t : string) + get nameD:string + get id_number)0: int + get_gender): bool +get age): int + get health status) : string + get type): string + get species): string +set name(n : string) +set id_numberid: int) + set genderig: bool) + set age(a: int) + set health_status(hs: string) + set type(t: string) + set speciesis: species) + operator -(animal: const Animal&) : bool + to string): string Aquatic Terrestrial +swim: string +to string): string yl-string +to string): string +walki): string + to_string): string + to string): string

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions