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

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

ID: 3904514 • Letter: P

Question

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;

}

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

{

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

if(total[i]>=450)

{

System.out.println("A");

}

else{

if(total[i]>=400)

{

System.out.println("B");

}

else

{

if(total[i]>=350)

{

System.out.println("C");

}

else

{

if(total[i]>=300)

{

System.out.println("D");

}

else

{

System.out.println("F");

}

}

}

}

}

}

}

How can I add to this code the following:

the criterion of the grade A is
A: >= Average of the students + (2 × Standard Deviation of the students)
B: >= Average of the students + (1 × Standard Deviation of the students) (but less than “A”)
C: >= Average of the students (but less than “B”)
D: >= Average of the students – (1 × Standard Deviation of the students) (but less than “C”)
F: < Average of the students – (2 × Standard Deviation of the students)

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

If you have any doubts, please give me comment..

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");

}

}

}

}