Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i need solution for java language Part 1 Coding An inheritance principle is used to explore and implement the Consumable interface and its related classes.

i need solution for java language image text in transcribed
image text in transcribed
image text in transcribed
Part 1 Coding An inheritance principle is used to explore and implement the Consumable interface and its related classes. The UML diagram ie remuilidan halinu. Part 1.1. Implement the Interface Consumable strictly according to the UML above. a. The displayNutritionalvalue () method should print the Basic nutritional information not specified. b. Add comments to the method. Part 1.2. Implement the abstract class Food strictly according to the UML above. a. Use appropriate access modifiers. b. No method should have any empty body (unless they are abstract) Part 1.3. Write classes Fruit and Vegetable based on the UML diagram above. a. Use appropriate access modifiers. b. Implement all required data fleids and methods. c. Make sure all abstract methods implemented (if appropriate) d. At least one of the classes should implement the displayNutritionalValue () method. 1 e. The displayNutritionalValue () method should call nutritioninfo () method to provide more details about the Consumable object. f. No method should have any empty body (unless they are abstract) Part 1.4. Write the main() method in a TestFood class having the following: a. Create an array of two Consumable objects. b. The First object is a Fruit of your choice with any country of origin and specified fields (of your choice). c. The Second object is a Vegetable of your choice with properties of your choice. d. Call method displayNutritionalValue on both objects that you just created

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

Database Concepts

Authors: David Kroenke

4th Edition

0136086535, 9780136086536

Students also viewed these Databases questions

Question

=+country competitive advantages? Why? Support your point of view.

Answered: 1 week ago

Question

=+from: a) a MNEs perspective? and b) the HRM managers perspective?

Answered: 1 week ago