Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program to calculate students’ average test scores and their grades. You

ID: 664283 • Letter: W

Question

Write a program to calculate students’ average test scores and their grades. You may assume the following input data:

Johnson 85 83 77 91 76

Aniston 80 90 95 93 48

Cooper 78 81 11 90 73

Gupta 92 83 30 69 87

Blair 23 45 96 38 59

Clark 60 85 45 39 67

Kennedy 77 31 52 74 83

Bronson 93 94 89 77 97

Sunny 79 85 28 93 82

Smithy 85 72 49 75 63

Program in Java

Use three arrays: a one-dimensional array to store the students names, a (parallel) two-dimensional array to store the test scores, and a parallel one-dimensional array to store grades. Your program must contain at least the following functions: a function to read and store data into two arrays, a function to calculate the average test score and grade, and a function to output the results. Have your program also output the class average.

Explanation / Answer

this question has lot of subparts.

import java.util.Scanner;

public class testScores {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String name;
        float avg;
        String l_grade;
      
        System.out.print("Enter student's name: ");
        name = scan.nextLine();
      
        avg = calculateAverage();
        l_grade = calculateGrade(avg);
      
      
        System.out.print("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
        System.out.print(" Name: "+name);
        System.out.print(" Letter Grade: "+l_grade);
        System.out.print(" Average: "+avg);
        System.out.print(" @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
      
}

public static float calculateAverage()
{
     float grd;
     float sum = 0;
     float average = 0;
     Scanner scan = new Scanner(System.in);
     for(int i=0;i<5;i++)
     {
         System.out.print("Enter a grade: ");
         grd = scan.nextFloat();
         sum = sum + grd;
     }
   
     average = sum / 5;
  
     return average;
}

public static String calculateGrade(double average)  
{
    String gradeLetter = "";
    if (average >= 90 && average <= 100)
    {
        gradeLetter = "A";
    }
    else if (average >= 80 && average <= 89)
    {
        gradeLetter = "B";
    }
    else if (average >= 70 && average <= 79)
    {
        gradeLetter = "C";
    }
    else if (average >= 60 && average <= 69)
    {
        gradeLetter = "D";
    }
    else if (average >= 0 && average <= 59)
    {
        gradeLetter = "F";
    }
return gradeLetter;
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote