also, trying to submit this assignment within and hour so a quick response is greatly appreciated..thanks
i updated my code and while im not getting the same error its only allowing me to enter 3 numbers and giving me this out put.
Please enter a MidTerm1 grade:
100
Now
Please enter a MidTerm2 grade:
90
Now
Please enter a Final Exam grade:
90
Your highest test score is: 0.0Your lowest test score is: 0.0Your highest test score is: 0.0Your lowest test score is: 0.0Your highest test score is: 0.0Your lowest test score is: 0.0Your highest test score is: 0.0Your lowest test score is: 0.0Your highest test score is: 0.0Your lowest test score is: 0.0Your highest test score is: 0.0Your lowest test score is: 0.0Your highest test score is: 0.0Your lowest test score is: 0.0Your highest test score is: 0.0Your lowest test score is: 0.0Your highest test score is: 0.0Your lowest test score is: 0.0You have entered following grades for midTerm1: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 100.0]
You have entered following grades for midTerm2: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 90.0]
You have entered following grades for Final Exam: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 90.0]
import java.util.Scanner;
import java.util.Arrays;
public class Assign9_Roberts
{
public static void main(String[] args)
{
//input scanner
Scanner input = new Scanner(System.in);
double[] grades = new double[9];
double[] midTerm1 = new double[9];
double[] midTerm2 = new double[9];
double[] finalExam = new double[9];
// add midterm1 , midterm2 and final grades and store them in grade array
for (int i=0; i<finalExam.length; i++ ) {
grades[i] = midTerm1[i] + midTerm2[i] + finalExam[i];
}
System.out.println("Please enter a MidTerm1 grade:");
midTerm1[8] = input.nextDouble();
System.out.println("Now");
for(int B=0; B<midTerm2.length;B++){
}
System.out.println("Please enter a MidTerm2 grade:");
midTerm2[8] = input.nextDouble();
System.out.println("Now");
for(int C = 0; C<finalExam.length; C++){
}
System.out.println("Please enter a Final Exam grade:");
finalExam[8] = input.nextDouble();
double max = grades[0];
double min = grades[0];
//Display highest score
for (int t = 0; t < grades.length; t ++)
{
if (grades[t] > max)
{
max = grades[t];
}
System.out.print("Your highest test score is: " + max);
//Display lowest score
if(grades[t] < min)
{
min = grades[t];
}
System.out.print("Your lowest test score is: " + min);
}
System.out.print("You have entered following grades for midTerm1: ");
System.out.println(Arrays.toString(midTerm1));
System.out.print("You have entered following grades for midTerm2: ");
System.out.println(Arrays.toString(midTerm2));
System.out.print("You have entered following grades for Final Exam: ");
System.out.println(Arrays.toString(finalExam));
}
}