Class 1, Part 2 Intro to Java 30-IT-296  

30-IT-296 Assignment 1

Summer Quarter 2003 Note:
Updated Weds, July 9, 2003. Changed due dates to reflect changes made in class on 7/10/03.

This is the assignment is divided into three parts, due at three times throughout the quarter. These parts include:

I will post updates to this page in blue text.

Part 1, Due 7/24/03 6:30 PM

Write the structure for two classes (.java files).

The first class...

The second class...
  Grading Criteria:


Notes:
Please upload your source files (.java files) via blackboard by Wednesday, July 24, 2003 by 6:30 PM. Late penalties begin at 6:31 PM on Wednesday, July 24.

These classes do not need to do anything at this point. Eventually, we will enhance them as detailed in part 2 below. But for now, all I am looking for is the general structure of the classes - proper use of methods, variables, curly braces, etc., as described above. Feel free to add functionality in addition to the above specifications; however, this is not required.

Part 2, Due Week 7

Part A:

Pretend you work for a bank. Your boss has asked you to make an online savings calculator, where
customers can calculate the value of their money after interest compounds for a number of periods.  You must prompt the user
for a beginning principal (deposit amount), rate of interest per period, and number of periods.  You must then display, via System.out.println(); the balance at the end of each period.  The interest must compound once at the end of the period (only once per period, don't compound more than that).

Hints:

After the above calculation, use System.out.println(); to print the balance at the end of the period.  Print one line per period.
For each period, print the period number, interest earned, and ending balance.

Part B:

Use the command line arguments (or Properties - Execution - Arguments in Sun ONE) to get a fahrenheit temperature from the user.  If no temperature is provided from the command line, use a default of 35.  Compute the celcius equivalent, using the formula below, and print it to standard output via System.out.println();

            Celsius = (Fahrenheit – 32)*5/9

Hints (Updated for clarity, 8/11/2003):

  1. Do not use JOptionPane.showInputDialog to get the temperature. Instead, set the temperature with the command line or the Sun ONE properties window, described above. Then, get the temperature as the first element in the args array.
  2. You'll need to test the array length to see if a temperature has been passed in via args. If so, use hint #1 above to get the temperature. If not, use the default value 35 fahrenheit to calculate the celcius equivalent temperature.
  3. If you attempt to access an array element that does not exist, you will get a NullPointerException. If no arguments are passed and you attempt to get the first element of the array, you will get this error. The test described in hint #2 above should make sure this never happens.
  4. See the HelloWhirled example from the first class for a refresher on using args.
Grading Criteria:

Overall:

Did something extra, something beyond the minumum requirements stated here: 10
Commented: 10

Assignment 1:

Calculations are correct: 10
Prompts are correct: 10
Proper use of loop: 10
Proper creation and formatting of table: 10

Assignment 2:

Calculations are correct: 10
public static void main(String args[]) method is set up correctly,
and fahrenheit temperature is properly retrieved from command line: 10
Default temperature is used if none are set in the command line, otherwise the command argument is used: 10
Proper conversion of data types: 10

Additional Deductions:

Code not in good form (sloppy, bad spelling, etc.): up to -10
Late: -10% at the beginning each 24 hour period, starting promptly at 6:30 PM on the due date.
Copying someone else's work: F for the entire quarter.
NO credit will be given for assignments more than four days late.


Part 3, Due Week 9
Update 8/15/2003: Clarified assignment with more strikethrough.  New text in blue.
Update 12/3/2003: Eliminated strikethrough.




Created by:  Brandan Jones January 23, 2002