Question: Write a java program to store and process 2 test scores for a class of 4 students. Your program will prompt for the test scores

Write a java program to store and process 2 test scores for a class of 4 students. Your program will prompt for the test scores as shown in the sample run (note the numbering in the prompts). After all the data is entered, your program will display the scores for test 1, test 2, the average and the letter grade for each student in a tabular format.

The average is converted to a letter grade using the following table:

Average ( 100 at maximum)

> 90 A

> 80 B

> 70 C

less F

You must use 2 arrays of integers to store the 2 test scores for each student. You must use a third array to store the average and a fourth array to store the letter grade. You must print the test scores using 3 digits, and the average with 3 digits before the decimal point and 1 decimal place.

Your sample runs must follow the exact format.

Sample Run:

For test 1,

Enter score 1: 90

Enter score 2: 82

Enter score 3: 39

Enter score 4: 89

For test 2,

Enter score 1: 59

Enter score 2: 80

Enter score 3: 100

Enter score 4: 92

Test 1 Test 2 Average Grade

-------- ---------- ------------- ------------

090 059 074.5 C

082 081 081.0 B

039 100 069.5 F

089 092 090.5 A

Four arrays are needed to store test1s, test2s, average scores and letter grades.

int[] testOne = new int[4]; // Students test one grades

int[] testTwo = new int[4]; // Students test two grades

double[] average = new double[4]; // Students average grades

char[] grade = new char[4]; // Students letter grades

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!