PIC20A

Homework 1: Average

Assignment

This is a very very easy Homework. You are going to write a program to calcalate the avarage of some numbers.

Sample Program

You can download the program Average.class on your computer. After you download it, open a DOS prompt, use cd to change to the correct folder. Use java Average num1 num2 ... to run the program. or
You can go to the computer lab. Open a DOS prompt. Type H:, and then cd H:\class\p20a.1\. Use java Average num1 num2 ... to run the program.

Sample Section

Z>java Average 1 2 3 4 5
The average is 3.0

Z>java Average 5 6 7
The average is 6.0

Z>java Average 1.1 2.3 5.6 9.02 -2 5.7
The average is 3.6199999999999997

Z>java Average
Usage: Average num1 num2 ....
calculates the average of the numbers

Z>java Average 2.3 3.7 5.6 9.1
The average is 5.175

Important Notes and Hints

What to submit

Call your source code file Average.java. Put this file in your submit folder. Do not place this file inside another folder within your submit folder.

Remark