Write a complete class for an object called a box the box


Problem

Write a complete Class for an object called a Box. The Box should have three integer instance variables, one for the length, one for the width and one for the height of the Box. Provide two constructors: one with no parameters that creates a box with a length, width and height of one, and a three-argument constructor that creates a Box with the given length, width and height. Error checking should be done to ensure none of the parameters is less than one. Include get and set methods for each of the instance variables, again with appropriate error detection. Provide a public, no- parameter method called volume that will return the volume of the Box (i.e., length times width times height). Override the methodsequalsandtoStringthat are inherited from class Object. A call to thetoStringmethod should result in a String as follows (given the input line cited below):

L:12 W:4 H:15 (V: 720)

Write a main program that will read Box information from a file and store the Boxes in an array. The format of the input file will be three integers per line separated by commas, representing the length, width and height of the Box:

12,4,15

Write a class called BoxGUI that extends JFrame. The BoxGUI should contain a grid layout with one row and two columns. Display the original array in the left column, and then sort the array (by volume) and display it in the right column. Use Selection Sort as shown in class to sort the array. The display of the Boxes should be done using thetoString method of class Box.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Write a complete class for an object called a box the box
Reference No:- TGS02699346

Expected delivery within 24 Hours