Overview

This lab gives you practice using arrays in Java.

import javax.swing.*       // for JOptionPane methods 

LEGEND: Keyboard    Screen

Task 1: GradeCalculator

Write a Java program that calculate grades based on points earned and points possible. Use two arrays of doubles: pointsEarned and pointsPossible. First prompt the user for how many grades they would like to enter, then use a loop to get the values from the user; e.g.:

> How many scores do you have to enter? 5
> 
> How many points did you earn on assignment #1? 32.5
> How many points were possible on assignment #1? 33.0
>
> How many points did you earn on assignment #2? 54
> How many points were possible on assignment #2? 60

After reading in the values, the program should calculate the percentage score for each assignment (e.g., 20 points out of 25 possible = 80%), storing the results in a third array. The program should then calculate and display the following:

Copyright © 1999-2008| Gene Rohrbaugh | Privacy Statement