SE-0010 Software Development 1
Lab 1: Java Basics
Assignment
Create a Java project called SE0010Lab1. Within the
project, create a package that is your MSOE email name. Within this package,
create a class called Lab1App. This class will have only one method - main().
Within the main() method, write the Java instructions that
do the following:
- Using JOptionPane's showInputDialog, asks a user to
enter the radius of a sphere.
- Converts the input String to a double.
- Checks to ensure that the input is greater than 0. If
not, prints an error message using JOptionPane's showMessageDialog and
quits; otherwise:
- Computes the volume of the sphere v = 4/3*PI*r3,
using the Math class as needed to form the equation.
- Using JOptionPane's showMessageDialog, prints the
volume of the sphere with 3 decimal places of precision (for example:
10.125) using DecimalFormat as needed for formatting.
Complete this program during the lab, and demonstrate it
to me.
Lab Submission (due 8:00am, Monday following
lab)
Submit your assignment following these instructions:
-
Email your completed Java program to hornick@msoe.edu. For this
program, your program will consist of a single .java file.
Be sure to keep copies of all your files, in case something gets lost.
Your grade will be based on the following criteria:
- Meeting requirements - that is, a working Java
program..
- Technical quality of both your program. For the program, technical quality consists of formatting,
commenting, and following coding style guidelines we discussed in lectures
and the textbook.
- Spelling and grammar.
- Timeliness of submission as stated in the
course policies.