Question: I need in Java. 1. Write a class named Pool to represent a swimming pool. The class should have private instance fields to store the

I need in Java.

1. Write a class named Pool to represent a swimming pool. The class should have private instance fields to store the shape of a pool (oval, rectangular, etc.), length (in feet), width (in feet), depth (in feet), area (in square feet) and the volume (in cubic feet) of the pool. Also provide the following methods:A default constructor to initialize the instance variables.A Constructor with parameters to initialize the instance variables to the arguments indicated in the parameter list of the constructor. I like this constructor to accept as parameters the shape, length, width, and depth of the pool and set the values for member fields, accordingly.Appropriate methods to set the value of each of the private instance fields.Appropriate methods to get the value of each of the private instance fields.A method to calculate and return the area of the pool. The area is calculated by multiplying length and width. So, area = length * width A method to calculate and return the volume of the pool. The volume is calculated by multiplying depth by length and width. So, volume = length * width * depth A method to display the values of all of the variables. This is just a method with a bunch of output statements for all of the instance variables.Write a main program that uses the class Pool and test various operations on the objects of the class. Perform a series of operations to test each of the methods and the constructors. I need a menu of choices offered to the user for testing the code. Make sure to prompt the user for input as you test your code.

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!