Posted: April 30th, 2022

Infotc 1040 introduction to problem solving and

InfoTc 1040 Introduction to Problem Solving and Programming Animal Class Animal Generator Program Once you have written the Animal class, create another program called animalGenerator.py. This program should use Animal.py as a module. In animalGenerator.py, prompt the user to enter the name and type of an animal. Create a new Animal object to store this data. Then ask the user if they would like to repeat the process. They should be able to create as many Animal objects as they would like. After the user is done creating animals, this program should use the object’s accessor methods to retrieve the name, type, and mood of each animal.

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

 

In this programming assignment you are going to create a class named Animal that is used to store information about an animal.

 

You will then create a program that takes user input, allowing the user to create multiple Animal objects. Finally, you will retrieve the information stored in those objects and display it. Animal Class Write a class named Animal that has the following attributes and methods. Save this class as Animal.py

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

 

Attributes

__animal_type: a hidden attribute used to indicate the animal’s type. For example: gecko, walrus, tiger, etc. __name: a hidden attribute used to indicate the animal’s name.

__mood: a hidden attribute used to indicate the animal’s mood. For example: happy, hungry, or sleepy. Methods __init__: this method should create the three attributes above and assign their default values. The value of __mood should be set randomly. Generate a random number between 1 and 3.

 

Then: If the number is 1, the __mood field should be set to a value of “happy”. If the number is 2, the __mood field should be set to a value of “hungry”. If the number is 3, the __mood field should be set to a value of “sleepy”. get_animal_type: this method should return the value of the __animal_type field. get_name: this method should return the value of the __name field.

check_mood: this method should return the value of the __mood field.

 

 

Expert paper writers are just a few clicks away

Place an order in 3 easy steps. Takes less than 5 mins.

Calculate the price of your order

You will get a personal manager and a discount.
We'll send you the first draft for approval by at
Total price:
$0.00
error: Content is protected !!
Open chat
1
Order through WhatsApp!
affordablepaperwritings.com
Hello!
You Can Now Place your Order through WhatsApp
 

 

Order your essay today and save 30% with the discount code DISCOUNTS2022