Question: Java I - Write a Java program that will first ask the user how many grades they want to enter. Then use a do..while loop

Java I - Write a Java program that will first ask the user how many grades they want to enter. Then use a do..while loop to populate an array of that size with grades entered by the user. Then sort the array. In a for loop read through that array, display the grades and total the grades. After the loop, calculate the average of those grades and display that average.

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

  • Prompt the user for the number of grades they would like to find the average of. This will be the length of the array you want to create.

  • Create an array of the proper size to hold the grades the user will enter.

  • Set up a do..while loop to read in the grades that will populate the array.

  • Sort the array using the Arrays.sort method.

  • Set up a for loop to iterate through the array you just created and accumulate those grades.

  • Find the average of those grades.

  • Use: good variable names, indentations of four spaces, comments within the program code, and label the output appropriately.

  • Output all of the grades, sorted from lowest to highest, and then the average. Label the output so that anyone reading it would understand what they were looking at.

  • Add lots of comments so that anyone reading it would understand what they were looking at.

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!