Question

Write a Java Program using NetBeans to calculate student 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: one-dimensional array to store the student names, a(parallel) two dimensional arrays to store the test score and a parallel one dimensional array to store the grades. Your program must contain at least the following methods: a method to read and store data into two arrays, a method to calculate the average score and grade and a method to output the results.

Have the program also be computed as follows:

Marks Grades
85-100 A
75-84 B
65-74 C
50-64 D
<50        F

Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

public class AverageTestScores {

public static void main(String[] args) throws FileNotFoundException
{

int[][] scores;
String[] names = new String[10];
scores = readData(new Scanner(new File("input.txt")), names);
getAndPrintAverage(scores, names);
}

public static int[][] readData(Scanner input, String[] names)
{
int[][] scores = new int[10][5];
for(int i = 0; i < 10; i++)
{
names[i] = input.next();
for(int j = 0; j < 5; j++)
scores[i][j] = input.nextInt();
}
return scores;
}...

This is only a preview of the solution. Please use the purchase button to see the entire solution

Related Homework Solutions

Bellman-Ford Algorithm in Java
Homework Solution
$40.00
Programming
Computer Science
Java
Bellman-Ford Algorithm
Matrix
Cost
Distance
Iterations
Loops
Conditions
Vertices
Edges
Paths
Java Programming: Integer Problems
Homework Solution
$20.00
Programming
Java
Computer Science
Integers
Variables
Average Values
Even Numbers
Odd Numbers
Loops
Statements
Input
Output
File Management
Conditions
Error Messages
Exceptions
Java Programming Assignment
Homework Solution
$40.00
Java Programming
Computer Science
Arrays
Dynamic Allocation
ArrayList
Constructor
Binary Tree in Java
Homework Solution
$40.00
Java
Programming
Coding
Computer Science
Binary Tree
Data
Generic Types
Functions
Variables
Recursive Methods
Nodes
Input
Output
Get help from a qualified tutor
Live Chats