Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me with thi python program thank you InfoTc 1040 Introduction to Problem Solving and Programming Animal Class In this programming assignment, you are

Please help me with thi python program thank you

image text in transcribedimage text in transcribedimage text in transcribed

InfoTc 1040 Introduction to Problem Solving and Programming Animal Class 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 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 _ in it-: 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

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

Step: 3

blur-text-image

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

Visual C# And Databases

Authors: Philip Conrod, Lou Tylee

16th Edition

1951077083, 978-1951077082

More Books

Students also viewed these Databases questions

Question

=+4 What are non-union workers representations?

Answered: 1 week ago