0% found this document useful (0 votes)
5 views5 pages

Grade Calculator and Ice Cream Selector

The document contains three coding examples in Visual Basic. The first example grades a student's mark input, the second identifies an ice cream flavor based on user selection, and the third calculates and displays costs related to a customer bill. Each example is structured with a button click event to execute the corresponding logic.

Uploaded by

nigelnyats
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views5 pages

Grade Calculator and Ice Cream Selector

The document contains three coding examples in Visual Basic. The first example grades a student's mark input, the second identifies an ice cream flavor based on user selection, and the third calculates and displays costs related to a customer bill. Each example is structured with a button click event to execute the corresponding logic.

Uploaded by

nigelnyats
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

TAPIWANASHE

1. MARK GRADE

CODING
Public Class Form1

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles


[Link]
Dim MARK As Integer
MARK = [Link]
If MARK >= 70 And MARK <= 100 Then
[Link]("A")
ElseIf MARK >= 60 And MARK <= 69 Then
[Link]("B")
ElseIf MARK >= 50 And MARK <= 59 Then
[Link]("C")
ElseIf MARK >= 40 And MARK <= 49 Then
[Link]("D")
ElseIf MARK >= 30 And MARK <= 39 Then
[Link]("E")
ElseIf MARK >= 0 And MARK <= 29 Then
[Link]("U")
ElseIf MARK > 100 Then
[Link](" PLEASE ENTER NUMBER WITHIN THE RANGE !")
End If
End Sub
End Class

NYATSANZA
TAPIWANASHE

2. ICE CREAM

NYATSANZA
TAPIWANASHE

CODING
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles [Link]
If [Link] Then
[Link]("THE FLAVOUR IS CHOCOLATE")

ElseIf [Link] Then


[Link]("THE FLAVOUR IS VANILLAR")

ElseIf [Link] Then


[Link]("THE FLAVOUR IS STRAWBERRY")
Else
[Link](" PLEASE SELECT THE FLAVOUR !")
End If
End Sub
End Class
3. BILL

NYATSANZA
TAPIWANASHE

CODING
Public Class Form1

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles


[Link]
Dim LH, TL, SL, LC As Double
Dim NAME As String
NAME = [Link]
LH = [Link]
SL = [Link]

LC = LH * 20
SL = (15 / 100 * SL) + LC
TL = LC + SL

[Link]("CUSTOMER NAME" & vbTab & "LABOUR COST" & vbTab &
"SUPPLIER COST" & vbTab & "TOTAL COST")

NYATSANZA
TAPIWANASHE

[Link](NAME & vbTab & " " & vbTab & LC & vbTab & " " & SL &
vbTab & " " & TL)
End Sub

End Class

NYATSANZA

You might also like