Question: Please fast within 25 minutes..5 part...java 10 + 10 + 10 = 30 Points = Task 1: Implement the following classes, each on a separate

Please fast within 25 minutes..5 part...java 10 + 10 + 10 =Please fast within 25 minutes..5 part...java

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!