Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create an application that reads a file called Test Scores.txt with 11 scores. P

ID: 655841 • Letter: C

Question

Create an application that reads a file called Test Scores.txt with 11 scores. Place the data in an array or list and display the content of the array or list in a listbox.

Calculate the lowest score, highest score, median score, average score and the standard deviation of the scores. Display those values.

Write methods that accept an array or list and returns lowest score, highest score, median score, average score and the standard deviation of the scores.

Note: the median is calculated differently if your data is odd or even. Ensure that your method can handle an even or odd number of data items.

Explanation / Answer

this code is for calculating median and standared deviation Private Sub cmdShow_Click()   Dim score(1 To 20) As Integer

Dim stanDeviation As Integer
Dim index As Integer
Call FillArray(score())
picExam.Cls
picExams.Print "There were 20 "exams"
picExams.Print "Mean:"; Sum(score()) / 20
picExams.Print "Std. Deviation: "; Round(Sqr(stDev), 5)

Private Function Sum(s() As Integer) As Integer
Dim total As Integer, index As Integer
'This will add the scores for the mean
total = 0
For index = 1 To 20
total = total + s(index)
Next index
Sum = total
End Function

Private Function Deviation(s() As Integer) As Integer
Dim index As Integer
Dim stDev As Integer
'Calculates the deviation
stDev = 0
For index = 1 To 20
stDev= stDev+ ((s(index) - 70.65) ^ 2 / 20)
Next index

End Function

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote