Question: Language: JAVA M4 Assignment - Water Tank and Bullseye Questions 1. Develop exactly one class and create three instances john, mary and jane of the


Language: JAVA
M4 Assignment - Water Tank and Bullseye Questions 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. Janc 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 cach person in the two usage categories. (2.5 pts) Show the UML class diagram softcopy of MS Word/Visio file. (.5 pt) for the created class as a hardcopy of hand drawing or as a 2. Develop a BullsEye class that comes with a show(int x, int y, Graphics g) method to display exactly one to a given coordinate. For example, public class BullsEye public void show(int x, int y, Graphics g)\ g.drawOval(x, y, w, h); g.fillOval // assign int values to w (width) and h (height) arguments are similar to drawOval above ); Utilize the JFrame Form to develop class TestGUI to start the execution. In TestGUI, declare BullsEye object be and int val to be instance variables. The val indicates the number of rows and columns and is assigned from the argument args of the main method. For drawing a bullscye, you pass message, the Graphics object g, to the show method of the object be. Here exemplifies a code that draws ten bullscyes horizontally public void paint(Graphics g)\ super.paint(g); for(int i = 0: i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
