Question: package javaapplication 9 5 ; import java.util.Scanner; public class GradeCategorization { public static void main ( String [ ] args ) { Scanner scanner =
package javaapplication;
import java.util.Scanner;
public class GradeCategorization
public static void mainString args
Scanner scanner new ScannerSystemin;
int grades new int; Array to store grades for students in courses
Input grades for Math
System.out.printlnEnter the degree of the ten students for Math separated by space:";
for int i ; i ; i
gradesi scanner.nextInt;
Input grades for Science
System.out.printlnEnter the degree of the ten students for Science separated by space:";
for int i ; i ; i
gradesi scanner.nextInt;
Input grades for English
System.out.printlnEnter the degree of the ten students for English separated by space:";
for int i ; i ; i
gradesi scanner.nextInt;
scanner.close;
int degreeCount new int; Array to count students in each degree for each course
Categorize grades and count students in each degree for each course
for int i ; i ; i
for int j ; j ; j
if gradesij && gradesij
degreeCounti;
else if gradesij && gradesij
degreeCounti;
else if gradesij && gradesij
degreeCounti;
else if gradesij && gradesij
degreeCounti;
else
degreeCounti;
Display the number of students in each degree for each course
System.out.println Grade Math Science English ;
System.out.println;
for int i ; i ; i
System.out.printfs d d d
getGradeLabeli
degreeCounti
degreeCounti
degreeCounti;
Calculate and display success rate in percentage for each course
int totalStudents ;
int successCount new int;
for int i ; i ; i
successCounti totalStudents degreeCounti; Total students minus F grades
int successRate new int;
for int i ; i ; i
successRateisuccessCounti totalStudents;
System.out.println Success Rate successRate successRate successRate;
Helper method to get the grade label based on index
private static String getGradeLabelint index
switch index
case :
return A;
case :
return B;
case :
return C;
case :
return D;
default:
return F;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
