John
BAN USER
- 2of 2 votes
AnswersWrite a simple Zoo simulator which contains 3 different types of animal: monkey, giraffe and elephant. The zoo should open with 5 of each type of animal.
- John in United States
Each animal has a health value held as a percentage (100% is completely healthy). Every animal starts at 100% health. This value should be a floating point value.
The application should act as a simulator, with time passing at the rate of 1 hour with each interation. Every hour that passes, a random value between 0 and 20 is to be generated for each animal. This value should be passed to the appropriate animal, whose health is then reduced by that percentage of their current health.
The user must be able to feed the animals in the zoo. When this happens, the zoo should generate three random values between 10 and 25; one for each type of animal. The health of the respective animals is to be increased by the specified percentage of their current health. Health should be capped at 100%.
When an Elephant has a health below 70% it cannot walk. If its health does not return above 70% once the subsequent hour has elapsed, it is pronounced dead.
When a Monkey has a health below 30%, or a Giraffe below 50%, it is pronounced dead straight away.
The user interface should show the current status of each Animal and contain two buttons, one to provoke an hour of time to pass and another to feed the zoo. The UI should update to reflect each change in state, and the current time at the zoo.| Report Duplicate | Flag | PURGE
Object Oriented Design
Repcheyennejmartin8547, Android Engineer at 247quickbookshelp
Hey CheyenneMartin and I am working as a machine operator. Today I am doing a new research like vasiyam specialist ...
Repkristinelavo, HR Executive freshers at Automated Traders Desk
Kristine , a Content Strategist who excels at developing and implementing social media plans, creating original online content, managing websites and ...
RepColaraJoshi, Floor manager at Thomes
By profession, I am Floor manager in the Thomes store. I am passionate about astrology and read tronto cards, horoscopes ...
RepNoahTaylor, abc at A9
Accomplished software developer with many years of experience in development of applications. Excels in every stage of the life cycle ...
Repkassacraven, Java Experienced at Brainware
Kassa , an Outgoing a Travel Consultant with over 3 years of experience in delivering professional travel and tourism-related services focusing ...
RepLiamLee, abc at ADP
Proven leadership skills that have helped projects get completed within the time and budget constraints, Dedication to following appropriate safety ...
Repaliciaable183, Analyst at 247quickbookshelp
I am an agent contract clerk who is responsible for handling the recruitment process. I advertise the vacancies for agents ...
Repha1904536, Android test engineer at ABC TECH SUPPORT
Hello, I am an Executive recruiter. My role is to fill executive, high-level positions at companies. I have been practicing ...
RepDasiySmith, abc at 247quickbookshelp
I am versati;e architect, accomplished at designing commercial and residential structures of varying styles and purpose.I was met ...
RepMaryMartinez, Jr. Software Engineer at Automated Traders Desk
I am Mary, a knowledgeable sports official skilled at maintaining a safe environment for both players and observers, inspecting the ...
RepZoeyUhl, abc at 247quickbookshelp
With a highly experienced law clerk, well respected and writing proficient, detail oriented and proficient in preparing legal memos of ...
RepShivelyFauver, Animator at AMD
Project Management Assistant with a proven record in developing and managing project budgets, completing presentations and reports. As nowadays astrology ...
RepSimonPister, Blockchain Developer at Absolute Softech Ltd
Simon , a food scientist , records the Tracking status of all existing ingredients during the review and updating process and communicates ...