Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java. Using linked list of objects Not using java.util.LinkedList From Lab Assignment 3, you know that a sample file may look like the following one.

Java.
Using linked list of objects
Not using java.util.LinkedList image text in transcribed
image text in transcribed
From Lab Assignment 3, you know that a sample file may look like the following one. 20.2 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 The input file must be named input.txt. Each line contains the width, height and length of a box. The dimensions are separated by spaces. For Lab assignment 4, you must read the input file exactly once. The client is NOT allowing the use of any array to store Box objects, or java.util lists for this revised software Assignment: You need to write a program, where each box has to be considered an object. To achieve this, you must write a class named Box. The client likes to keep each class in a separate Java file. Therefore, make sure to create a Java file for the Box class. Some other required properties of the Box class are as follows. 1. You are allowed to kep only one of the status variables 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. The program file (the Java file that contains the main method) must be written in Runner.java. Runner must have the following functionalities. Each functionality must be implemented in a separate method in Runner. From Lab Assignment 3, you know that a sample file may look like the following one. 20.2 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 The input file must be named input.txt. Each line contains the width, height and length of a box. The dimensions are separated by spaces. For Lab assignment 4, you must read the input file exactly once. The client is NOT allowing the use of any array to store Box objects, or java.util lists for this revised software Assignment: You need to write a program, where each box has to be considered an object. To achieve this, you must write a class named Box. The client likes to keep each class in a separate Java file. Therefore, make sure to create a Java file for the Box class. Some other required properties of the Box class are as follows. 1. You are allowed to kep only one of the status variables 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. The program file (the Java file that contains the main method) must be written in Runner.java. Runner must have the following functionalities. Each functionality must be implemented in a separate method in Runner

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions

Question

What is the alternative to the proprietary concept?

Answered: 1 week ago

Question

=+11. Nonverbal Communication: Analyzing Nonverbal Signals [LO-5]

Answered: 1 week ago