Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you please help me with this Java Program? Please add comments so that I can understand. Array Processing You are to design a program

Can you please help me with this Java Program?

Please add comments so that I can understand.

Array Processing

You are to design a program that will allow the user to enter some number of grades. After the grades have been collected, your program should calculate and output the mean, median, and standard deviation of the grades as well as outputting the sorted grade data.

Program Requirements

Load an array with test integer scores provided by the user. The user will specify how many scores are to be entered. A test score must be between 0 and 100. Anything outside this range is invalid and must not be added to the array.

Calculate and display the average of the scores in the array (sum of all values / number of values). Make sure to use floating point math and display the average with 1 digit following the decimal point.

Find the median value in the array of test scores. The median of a list of numbers is the number in the list such that half the numbers are above it and half the numbers are below it. In order to find the median, this function will need to sort the array. After the array has been sorted, the median value is the middle element from the array. Hint: Use Arrays.sort( ) to sort the data in the array. Display the median value.

Calculate and display the standard deviation of the scores. The standard deviation is found by doing the following:

For each value in the array, find the square of the value minus the average and add that to a running sum.

Divide the final running sum by the number of values

The standard deviation is the square root of the result from step 2.

Display the standard deviation with 1 digit following the decimal point.

Finally, display the sorted array data, 5 values per line.

Note: Include comments at the beginning of each of the 5 steps listed above describing what is to be done in that step.

Create a zip file of the project and upload your zip file to the Pilot drop box before the lab due date. Also, copy your source code into a text file (preferably Wordpad) and submit that separately to the drop box. Ask your TA for help if you have any questions.

NOTE: If the submitted project does not compile, it will receive zero points.

Rubric (25 pts)

Load array with data, rejecting values outside range (5 pts)

Calculates and correctly displays average of scores (4 pts)

Finds and correctly displays median of scores (4 pts)

Finds and correctly displays standard deviation (5 pts)

Correctly displays sorted data as described (4 pts)

Comments and programming style (3 pts)

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

Professional Microsoft SQL Server 2014 Administration

Authors: Adam Jorgensen, Bradley Ball

1st Edition

111885926X, 9781118859261

More Books

Students also viewed these Databases questions