Overview
This lab gives you practice using arrays in Java.
- Correct Javadoc header comments, including Java Class name, description, @author and @version tags.
- Correct Javadoc method comments, including a description of what it does, along with @param and @args as appropriate.
- A comment at the end of each import line, indicating why you need to import that class. For example:
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:
- Display a table showing:
- points earned on each assignment, separated by tabs, formatted to one digit after the decimal (review DecimalFormat).
- points possible on each assignment, separated by tabs, formatted to one digit after the decimal.
- percentage points for each assignment, separated by tabs, formatted to one digit after the decimal.
- Note: for the purposes of formatting the table, assume scores are no wider than 4 characters (XX.X) and that there are no more than 10 scores.
- Which assignment scored the maximum percentage score? What was the score?
- Which assignment scored the minimum percentage score? What was the score?
- What was the overall total of points earned?
- What was the overall total of points possible?
- What was the overall percentage score? (total of points earned / total of points possible)?
