Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a java program which: 1. Prompts the user for 5 test scores as integers greater than or equal to zero and less than or

Write a java program which: 1. Prompts the user for 5 test scores as integers greater than or equal to zero and less than or equal to 100.

2. Validates that the user entries are valid (integers greater than or equal to zero and less than or equal to 100).

3. Stores the 5 tests scores in an array.

4. Uses the bubble sort to sort the scores in ascending order.

5. Calculates the letter grade for each test

6. Displays the letter grade of each score as well as the overall average (the average of the 5 tests). SPECIFIC REQUIREMENTS 1. You must include a method called calcAverage to compute the average of the 5 test scores; it takes an array of type int as a parameter and returns the average. 2. You must include a method called validateUserInput to ensure user entries are integers greater than or equal to zero and less than or equal to 100.

3. You must include a method determineGrade to compute the average of the 5 test scores; it takes an int array with the test scores and a char array to store the corresponding letter grades. The letter grade is arrived at using the table below: image text in transcribed

4. You must include a method called bubbleSort which sorts the values (test scores) stored in the array in ascending order.

5. You must include a method called displayTestScores which displays each test score and its corresponding letter, as well as the overall average. GENERAL RESTRICTIONS 1. No infinite loops, examples include: a. for(;;) b. while(1) c. while(true) d. do{//code}while(1);

2. No break statements to exit loops

Output:

image text in transcribed

Letter score Grade 90 80 and

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

The Structure Of The Relational Database Model

Authors: Jan Paredaens ,Paul De Bra ,Marc Gyssens ,Dirk Van Gucht

1st Edition

3642699588, 978-3642699580

More Books

Students also viewed these Databases questions