Question
(JAVA) Programming Assignment There are a number of zoos available to tourists. 1. Create a Zoo class. Include data fields such as name of zoo,
(JAVA) Programming Assignment
There are a number of zoos available to tourists.
1. Create a Zoo class. Include data fields such as name of zoo, location, size, cost incurred in running the zoo for the past 12 months, number of visitors recorded for the past 12 months, ticket price per visitor and annual profit. (20 points)
2. Include at least two mutators and two accessors. (15 points)
3. Include one default constructor and one more constructor. (15 points)
4. Write separate instance methods that implement: (30 points)
a) return a string representing name of the zoo, the location and size of the zoo;
b) compute total income based on ticket price and the number of visitors during the last 12 months;
c) compute annual profit from cost and total income.
5. Create a second class(with main method) to test your Zoo class. (20 points)
In your second classs Main method, test your class by creating at least three new objects using the constructors or mutators youve created in your Zoo class. Each object will represent a specific zoo. Print the name, location and size of the zoo. Calculate and print annual profit for each zoo.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started