Question: 1. Develop exactly one class and create three instances john, mary and jane of the class. These three objects share a tank of water with
1. Develop exactly one class and create three instances john, mary and jane of the class. These three objects share a tank of water with a capacity of 1234.5 gallons. The class equips three methods. One allows pouring water into the tank, another checks water remaining in the tank, and the other retrieves water out of the tank Declare the amount of gallons of water in the tank as a primitive data field in the class. The water retrieving method not only deducts water out of the tank but also accumulates the usage for individual persons, i.e., flowering (45%) and showering (55%). Provide a main method to start the program execution and model the following behavior. Initialize the tank to have 1200 gallons of water. Next, john pours 95.35 gallons of water into the water tank and then he views the remaining. Later, mary takes away 250.75 gallons. Jane then pours in 100.75 gallons. Afterwards, john retrieved 120.8 gallons and jane retrieved 322.46 gallons. Finally, mary checked the remaining of the tank. At the very end, print out the accumulated water usage for each person in the two usage categories. (2.5 pts)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
