Question
Write a Java program that reads the size of an array to store student score information, along with their names. You will need to create
Write a Java program that reads the size of an array to store student score information, along with their names. You will need to create two arrays of type String and double i.e. name[] and score[] respectively.
First read the number of students that need to be analyzed, which will determine the size of both the arrays. After reading the size, create arrays of that size and then read each students name and their score.
For simplicity of this assignment, you will only consider score of one subject and therefore you will only create one double array.
Use JOptionPane messages for the program input and output.
The program must calculate and tabulate the score distribution and the number of students whose score falls within a certain range.
Also the program must calculate the difference (i.e. called range in statistics) between the smallest and highest score among all the students. That is, range = highest score smallest score
The output must be as shown below:
Score group Number of Students Average Score
0 20 4 1 5.15
21 40 6 26.29
41 60 5 45.15
61 80 5 72.17
81 100 3 91.56
Average score of all students: 45.17
Score group that has most students: 21 40
Score range of all students: 40
After displaying the above output, pass the original score[] as input parameter to a method scoreVariance(). For each value in the score array, this method calculates (score average score within corresponding score group) and saves the result value in the same array entry.
For eg. say, score[4] is 56 and the corresponding score group is 41 60.
Then from the above example output, the average score for 41 60 score group is 45.15. So the (score[4] 45.15) = 10.85 and store this value in score[4]. Perform the above for all values of score[] and then return from the method.
After return from the method, in main() method, display all the values in score[] separated by comma using JOptionPane message box.
The program must have the functionality broken into appropriate methods.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started