subject

Description: You are to create two subclasses of the Animal class (from the previous Animal Class Challenge) that is used to store information about either a mammal or a bird. You are then to extend the Animal Generator program that takes user input, allowing the user to create multiple Mammal or Bird objects. Finally, you are to retrieve the information stored in those objects and display it. Purpose: The purpose of this challenge is to provide experience creating and using subclasses in Python 3.
Requirements:
You are to create two subclasses of the Animal class (from the previous Animal Class Challenge) that is used to store information about either a mammal or a bird. You are then to extend the Animal Generator program that takes user input, allowing the user to create multiple Mammal or Bird objects. Finally, you are to retrieve the information stored in those objects and display it.
The solution from the previous Animal Class Challenge is available as part of the Animal Class Retrospective.
Mammal Class
Write a class named Mammal that inherits from the Animal class that has the following additional attribute and method. This class is to be added to the Animal. py file that was created for the Animal Class Challenge.
Attributes
The following hidden attribute is used to indicate the color of the mammal’s hair.
__hair_color:
Methods
The following method is to initialize the two attributes from the Animal class required in the Animal class’ __init__, the single attribute listed above, and assign their default values.
__init__:
The following method is to return the value of the __hair_color field.
get_hair_color:
Bird Class
Write a class named Bird that inherits from the Animal class that has the following additional attribute and method. This class is to be added to the Animal. py file that was created for the Animal Class Challenge.
Attributes
The following hidden attribute is used to indicate if the bird can fly.
__can_fly:
Methods
The following method is to initialize the two attributes from the Animal class required in the Animal class’ __init__, the single attribute listed above, and assign their default values.
__init__:
The following method is to return the value of the __can_fly field.
get_can_fly:
Animal Generator Program
Once you have written the classes, extend the animalGenerator. py from the Animal Class Challenge. This program is to use Animal. py as a module.
In animalGenerator. py, prompt the user to enter if they would like to create a mammal or a bird.
If the user selects mammal, prompt the user for the name, type of the mammal, and the color of hair. Create a new Mammal object to store this data.
If the user selects bird, prompt the user for the name, type of the bird, and if the bird can fly. Create a new Bird object to store this data.
Finally, ask the user if they would like to repeat the process. They are to be able to create as many Mammal and Bird objects as they like.
After the user is done creating animals, this program is to use the object’s accessor methods to retrieve the name, type, and mood of each animal. This information is to be formatted and displayed as shown in the sample program output below.
Sample Output
Welcome to the animal generator!
This program creates Animal objects
Would you like to create a mammal or bird?
1. Mammal
2. Bird
Which would you like to create? 2
What type of bird would you like to create? Penguin
What is the bird’s name? Peggi
Can the bird fly? Yes
Would you like to add more animals (y/n)? y
Would you like to create a mammal or bird?
1. Mammal
2. Bird
Which would you like to create? 1
What type of mammal would you like to create? Tiger
What is the mammal’s name? Truman
What color is the mammal’s hair? Orange
Would you like to add more animals (y/n)? n
Animal List
Peggi the Penguin is sleepy
Truman the Tiger is hungry
Testing
Run the program you write and verify that the information entered matches the information displayed and that the input prompts and output utilize the format specification provided.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 09:40
In the lab, which of the following displayed a list of all installed services and included a description of the service, the current state, and whether the service started automatically or manually? a. the services manager b. the applications summary c. the recommended services d. list the safe services list
Answers: 2
question
Computers and Technology, 23.06.2019 18:20
What is wi-fi infrastructure? a metropolitan area network that uses radio signals to transmit and receive data a communications technology aimed at providing high-speed wireless data over metropolitan area networks a means by which portable devices can connect wirelessly to a local area network, using access points that send and receive data via radio waves includes the inner workings of a wi-fi service or utility, including the signal transmitters, towers, or poles and additional equipment required to send out a wi-fi signal
Answers: 2
question
Computers and Technology, 24.06.2019 11:20
Colby works as a shipping clerk for a major package delivery service. some of his daily tasks include tracking shipments and entering orders. which aspect of the information technology cluster would he most likely be trained in? a.networkingb.databasesc.hardwared.software
Answers: 2
question
Computers and Technology, 24.06.2019 17:00
Following are uses of spreadsheets. for each use, choose whether the use is a business use, consumer use, or student use. family budget: sales data: recording research data for science class:
Answers: 2
You know the right answer?
Description: You are to create two subclasses of the Animal class (from the previous Animal Class Ch...
Questions
question
Computers and Technology, 07.12.2021 06:00
question
Mathematics, 07.12.2021 06:00
question
Biology, 07.12.2021 06:00
Questions on the website: 13722363