Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Java Create an enum type with a constructor and explicit instance fields and accessors for those fields. Name it AnimalHunger with four constants (dog, cat,
Java
Create an enum type with a constructor and explicit instance fields and accessors for those fields.
Name it AnimalHunger with four constants (dog, cat, rabbit, bear).
Each AnimalHunger constant takes one value - the average pounds of food an adult of that kind of animal is expected to eat each day.
Create a program to test your enum type
- The loop portion will allow the keeper to choose:
- select an animal, then enter the average amount of food that animal will eat in a day.
- print out a single animal along with the average amount of food they eat in a day.
- print out all the animals in a chart with the average amount of food they eat in a day.
Test program must loop until the user wants to quit.
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