0% found this document useful (0 votes)
44 views1 page

Exercise 11

This code calculates the total cost of a sandwich order based on size and selected toppings. It defines constants for small and large sandwich prices, initializes a total variable, then adds topping prices to the total depending on which checkboxes are checked. The final total is displayed in a label.

Uploaded by

api-307933689
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)
44 views1 page

Exercise 11

This code calculates the total cost of a sandwich order based on size and selected toppings. It defines constants for small and large sandwich prices, initializes a total variable, then adds topping prices to the total depending on which checkboxes are checked. The final total is displayed in a label.

Uploaded by

api-307933689
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
You are on page 1/ 1

Exercise 11

Public Class Form1


Private Sub btnOrder_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles btnOrder.Click
Const SMALL As Decimal = 2.5
Const LARGE As Decimal = 4
Dim total As Decimal = 0
If Me.radLarge.Checked Then
total = 4
Else
total = 2.5
End If
If Me.chkLettuce.Checked = True Then
total = total + 0.1
End If
If Me.chkTomato.Checked = True Then
total = total + 0.25
End If
If Me.chkOnion.Checked = True Then
total = total + 0.1
End If
If Me.chkCheese.Checked = True Then
total = total + 0.5
End If
Me.lblTotal.Text = total
End Sub
End Class

You might also like