Question: Write an enum type Food, whose constants (APPLE, BANANA, CARROT) take two parametersthe type (vegetable or fruit), and number of calories. Write a program to
Write an enum type Food, whose constants (APPLE, BANANA, CARROT) take two parameters—the type (vegetable or fruit), and number of calories. Write a program to test the Food enum so that it displays the enum names and their information.
Step by Step Solution
3.41 Rating (154 Votes )
There are 3 Steps involved in it
The scenario you presented involves creating an Enum type named Food with the constants APPLE BANANA ... View full answer
Get step-by-step solutions from verified subject matter experts
