Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Solve using Java.You have only 20 minutes. Fast please.5 task answers 10 + 10 + 10 = 30 Points = Task 1: Implement the following

image text in transcribedSolve using Java.You have only 20 minutes. Fast please.5 task answers

10 + 10 + 10 = 30 Points = Task 1: Implement the following classes, each on a separate file: Fruit > -fruitname: String -color: String + Fruit (color: String, fruitname: String) +getFruitname (): String +getColor (): String tsetFruitname (fruitname: String): void tsetColor (color: String): void + taste (): void (abstract method) Cookable > + howToCook(): void (abstract method) Pineapple + Pineapple ) +toString(): String Pear + Pear +toString(): String Now write a test program and create two Pineapple and Pear objects using your own parameters for the data fields. For Pineapple class, the taste() method should display "Sour taste. For Pear class the taste() method should display "Sweet taste. Then invoke their toString() and howToCook() methods. For Pineapple the howToCook() method should display "Cooking is possible. For Pear the howToCook() method should display "Cannot cook. The toStringo method should display the values for all the data fields

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 Management Systems Designing And Building Business Applications

Authors: Gerald V. Post

1st Edition

0072898933, 978-0072898934

More Books

Students also viewed these Databases questions

Question

6. Compare and contrast immune neglect and the focusing illusion.

Answered: 1 week ago