Question: Programming using Java Can anyone please help me with this? Exercise 1 Write a program to read n grades from the input file input.txt and
Programming using Java
Can anyone please help me with this?
Exercise 1
Write a program to read n grades from the input file input.txt and store them in an array. Your program must print the grades sorted in ascending order. Program must calculate and print the mean and the standard deviation of the grades.
Note:
Use Scanner class to read n and the grades from input.txt file
Mean is the average of all the grades
Standard deviation is given by the formula that is given below.
Where is the mean, N is the number of grades in the array and xi is the ith grade.
Hint: You can use Arrays.sort(arr) to sort the array by name arr.
Sample input.txt (The value on first line indicates the number of grades):
5
65.75 68.25 85.50 88.35 70.00
Sample output:
Printing grades in sorted order
65.75 68.25 70.0 85.5 88.35
Printing avergae and standard deviation
Ave = 75.57000000000001
SDev = 10.52346188285965
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
