Simple Restaurant Menu System

A simple restaurant menu to choose an order of Burger, Fries and Drinks, The will system will select an option for Burger, Fries or Drinks and get the total meal orders.

Output:



Source Code:

Public Class Form1
    Private Sub chkBurger_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkBurger.CheckedChanged
        If chkBurger.Checked = True Then
            radRegular.Checked = True
            GroupBox1.Visible = True
        Else
            GroupBox1.Visible = False
        End If
    End Sub
   
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        GroupBox1.Visible = False
        GroupBox2.Visible = False
        GroupBox3.Visible = False
    End Sub
    Private Sub chkFries_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkFries.CheckedChanged
        If chkFries.Checked = True Then
            radSmall.Checked = True
            GroupBox2.Visible = True
        Else
            GroupBox2.Visible = False
        End If
    End Sub
    Private Sub chkDrinks_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkDrinks.CheckedChanged
        If chkDrinks.Checked = True Then
            radSoda.Checked = True
            GroupBox3.Visible = True
        Else
            GroupBox3.Visible = False
        End If
    End Sub
    Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
        Dim cost As Double
        If chkBurger.Checked Then
            If radRegular.Checked Then
                cost = cost + 4.19
            ElseIf RadBacon.Checked Then
                cost = cost + 4.79
            ElseIf radCheeseBacon.Checked Then
                cost = cost + 5.39
            ElseIf radCheese.Checked Then
                cost = cost + 4.79
            End If
        End If
        If chkFries.Checked Then
            If radLarge.Checked Then
                cost = cost + 4.99
            ElseIf radSmall.Checked Then
                cost = cost + 2.39
            ElseIf radMedium.Checked Then
                cost = cost + 3.09
            End If
        End If
        If chkDrinks.Checked Then
            If radSoda.Checked Then
                cost = cost + 1.69
            ElseIf radWater.Checked Then
                cost = cost + 1.49
            End If
        End If
        txtCost.Text = cost.ToString("C")
    End Sub
    Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
        txtCost.Clear()
        chkBurger.Checked = False
        chkDrinks.Checked = False
        chkFries.Checked = False
        GroupBox1.Visible = False
        GroupBox2.Visible = False
        GroupBox3.Visible = False
    End Sub
End Class

DOWNLOAD LINK: RestaurantMenuVB2010.rar


Simple Restaurant Menu System Simple Restaurant Menu System Reviewed by code-dev on 4:16 PM Rating: 5

No comments:

Powered by Blogger.