Any help will appreciated. I'm trying to analyze the number of a, b, c, d and e after applying the curve percentage selected by the user.

Here is what I have so far. I'm using for loop and its adding the curves to the grade distribution.

Public Class frmHW13

    'Variables
    Dim grade As Double
    Dim avail As Integer
    Dim curved As Integer

Private Sub bntApplyCurve_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bntApplyCurve.Click
        If (grade <= 49) Then
            txtGrdDist.Text = "E"
        ElseIf (grade <= 69) Then
            txtGrdDist.Text = "D"
        ElseIf (grade <= 79) Then
            txtGrdDist.Text = "C"
        ElseIf (grade <= 89) Then
            txtGrdDist.Text = "B"
        ElseIf (grade <= 100) Then
            txtGrdDist.Text = "A"
        End If
        For i As Integer = 0 To lstGradeList.Items.Count - 1
            If (CDbl(lstGradeList.Items(i)) = avail) Then
                grade = CDbl(lstGradeList.Items(i))
                lstGradeList.Items.Add(grade)
            End If
        Next
        ' display out put
        grade = lstGradeList.Items.Count()
        txtGrdDist.Text = CStr(grade + avail)

    End Sub
End Class

Edited 4 Years Ago by toldav: attachmetn I forgot

Attachments MATH.JPG 17.53 KB

And what is your question?

Hey Jim, my code doesnot calculate the listbox and display properly. That were i have problems with it. I'm trying to use for loops but I'm not very familiar with.
any input will apreaciated. see the attached image.

Tell me what mathematical formula you are trying to apply and I'll see what I can do. I'm going to assume that you are doing this for an assignment. As such I am going to give you the standard lecture. To wit:

When doing an application you should write the comments BEFORE you write the code. Presumably, by the time you get to the IDE you have some idea of what your interface will look like (type, number and placement of controls and events). Place your controls (appropriately named), then create event stubs. At that point write your comments for the app as a whole (what it does, etc) and a header for each Sub. Keep in mind that the following

Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click

    'Handles the Click event for the Save button

End Sub

is esentially useless.

This article has been dead for over six months. Start a new discussion instead.