Question: Box Class java program Make the box dimensions real values You'll have a default constructor that sets the dimensions to 0 . 0 and the

Box Class java program
Make the box dimensions real values
You'll have a default constructor that sets the dimensions to 0.0 and the boolean variable to false
You'll have a values constructor that sets initial values from the BoxTest class for the 3 dimensions and sets the boolean variable to false
You'll have a get method and set method for each attribute separately
You'll have a method that calculates and returns the box's volume = height * width * depth. (this isn't in the program directions)
Make the toString method print a one line description of the box (it's dimensions and whether it's full or empty), be sure it makes sense
BoxTest Class program
Instantiate box1 with the default constructor
Instantiate box2 with height =15.5, width =4.75, and depth =7.0
Print box1 and box2 by calling the toString method and adding the volume returned from the calculateVolume method
Use the set methods to change the attributes of box1 to height =25.0, width =14.25, depth =20.25, and full = true.
Use the get methods to print the new attribute values for box1, as well as its volume formatted with a comma for thousands and 2 decimal places (don't use the toString method here, print in the client)

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!