Write a complete class for an object called a box

Assignment Help JAVA Programming
Reference no: EM131903860

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.

Reference no: EM131903860

Questions Cloud

Write a c program to implement the function interface : Write a C program to implement the function interface below as an External function. Test your solution using the stub program shown below.
How much money do you expect to have at the end : How much money do you expect to have at the end of your investment horizon if you invest in the mutual fund?
Write a sql join query using two or more basetables : Write a SQL query using a built-infunction. Write a SQL query using the GROUP BYclause. Write a SQL join query using two or more basetables.
Create a linux server environment running apache web server : Create a Linux server environment, running an apache web server. Create five users on the server. One user will have administrative privileges.
Write a complete class for an object called a box : 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 Box.
How much less can the borrower with a mortgage borrow : How much less can the borrower with a 6% mortgage borrow to keep the same monthly mortgage payment as the borrower with a 5%.
Implement all of the functions in bits c file : Your task is to implement all of the functions in bits.c. All instructions regarding individual functions are in the comments above each function.
How does such trading differ from the forward market : Is it possible to trade foreign exchange in the futures market? How does such trading differ from the forward market?
What would be the amount of each of your monthly payments : You buy a house and finance it with a $250,000 30-year mortgage loan that requires equal payments at the end of each month. Your APR is set at 5.4%.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd