PIC20A

Homework 1: GPA calculator

Assignment

This is a very very easy Homework. You are going to write a program name GPA.java to calcalate GPA.

Sample Output

Z:>java GPA
java GPA unit1 grade1 unit2 grade2 ....  calculates the GPA.

Z:>java GPA 3 A
Your GPA is 4.0

Z:>java GPA 5 A 4 B
Your GPA is 3.5555555555555554

Z:>java GPA 5 A 5 B
Your GPA is 3.5

Z:>java GPA 5 A 5 B 2 D
Your GPA is 3.0833333333333335

Z:>java GPA 5 A 5 B 2 D 3 C
Your GPA is 2.8666666666666667

Z:>java GPA 5 A 5 B 2 D 3 C 5 A
Your GPA is 3.15

Explanations

Hint

What to submit

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

Remark

Solution

GPA.java