Answered step by step
Verified Expert Solution
Question
1 Approved Answer
class Box{ private double length, width, height; Box(double width, double length, double height){ this.length = length; this.width = width; this.height = height; } //Getters double
class Box{ private double length, width, height; Box(double width, double length, double height){ this.length = length; this.width = width; this.height = height; } //Getters double getWidth(){ return this.width; } double getLength(){ return this.length; } double getHeight(){ return this.height; } double getVolume(){ return this.length * this.width * this.height; } //IsCubic boolean isCubic(){ if(this.length == this.width && this.length == this.height){ return true; }else{ return false; } } }
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Java language
Should have box.java, LinkedList.java, Runner.java
20 10 8 4.5 8.45 12.2 8.0 2.5 4.0 1.0 15.0 18.0 3.5 3.5 3.5 6.0 5.0 10.0 Each line contains the width, height and length of a box. The dimensions are separated by spaces. In Lab Assignment 4, you created your own linked list; you were not allowed to use any java.util lists for this revised software. The same conditions apply for this new assignment. Assignment: All the following conditions from the previous assignment are valid in this assignment. You will not make any change to the Box class. 1. You are allowed to keep only the next variable public. The rest of the status variables of the Box class must be private 2. Write no more than two constructors. 3. The Box class must have a public method named getVolume () that will return the volume of the box. 4. The Box class must have a public method named isCube() that will return true if the box is cubic, false otherwise 5. The Box class must NOT contain any main method. Feel free to write any additional method in the Box class, as you see fit. In this assignment, you will write two additional java files LinkedList.java and Runner.java. Notice that in the previous assignment you coded all the linked list operations, including iteration of the linked list, in the Runner.java file. In the new assignment, you will write the basic linked list operations in the LinkedList.java file. You will use a LinkedList object in the Runner.java file as your linked list. The skeleton of LinkedList.java is provided belovwStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started