Question

In: Accounting

Book - Introduction to Programming Using Visual Basic 11th Edition by David I. Schneider Programming Language...

Book - Introduction to Programming Using Visual Basic 11th Edition by David I. Schneider

Programming Language - Visual Studio 2017

RESTAURANT MENU Write a program to place an order from the restaurant menu in Table 4.13. Use the form in Fig. 4.70, and write the program so that each group box is invisible and becomes visible only when its corresponding check box is checked. After the button is clicked, the cost of the meal should be calculated. (NOTE: The Checked property of the first radio button in each group box should be set to True in its Properties window. This guarantees that a selection is made in each visible group box. Of course, when the cost of the meal is calculated, only the visible group boxes should be considered.)

See Fig. 4.71.

Table 4.13 Menu of Oceanside Burgers & Fries.

Burgers

Fries

Drinks

Regular (4.19)

Small (2.39)

Soda (1.69)

w/ cheese (4.79)

Medium (3.09)

Bottled water (1.49)

w/ bacon (4.79)

Large (4.99)

w/ bacon and cheese (5.39)

Figure 4.70 Form for Programming Project 5.

Solutions

Expert Solution

Write the Code:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

' Project: Restaurant Menu

' Description: Simulates a burger shop from user input.

'    User decides from a menu of burgers, fries and a drink

'    Total cost is calculated and output to the screen with proper formatting

Public Class frmMenu

    ' declare global variables

    Dim totalCost As Double = 0

    Dim burgerCost As Double = 0

    Dim friesCost As Double = 0

    Dim drinkCost As Double = 0

    ' Make menu items visible when boxes are checked

    Private Sub chkBurgers_CheckedChanged(sender As Object, e As EventArgs) Handles chkBurgers.CheckedChanged

        If chkBurgers.Checked = True Then

            grpBurgers.Visible = True

        Else

            grpBurgers.Visible = False

        End If

    End Sub

    Private Sub chkFries_CheckedChanged(sender As Object, e As EventArgs) Handles chkFries.CheckedChanged

        If chkFries.Checked = True Then

            grpFries.Visible = True

        Else

            grpFries.Visible = False

        End If

    End Sub

    Private Sub chkDrinks_CheckedChanged(sender As Object, e As EventArgs) Handles chkDrinks.CheckedChanged

        If chkDrinks.Checked = True Then

            grpDrinks.Visible = True

        Else

            grpDrinks.Visible = False

        End If

    End Sub

    ' Calculate total cost of order

    Private Sub btnCompute_Click(sender As Object, e As EventArgs) Handles btnCompute.Click

        totalCost = 0

        If chkBurgers.Checked = True Then

            If radRegular.Checked = True Then

                burgerCost = 4.19

            ElseIf (radCheese.Checked = True) Or (radBacon.Checked = True) Then

                burgerCost = 4.79

            ElseIf (radBoth.Checked = True) Then

                burgerCost = 5.39

            End If

            totalCost += burgerCost

        End If

        If chkFries.Checked = True Then

            If radSmall.Checked = True Then

                friesCost = 2.39

            ElseIf (radMedium.Checked = True) Then

                friesCost = 3.09

            ElseIf (radLarge.Checked = True) Then

                friesCost = 4.99

            End If

            totalCost += friesCost

        End If

        If chkDrinks.Checked = True Then

            If radSoda.Checked = True Then

                drinkCost = 1.69

            ElseIf radWater.Checked = True Then

                drinkCost = 1.49

            End If

            totalCost += drinkCost

        End If

        ' output cost of order

        txtCompute.Text = CStr(totalCost.ToString("C"))

    End Sub

End Class


Related Solutions

I am trying to write code for a program in Visual Studo using Visual Basic programming...
I am trying to write code for a program in Visual Studo using Visual Basic programming language that computes the factorial of an entered number by using a For Loop. My problem is that it keeps re-setting the variable for Factorial. Below is my code if anyone can help. I want it to multiply the given number by that number - 1, then continuing to do so until it hits zero without multiplying by zero. Private Sub BtnCalculate_Click(sender As Object,...
Text Book: Introduction to Probability Models 11th edition, Sheldon M. Ross: Chapter 5, Question 42(b) Can...
Text Book: Introduction to Probability Models 11th edition, Sheldon M. Ross: Chapter 5, Question 42(b) Can you please explain how the expression in b was derived and which theorem (or provide page # of the theorem) the question is referring to? I see the solution but I don't understand it. (like why T1+T2<=1) Thank you!
windows forms Application using Visual Basic use visual basic 2012 Part 1: Programming – Income Tax...
windows forms Application using Visual Basic use visual basic 2012 Part 1: Programming – Income Tax Application 1.1 Problem Statement Due to upcoming end of financial year, you are being called in to write a program which will read in a file and produce reports as outlined. Inputs: The input file called IncomeRecord.txt contains a list of Annual income records of employees in a firm. Each record is on a single line and the fields are separated by spaces. The...
Write a Windows Form application named SumFiveInts. Microsoft Visual C#: An Introduction to Object-Oriented Programming,7th Edition....
Write a Windows Form application named SumFiveInts. Microsoft Visual C#: An Introduction to Object-Oriented Programming,7th Edition. Ch. 5, page 220. Take snip of program results.
In An Introduciton to Programmig Using Visual Basic tenth edition chapter 6 the 4th project program...
In An Introduciton to Programmig Using Visual Basic tenth edition chapter 6 the 4th project program has me using loops. I am having a hard time trying to figure out what the double declining balance methods depreciation value is. It is 2 divided by the items life, but multiplied by the previous years balance. I do not know how to find the previous years balance to use in the depreciation value. Thank you
C# Programming language!!! Using visual studios if possible!! PrimeHealth Suite You will create an application that...
C# Programming language!!! Using visual studios if possible!! PrimeHealth Suite You will create an application that serves as a healthcare billing management system. This application is a multiform project (Chapter 9) with three buttons. The "All Accounts" button allows the user to see all the account information for each patient which is stored in an array of class type objects (Chapter 9, section 9.4).The "Charge Service" button calls the Debit method which charges the selected service to the patient's account...
a summary explaining the basic understanding of the following programming concepts using a language of python:...
a summary explaining the basic understanding of the following programming concepts using a language of python: •Variables •Arithmetic and Logical operations •Sequential coding (Structured programming •Decision structure (If statements) •Repetition structure •Functions with some coding demos inside visual studio code python IDE which can be sent as screenshot. preferably a typed summary please which can be written into powerpoint pleaseeeee ???
USING VISUAL STUDIO 2017, LANGUAGE VISUAL C# I have struggled on this program for quite some...
USING VISUAL STUDIO 2017, LANGUAGE VISUAL C# I have struggled on this program for quite some time and still can't quite figure it out. I'm creating an app that has 2 textboxes, 1 for inputting customer name, and the second for entering the number of tickets the customer wants to purchase. There are 3 listboxes, the first with the days of the week, the second with 4 different theaters, and the third listbox is to display the customer name, number...
Language: c++ using visual basic Write a program to open a text file that you created,...
Language: c++ using visual basic Write a program to open a text file that you created, read the file into arrays, sort the data by price (low to high), by box number (low to high), search for a price of a specific box number and create a reorder report. The reorder report should alert purchasing to order boxes whose inventory falls below 100. Sort the reorder report from high to low. Inventory data to input. Box number Number boxes in...
Language: c++ using visual basic Write a program to open a text file that you created,...
Language: c++ using visual basic Write a program to open a text file that you created, read the file into arrays, sort the data by price (low to high), by box number (low to high), search for a price of a specific box number and create a reorder report. The reorder report should alert purchasing to order boxes whose inventory falls below 100. Sort the reorder report from high to low. Inventory data to input. Box number Number boxes in...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT