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

Java Program For Longest Path in Graph
Homework Solution
$40.00
Java
Programming
Codes
Algorithms
Graph Theory
Classes
Nodes
Edges
Paths
Distances
Loops
Statements
Variables
Input Files
Output Files
HashMap
Array
Integers
Methods
Java Programming Problems
Homework Solution
$40.00
Computer Science
Java Programming
Directed Graph
Arrays
Strings
Hash Maps
Functions
Nodes
Edges
Topological Sort
Recursion
Classes
Builders
File Management
Money Problems in Java
Homework Solution
$20.00
Java
Programming
Codes
Algorithms
Money
Dimes
Nickels
Pennies
Input
Output
Integers
Statements
Variables
Accounting
Recursion Methods
Finance
Java Programming Problems
Homework Solution
$50.00
Computer Science
Java Programming
Algorithms
Loops
Data
Graphic Dialog Box
Objects
Classes
Statements
Variables
Inventory
Input
Output
Verification
File Management
Items
Simple & Compound Interest Using Java
Homework Solution
$65.00
Java
Programming
Codes
Algorithms
Computer Science
Statements
Variables
Loops
Input
Output
Integers
Strings
Simple Interest
Compound Interest
Money
Finance
Annual Rates
Calculations
Functions
Screen Messages
Java Programming Problems
Homework Solution
$75.00
Computer Science
Java Programming
Integers
Strings
Algorithms
Codes
Constructor
Sensors
Parameters
Scaling
Critical Evaluation
Compile-Time Errors
Get help from a qualified tutor
Live Chats