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.

 

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 __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.

 

 







Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more

Enjoy 10% OFF today with the coupon code: best10