subject
Engineering, 22.04.2020 00:10 mbonilla073

In this programming assignment, you will create the following:• An Animal class that stores information about an animal.• A Zoo class that stores and displays Animal objects.• A zookeeper program that uses the Animal and Zoo classes. These elements are described below. Animal ClassWrite a class named Animal with the following attributes and methods. Save this class as Animal. pyAttributes__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. Zoo ClassWrite a class named Zoo with the following attributes and methods. Save this class as Zoo. pyAttributes__animals: a list used to store Animal objects. Methods__init__: use this method to create an empty list for __animals. add_animal: this method should receive an Animal object and append it to the __animals list. show_animals: this method will print information about each of the Animal objects within __animals. If no Animals have been added to the list, it should print out a message saying that there are no Animals. Zookeeper ProgramOnce you have written the Animal and Zoo classes, create another program called zookeeper. py. This program will use Animal. py and Zoo. py as modules. In zookeeper. py, create a Zoo object and print a menu with three options: Add Animal, Show Animals, and Exit. Add Animal: choosing this option should prompt the user to enter the type and name of an Animal. Use that input to create an Animal object and use the Zoo object’s add_animal method to store the animal. Show Animals: choosing this option should trigger the Zoo object’s show_animals method. Exit: this should exit the program. If exit is not selected, the program should loop and display the options again. Sample Program Operation User input is highlighted in orange. Zoo Options1. Add Animal2. Show Animals3. ExitWhat would you like to do? 2Animal ListThere are no animals in your zoo!Zoo Options1. Add Animal2. Show Animals3. ExitWhat would you like to do? 1What type of animal would you like to create? PlatypusWhat is the animal's name? PenelopeZoo Options1. Add Animal2. Show Animals3. ExitWhat would you like to do? 1What type of animal would you like to create? FoxWhat is the animal's name? FrankZoo Options1. Add Animal2. Show Animals3. ExitWhat would you like to do? 1What type of animal would you like to create? SharkWhat is the animal's name? SallyZoo Options1. Add Animal2. Show Animals3. Exit What would you like to do? 2Animal ListPenelope the Platypus is sleepyFrank the Fox is hungrySally the Shark is hungryZoo Options1. Add Animal2. Show Animals3. Exit What would you like to do? 3Thank you for visiting the zoo!Error CheckingInvalid input should not cause the program to crash. Make sure to handle errors properly. For example:Zoo Options1. Add Animal2. Show Animals3. Exit What would you like to do? -1Please select a valid optionWhat would you like to do? onePlease enter a numeric value. What would you like to do? 4Please select a valid option. What would you like to do? 3Thank you for visiting the zoo!

ansver
Answers: 2

Another question on Engineering

question
Engineering, 04.07.2019 03:10
What precautions should you take to prevent injuries when dealing with heavy loads?
Answers: 1
question
Engineering, 04.07.2019 18:10
Aloaded platform of total mass 500 kg is supported by a dashpot and by a set of springs of effective stiffness 72 kn/m. it is observed that when the platform is depressed through a distance x = 12.5 cm below its equilibrium position and then released without any initial velocity; it reaches its equilibrium position in the shortest possible time without overshoot. find the position and velocity of the loaded platform 0.10 sec. after its release. if a further load of 400 kg is added to the platform, find, i) the frequency of damped vibrations, and i) the amplitude of vibration after 2 complete oscillations, given that the initial amplitude is 15 cm.
Answers: 1
question
Engineering, 04.07.2019 18:10
An air conditioning system consist of a 5 cm diameter pipe, operating at a pressure of 200 kpa. the air initially enters the pipe at 15°c with a velocity of 20 m/s and relative humidity of 80%. if the heat supply throughout the process is 960 w, determine the relative humidity and the temperature at the outlet
Answers: 3
question
Engineering, 04.07.2019 18:10
Which of the following ziegler nichols tuning methods the response of the controller to a step input should exhibit an s-shaped curve? a)-open loop mode b)-closed loop mode c)-both modes (open & closed) d)-none of the modes (open & closed)
Answers: 3
You know the right answer?
In this programming assignment, you will create the following:• An Animal class that stores informat...
Questions
question
Social Studies, 08.10.2019 12:30
question
Geography, 08.10.2019 12:30
question
History, 08.10.2019 12:30
Questions on the website: 13722360