Skip to content

Programming by Design

If you're not prepared to be wrong, you'll never come up with anything original. – Sir Ken Robinson

  • About
  • Java-PbD
  • C-PbD
  • ASM-PbD
  • Algorithms
  • Other

CISS-110 Project 3

Posted on January 20, 2021January 20, 2025 By William Jojo
CISS-110-Project
CISS-110 Project 3

This project deals with reading input from the user, storing the input into variables and displaying those variables.

Although there are examples of showMessageDailog() in the textbook that use String.format(), you do not need to use it for this project.

You can use the concatenation operator (+) to join text and values.


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):

project 3-1

project 3-2

project 3-3

project 3-4

project 3-5


Submit the project to the Learning Management System as Project3_lastname.java.

Post navigation

❮ Previous Post: CISS-150 Project 6 – Swap/Paging Space
Next Post: Python and Java ❯

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Copyright © 2018 – 2025 Programming by Design.