Question: Please use java and show the output too 5. Write the following custom methods: a. The method isstarchy(boolean isEatenWithFat) returnstrue when the isEatenwithFat is true

 Please use java and show the output too 5. Write the

Please use java and show the output too

5. Write the following custom methods: a. The method isstarchy(boolean isEatenWithFat) returnstrue when the isEatenwithFat is true AND the fruit is over 300 calories AND has the word "sweet" (case-insensitive) anywhere in the description. b. The method isNumberedDescription () returns true if the first letter of the description is a number. c. Write a method that returns how many pieces of the fruit may be eaten, without going over 1600 calories. The signature will be public int numberoffruits () . Some examples: - If the fruit has 300 calories, the method will return 5 . - If the fruit has 650 calories, the method will return 2 . - If the fruit has 125 calories, the method will return 12. - etc. 6. Create a tostring that prints out the name, description and calories of the fruit in an attractive and readable manner. Proper spacing and labeling should be included. A "table-like" structure will be enjoyed. FruitTester 1. Fruittester will contain a main method. Create 8 unique, meaningful fruit objects using the 3 parameter constructor. 2. Place each object into an array. 3. Use the setDescription method to change the description to "100 times better than strawberries" for the last fruit object you created. 4. Print out the contents of each object using the System.out.printIn statement. Do NOT explicitly invoke the tostring method 5. Using a looping constructor (while/for) to invoke and print out the results of a. The isNumberedDescription method for each object in the array b. The numberoffruits method for each object in the array 6. For the first 2 objects you created, print out the result of invoking the isstarchy method

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!