Write a program to display how much the Mega Burgers cost in Visual Basic.
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Declare variables
Dim MB, Cost, TotalPrice As Integer
'Set values
MB = 7
Cost = 4
TotalPrice = MB * Cost
'Display results
MessageBox.Show("The Mega Burgers cost " & FormatCurrency(TotalPrice))
End Sub
End Class
No comments:
Post a Comment