write a program in basic which takes marks of 5 subjects as input.
calculate the sum,percentage and assign grade on following criteria:
A=90+
B=80-90
C=70-90
D=60-70
F=below 60
condition: if student fails in more than one subject his/her admission will be cancelled

Recommended Answers

All 6 Replies

Select Case score
    Case 90 To 100
        letter = "A"
    Case 80 To 89
        letter = "B"
    Case 70 To 79
        letter = "C"
    Case 60 To 69
        letter = "D"
    Case Else
        letter = "F"
End Select

I have mADE THIS ONE JUST FOR YOU .JUST COPY PAST THIS .DONT FORGET TO VOTE.IF YOU Have any problem again you can reply back

Dim a As Integer
    Dim b As Integer
    Dim c As Integer
    Dim d As Integer
    Dim p As Integer
    Dim f As Integer
    Dim g As Double



    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        a = Val(T1.Text)
        b = Val(T2.Text)
        c = Val(T3.Text)
        d = Val(T4.Text)
        f = Val(T5.Text)
        p = (a + b + c + d + f)
        T6.Text = p
        g = Val((T6.Text) / 1000 * 100)

        Select Case g
            Case 90 To 100
                MsgBox("YOu have got grade ,A " & "your markes %age is " & g)
            Case 80 To 89
                MsgBox("YOu have got grade ,B" & "your markes %age is " & g)
            Case 70 To 89
                MsgBox("YOu have got grade ,c" & "your markes %age is " & g)
            Case 60 To 69
                MsgBox("YOu have got grade ,D" & "your markes %age is " & g)
            Case Else
                MsgBox("you have failed" & "your markes %age is " & g)
                End
        End Select


    End Sub
End Class

g = Val((T6.Text) / 1000 * 100)

You have only 5 TextBoxes.
The simple percentage equation is g=p/5.

I just tried to help him and the above method is working .This one i have made for him .it can be enhanced further in many ways.

we assume that marks are out of 1000

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.