Question: Hello, I need help creating a class file to do the following things. I do not know how to start the class file, or how
Hello, I need help creating a class file to do the following things. I do not know how to start the class file, or how to create the constructors to preform the following tasks, such as private variables. The information is processing is in the form of doubles and inside an array. Such as this:
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
You need to write a program using object oriented programming idea for packages. That is, each package must be considered an object. To achieve this, you must write a class named Package. Make sure to create a Java file for the Package class. Some other required properties of the Package class are as follows.
1. All status variables of the Package class must be private.
2. Write no more than two constructors.
3. Must have a public method named getVolume() that will return the volume of the package.
4. Must have a public method named isCube() that will return true if the package is cubic, false otherwise.
5. The Package class must NOT contain any main method. Feel free to write any additional method in the Package class, as you see fit.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
