What's new

Java Pwede po patulong mga sir medyo di ko po kasi maintindihan.

chaosmaki

Honorary Poster
Joined
Jul 20, 2016
Posts
649
Reaction
159
Points
234
Programming Project
Submit the solution for the following problem:
Cylinder Packaging - Project Brief
A packaging company needs to automate the selection of a cylinder package based on
the required volume.
You are required to design a program which can suggest a package, based on the user’s
input of the required volume.
You need to:
1. Write the code for a class describing a cylinder package. Your class needs to have:
  • data fields: diameter, height, package id
  • 2 constructors, one of which needs to be the Default constructor
  • Setters and getters
  • Other methods as required: calculateVolume ( ) and any other method you think useful
Useful formula: 𝑉𝑉 = 𝜋𝜋
𝑑𝑑2
ℎ , where d is the diameter and h is the height of the cylinder.
4
2. Write the code of a simple application test file to test all the methods of the class
created above.
3. Write the code of another application file, this time, it is the one required by the Project
Brief.
In this application class you need to:
- create 3 package cylinders objects and initialise the elements using the following data:
package 1: d = 15cm, h = 30cm, id: packBasic
package 2: d = 20cm, h = 100cm, id: packPoster
package 3: d = 30cm, h = 60cm, id: packMedium
- ask the user for the dimensions of their package: diameter and height. The dimensions
entered should be in the following ranges:
diameter not larger than 29cm and height not larger than 99cm
TAFE SA Associate Degree in Electrical Engineering
Associate Degree in Civil and Structural Engineering
COMPUTING FOR ENGINEERING
Project 5_Packagingv2 5 of 5 Revised on: 21/03/2022
Programming Project
- based on the volume of the user’s package, determine the most appropriate cylinder package.
The most appropriate cylinder package is the package which fits a user package with a volume
greater than 60% of the volume of the package and less than 90% of the volume of the
package: 0.6 * package volume < desired volume < 0.9 * package volume
plus
its dimensions fit the dimensions of the package.
If a package is found, display the id of the package to be used plus the volume of the package
and the volume of the user’s package.
If such package does not exist, just let the user know.
After the calculation is complete, the program will ask the user if they want to input another
one and allow them to do this if the reply is Y or y.
NOTE:
Provide a testing plan for the project brief application.
You are required to hand in:
a) all the Java source for your solution
b) the testing plan
 

Similar threads

Back
Top