CISS-110 Project 3
This project deals with reading input from the user, storing the input into variables and displaying those variables.
showMessageDailog()
in the textbook that use String.format()
, you do not need to use it for this project.Learning outcomes
- Build a program from the ground up.
- Introduce basic GUI tools.
- Using correct data types.
- Watching for lost precision in calculations.
- Working with
Integer.parseInt()
. - Confirmation program produces desired results.
This program is just like project 2, but now we will use the JOptionPane
class for the I/O and the wrapper classes to convert the input strings into primitive values.
The following identifiers will be used:
int diameter, height;
double radius;
double circumference, areaOfCircle, cylVolume;
String name;
You will still define a double
named constant whose value is 3.1415926.
Prompt the user for their name and using the showInputDialog()
method, read the name of the user. Once the name of the user has been read, greet the user. Proceed to get the diameter and height of some aluminum can (cylinder) using the showInputDialog()
method. Be sure to inform the user that these are integer quantities.
Calculate the circumference of the base of the can, the area of the base (using the pow()
method of the Math
class) and the volume of the cylinder. Display the radius, diameter, height, circumference, area of the base and volume of the cylinder using showMessageDialog()
.
Your output should resemble (user provided values in the dialog boxes):
Submit the project to the Learning Management System as Project3_lastname.java.