Question: package javaapplication2; public class Question2{ public static void main(String[] args) { int row, col = 0; int average, total = 0; int[][] y = {{85,83,77,91,76},
package javaapplication2; public class Question2{ public static void main(String[] args) { int row, col = 0; int average, total = 0; int[][] y = {{85,83,77,91,76}, {80,90,95,93,48}, {78,81,11,90,73}, {92,83,30,69,87}, {23,45,96,38,59}, {60,85,45,39,67}, {77,31,52,74,83}, {93,94,89,77,97}, {79,85,28,93,82}, {85,72,49,75,63} }; String[] names = {"Johnson" , "Aniston" ,"Cooper", "Gupta", "Blair", "Clark", "Kennedy", "Bronson", "Sunny", "Smith"}; System.out.println("Name \t\tS1 \tS2 \tS3 \tS4 \tS5 \tAverage \tGrade "); for(row=0; row<=9; row++) { System.out.print(names[row] + "\t\t"); total = 0; for(col=0; col<=4; col++) { System.out.print(y[row][col] + "\t"); total = total + y[row][col]; } average = total/5; System.out.println(average + "\t\t" + getGrade(average)); } } public static String getGrade(int average) { if(average >=85 && average <=100) { return "A"; } else if (average >=75 && average <=84) { return "B"; } else if (average >=65 && average <=74) { return "C"; } else if (average >=50 && average <=64) { return "D"; } else{ return "F"; } } }
Can someone help me insert and point out the arrays required by the question
Write a program to calculate students average test scores and their grades. You may assume the following 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 Smith 85 72 49 75 63 Use three arrays : a one-dimensional array to store the student names, a(parallel) two-dimensional array to store the test score, and a parallel one-dimensional array to store grades. Your program must contain at least the following methods: a method to read and store data into two arrays, a method to caluclate the average test score and grade and a method to output the results. Have your program also output the class average Grade Calculation to be computed as follows 85-100 A 75-84 B 65-74 C 50-64 D <50 F In JAVA netbeans as a local file.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
