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

For this Java code so far: import java.util.*; public class GradingApp { public

ID: 3907769 • Letter: F

Question

For this Java code so far:

import java.util.*;

public class GradingApp {

public static void main(String[] args) throws java.lang.Exception {

Scanner sc = new Scanner(System.in);

System.out.println("Enter how many students");

int n = sc.nextInt();

int a[] = new int[100];

int b[] = new int[100];

int total[] = new int[100];

for (int j = 1; j <= n; j++) {

int sum = 0;

System.out.println("Enter the student" + j + "Scores");

for (int i = 1; i <= 4; i++) {

System.out.println("Exam #" + i + "Score");

a[i] = sc.nextInt();

System.out.println("Assigment #" + i + "Score");

b[i] = sc.nextInt();

sum = a[i] + b[i] + sum;

}

total[j] = sum;

}

double mean = 0.0, sd = 0.0;

for (int i = 1; i <= n; i++) {

mean += total[i];

}

mean /= n;

for (int i = 1; i <= n; i++) {

sd += (total[i] - mean) * (total[i] - mean);

}

sd /= n;

sd = Math.sqrt(sd);

for (int i = 1; i <= n; i++) {

System.out.println(total[i]);

if (total[i] >= mean + (2 * sd)) {

System.out.println("A");

} else if (total[i] >= mean + (1 * sd)) {

System.out.println("B");

} else if (total[i] >= mean) {

System.out.println("C");

} else if (total[i] >= mean - (1 * sd)) {

System.out.println("D");

} else {

System.out.println("F");

}

}

}

}

Requests:

1.There is a catch for this assignment. The thing is that the mean and the standard deviation sometimes do not exactly cover the entire system. Say your mean is 50 and your standard deviation is only 2.5. Then, however you do, you cannot clearly divide between A and B, B and C because doubling only covers up to 5. So, C is between 55 and 45. There will be some gaps. What about too much standard deviation? Say, it is 10. Then, there will be some overlaps. So, the trick is depending on the standard deviation and the mean, try to regulate those values accordingly so that there may not be either gaps or overlaps.

2. Can you get it to output the final grades like this: Student 1 Final Grade:, Student 2 Final Grade, Student 3 Final Grade..............

O- Sign You are to build a grading app for an instructor who needs to enter a. Exam #1 Score (0-50 points), b. Exam #2 Score (0-50points), c. Exam #3 Score (0-50 points), d. Exam #4 Score (0-50 points), Assignment#1 Score (0-75 points), e. Assignment #2 Score (0-75points), Assignment #3 Score (0-75 points), f, g, h. Assignment #4 Score (0-75 points). Ater entering all the scores, the madmum scores one student can get is 500. Based on the criteria given below, print the grade for the instructor Finalscore>? 450 :"A, Finalscore.400: "?", Finalscore>-3S0: "?", FinalScore: 300: Else:"P However, since the Instructor is very generous, he wants to give better grades to the students based on the statistics of the students (this is an example only, not an actual case with youl. Say, the distribution of the total points of 10 students are 400 350 370 280 300 290 310 340 350 330 Then, the criterion of the grade A is A: >e Average of the students + (2 × Standard Deviation of the students) B: >- Average of the students+(1 x Standard Deviation of the students) (but less than "A") C:>- Average of the students (but less than "B") D:xe Average of the students-(1 x Standard Deviation of the students) (but less than "C-) F:

Explanation / Answer

import java.io.*;
import java.util.*;
import java.lang.*;

public class DemoGrade{

public static int getInput(double[][] scores){

    Scanner sc = new Scanner(System.in);
    System.out.println("Enter number of students:");
    int n = sc.nextInt();
    for (int i = 0; i<n; i++){
       for (int j = 0; j<4; j++){
           System.out.print("Enter #" + (j+1) + "Score(0-50):");
           scores[i][j] = sc.nextDouble();
       }
       for (int j = 4; j<8; j++){
           System.out.print("Assignment #" + (j+1) + "Score(0-75):");
           scores[i][j] = sc.nextDouble();
       }

    }
    return n;
}

public static double calculateMeanGrade(double[][] data,int n,String[] grades){
    double total = 0;
    for (int i = 0; i<n; i++){
        double sum = 0;
        for (int j = 0; j<8; j++){
           sum = sum + data[i][j];
        }
        if (sum >= 450)
           grades[i] = "A";
        else if (sum >= 400 )
           grades[i] = "B";
        else if (sum >= 350 )
           grades[i] = "C";
        else if (sum >= 300 )
           grades[i] = "D";
        else
           grades[i] = "F";
        data[i][8] = sum;
        total = total + sum;

    }
    return total/n;
}

public static double Deviation(double data[][], int n, double m){
    double total = 0;
    for (int i = 0; i<n; i++){
        total = total + (data[i][8]- m)*(data[i][8]- m);
    }
    double avg = total/n;
    return Math.sqrt(avg);
}

public static void calculateModified(double[][] data, int n, String[] grades,double mean, double deviation){
    for (int i =0; i<n; i++){
        if (data[i][8] >= (mean + 2 * deviation))
           grades[i] = "A";
        else if (data[i][8] >= (mean + 1 * deviation))
           grades[i] = "B";
        else if (data[i][8] >= mean)
           grades[i] = "C";
        else if (data[i][8] >= (mean - 1 * deviation))
           grades[i] = "D";
        else if (data[i][8] < (mean - 2 * deviation))
           grades[i] = "F";  
            
    }
  
}

public static void Display(double[][] data, int n, String[] mgrades){
    for (int i = 0; i<n; i++){
       System.out.println("Student " + i + " " + mgrades[i]);
    }
}

public static void main(String[] args){
       
        double[][] scores = new double[100][9];
        String[] grades = new String[100];
        String[] mgrades = new String[100];
        int n = getInput(scores);
        double mean = calculateMeanGrade(scores,n,grades);
        double stddeviation = Deviation(scores,n,mean);
        for (int i = 0; i<n; i++){
            mgrades[i] = grades[i];
        }
        calculateModified(scores,n,mgrades,mean, stddeviation);
        Display(scores,n,mgrades);
       
}
}