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:

  1. Using JOptionPane's showInputDialog, asks a user to enter the radius of a sphere.
  2. Converts the input String to a double.
  3. Checks to ensure that the input is greater than 0. If not, prints an error message using JOptionPane's showMessageDialog and quits; otherwise:
  4. Computes the volume of the sphere v = 4/3*PI*r3, using the Math class as needed to form the equation.
  5. 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:
  1. 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: