Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

Students also viewed these Databases questions

Question

=+j Enabling a productive global workforce.

Answered: 1 week ago

Question

=+ Are you interested in creating or

Answered: 1 week ago

Question

=+working on a micro-multinational?

Answered: 1 week ago