Page 1 of 1

1 Replies - 6146 Views - Last Post: 20 May 2010 - 02:47 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=173643&amp;s=649f46993d95c4485aa42cd198d24d09&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

#1 d3vil112

Reputation: -1
• Posts: 2
• Joined: 14-May 10

Posted 14 May 2010 - 09:23 PM

Create a text file, “Final.txt” that contains 25 student grades on a final exam:
78,85,50,93,88,97,55,72,81,90,80,46,77,86,66,72,65,83,90,77,81,78,50,53,87

Then write a program that reads the grades from the file and displays the number of scores in the

(1) “A” range (90-100)
(2) “B” range (80-89)
(3) “C” range (70-79)
(4) “D” range (60-69)
(5) “F” range (below 60)

Also list the highest score, lowest score, the average (mean) score and the percentage of the grades that fall above the average.
You must use a Do loop to read the file and count the number of grades.
You must use a case statement to count how many grades are in each range.
The number of grades should be stored as a variable and used in the calculation of the Average
High Score, Low score, Average and % above average must be figured out within the program.

Hints:
1) You can not figure out the average until after you have read in all of the test scores.
2) After figuring out the average you must read the file in another loop to figure out how many are above average
3) For low score & High score you must compare the current score to the hig/low score so far. In order for this to work, High score must start out being the lowest score possible (0) and the variable for low score must start out being the highest score possible (100).

Do not use more than 2 loops.

i did most of the part..but still stuck with the loop

``` Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnEnd.Click
MessageBox.Show("night")

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnClear.Click
txtA.Clear()
txtB.Clear()
txtC.Clear()
txtD.Clear()
txtF.Clear()
txtHs.Clear()
txtls.Clear()
txtAvearge.Clear()

End Sub

Private Sub BtnDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnDisplay.Click
Dim ACount As Integer
Dim bcount As Integer
Dim Ccount As Integer
Dim dcount As Integer
Dim fcount As Integer
Dim i As Integer
Dim y As Integer
Dim average As Double
Dim Number(Me.txtAvearge.Item.Count - 1) As Double
Dim newarray As String

For y = 0 To (Me.txtAvearge.item.count - 1)
Number(y) = CDbl(display.Items.Item(y))

Next y
Array.Sort(Number)
For y = 0 To y
newarray = newarray & Convert.ToString(Number(y) & "")

Next y

Dim sr As IO.StreamReader = IO.File.OpenText("C:\Users\Stephen Ficarola\Desktop\LabPrjct5\LabPrjct5\final.txt")

Do Until sr.Peek = -1

ACount = ACount + 1

bcount = bcount + 1
Ccount = Ccount + 1
dcount = dcount + 1
fcount = fcount + 1

End If

Loop
sr.Close()
For i As Integer = 0 To grade.GetUpperBound(0)
Next
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub
End Class
```

Attached File(s)

Is This A Good Question/Topic? -1

Replies To: final exam grade statistic

#2 motcom

• D.I.C Lover

Reputation: 292
• Posts: 1,371
• Joined: 16-June 08

Posted 20 May 2010 - 02:47 AM

Hi

can you explain why you want to do this?

``` For y = 0 To y

```