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

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...
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!
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.
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 ???
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...
In David Crystal's book "Language and the Internet" in chapter 4 (The language of e-mail) what...
In David Crystal's book "Language and the Internet" in chapter 4 (The language of e-mail) what is the main idea in this chapter?
JAVA CODE --- from the book, java programming (7th edition) chapter 7 carly's question I am...
JAVA CODE --- from the book, java programming (7th edition) chapter 7 carly's question I am getting a illegal expression error and don't know how to fix it, also may be a few other error please help CODE BELOW import java.util.Scanner; public class Event { public static double pricePerGuestHigh = 35.00; public static double pricePerGuestLow = 32.00; public static final int LARGE_EVENT_MAX = 50; public String phnum=""; public String eventNumber=""; private int guests; private double pricePerEvent; public void setPhoneNumber() {...
Use Visual Basic Language In this assignment you will need to create a program that will...
Use Visual Basic Language In this assignment you will need to create a program that will have both a “for statement” and an “if statement”. Your program will read 2 numbers from the input screen and it will determine which is the larger of the 2 numbers. It will do this 10 times. It will also keep track of both the largest and smallest numbers throughout the entire 10 times through the loop. An example of the program would be...
Hi, I found this in the book balanced introduction to computer science,Javascript language, ⌈Log2(N)⌉ determine the...
Hi, I found this in the book balanced introduction to computer science,Javascript language, ⌈Log2(N)⌉ determine the number of checks it takes for binary search to find an item. I also saw this ⌈Log2(N)⌉+1 to find the number of checks, what is the difference between these 2, which one should I use?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT