Question: ( Java ) Assignment: In a garden tracking app, there is a fertilizerLogger object with a method called endDay. This method takes a boolean argument,

(Java) Assignment: In a garden tracking app, there is a fertilizerLogger object with a method called endDay. This method takes a boolean argument, which shows if the field was fertilized, and an int argument, which counts the days since the last fertilization. The method returns true if you should not fertilize (or already did), allowing the day to end. But if the garden needs fertilization and it has not been done, the method will return false.
Write some code that reads from the keyboard the two values, first the boolean and then the int, and call the endDay method. Repeat this operation until endDay returns true.
Below you find examples of sample runs with user input between []:
Sample Run 1 :
[false]
[7]
Day Ended.
Sample Run 2 :
[true]
[16]
Day Ended.
Sample Run 3 :
[false]
[20]
Fertilization Needed.
[true]
[20]
Day Ended.

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 Programming Questions!