Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

MFDBS 89 2nd Symposium On Mathematical Fundamentals Of Database Systems Visegrad Hungary June 26 30 1989 Proceedings

Authors: Janos Demetrovics ,Bernhard Thalheim

1989th Edition

3540512519, 978-3540512516

More Books

Students also viewed these Databases questions

Question

1.Which are projected Teaching aids in advance learning system?

Answered: 1 week ago