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

  Write a program called inheritancetest java

Write a program called InheritanceTest.java to support an inheritance hierarchy for class Point-Square-Cube. Use Point as the superclass of the hierarchy. Specify the instance variables and methods for each class.

  Find information about scripting languages

Describe the primary features, strengths, and weaknesses of each language - Identify a task that would be an appropriate use of each language.

  How many passengers were on the titanic

How many passengers were on the Titanic? What percentage of passengers perished on the Titanic? What percentage passengers survived the sinking of the Titanic?

  Write an applet that includes a pie chart

Write an applet that includes a pie chart. Use a news article with statistics that are good candidates for a pie chart: for example, political candidate preferences; percentages of those for, against, or undecided about a ballot measure; and so for..

  How about using a break in a switch statement

How about using a break in a switch statement, show how you can really have a problem if you skip the break statement in a switch.

  Creates a list of shapes stored in an array

Identify and use the correct syntax of a common programming language (Java) - describe program functionality based on analysis of a given program;

  Write a method for computing tax

Financial application: print a tax table- gives a program to compute tax. Write a method for computing tax using the following header

  Determine the purpose of using javascriptr on a website

write a 200- to 300-word short-answer response to the followingwhat is the purpose of using javascriptr on a website?

  Write a program that asks a user for a file name and prints

Write a program that asks a user for a file name and prints the number of characters, words, and lines in that file.

  Write a complete java program called calculateaverage

Write a complete Java program called lCalculatell?uw'erage according to the following guidelines. The program prompts the user for ?ve to ten numbers oil on one

  Write a program of the dating game

The Dating Game Table of Contents for each section of this submission (i.e. Source Code listing, screen captures and UML design) here….Also, may include Javadoc source here.

  Output the number of vowels

Prompt the user to enter a string, and using a loop, count and output the number of vowels, and consonants the string contains. (You have to find methods from 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