Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help in this program. Please do it correctly and follow the output . I put the stating code as well with the output

I need help in this program. Please do it correctly and follow the output . I put the stating code as well with the output

image text in transcribed

image text in transcribed

zoo = Zoo("Montana Zoo")

animal1 = Animal("Panda","Asia","Black and White")

zoo.add_animal(animal1)

animal2 = Animal("Flamingo","South America","Pink")

zoo.add_animal(animal2)

animal3 = Animal("Tiger","Asia","Orange")

zoo.add_animal(animal3)

animal4 = Animal("Rhino","Africa","Gray")

zoo.add_animal(animal4)

print(zoo)

location = input("Enter a continent: ")

zoo.find_by_location(location)

Using the given code below, supply the missing code using object-oriented programming. Each animal has a name (Ex. Panda), the continent where it lives (Ex. Asia) and the color of the animal (Ex. Black and White). The find by location() method takes in a user input location (Ex. Asia) and prints out the number of animals in the zoo that are from that location. Numpy should not be used for this question. When your program is run, these are two example possible outputs Welcome to the Montana Zoo These are the animals we have: *Black and White Panda from Asia *Pink Flamingo from South America *Orange Tiger from Asia *Gray Rhino from Africa Enter a continent: asia There are 2 animals in the Montana Zoo from asia Welcome to the Montana Zoo These are the animals we have: *Black and White Panda from Asia *Pink Flamingo from South America *Orange Tiger from Asia *Gray Rhino from Africa Enter a continent: North America There are o animals in the Montana Zoo from North America ## Your code should go above this line. Do not change anything below ## Your code should go above this line. Do not change anything below zoo = 200 ("Montana Zoo") animali = Animal. "Panda" "Asia" "Black and White") 299. add animal (animali) animal2 = Animal. "Elamingea South America "Pink") 299.add animal (animal2) animal3 = Animal ("Tiger" "Asia" "Orange") 200:add animal (animal3) animal4 = Animal ("Rhino "Africa""Gray.") 299.add animal (animal4) print (200) location = input.."Enter a continent: ") 200. find by location (location)

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

Expert Oracle Database Architecture

Authors: Thomas Kyte, Darl Kuhn

3rd Edition

1430262990, 9781430262992

More Books

Students also viewed these Databases questions

Question

c. Equal increases in aggregate demand and aggregate supply.

Answered: 1 week ago