Question
This project makes use of concepts and statements that we have covered recently. This program simulates a POS (Point of Sale) system for an Asian
This project makes use of concepts and statements that we have covered recently. This program simulates a POS (Point of Sale) system for an Asian Restaurant. The customer chooses their Entre (Main Dish) and optionally a Starter course and a beverage. The program will compute the order total. The program also keeps a running total of all orders which have been entered. Notice how the buttons and group boxes are enabled and disabled in order to control which features the user can use at any time. For example, until the user selects an Entre, the Starter and Beverage choices are disabled. The Clear Order button unchecks the radio buttons and check boxes, deselects the beverage and clears the Cost of Order (Subtotal, Tax, Total) but DOES NOT clear the Running Total. In order to manage adding the selected beverage price to the total it is useful to use the technique in which a second list box off-screen is used to hold the matching prices. The following is how the interface looks.
Below is the code i have so far, im not sure how to do the return statments for the code,and also how to compute the totals for the running total and subtotal. Also the variables im claiming as double may not be right?
Public Class Form1
End Class
'A class level variable since we need its value to stay valid
Dim dblsubTotal As Double
'A user defined function to calculate the starter cost
Function starters() As Double
Dim DblsubTotal As Double
If chkeggroll.Checked = True Then
DblsubTotal = DblsubTotal + 1.5
End If
'Enter the statements for the other items
If chkspringroll.Checked = True Then
DblsubTotal = DblsubTotal + 2.0
?
End If
If chksoup.Checked = True Then
DblsubTotal = DblsubTotal + 2.5
End If
If chkcrabdelite.Checked = True Then
DblsubTotal = DblsubTotal + 2.5
End If
lblsubtotal.text = dblsubtotal.tostring("c")
Return dblsubtotal
?
End Function
'A user defined function to calculate the main dish cost
Function MaindishTotal() As Double
Dim dblsubTotal As Double
If radsweetandsourchicken.Checked = True Then
dblsubTotal = dblsubTotal + 8.0
ElseIf radbeefandpeapods.Checked = True Then
dblsubTotal = dblsubTotal + 8.5
ElseIf radcashewchicken.Checked = True Then
dblsubTotal = dblsubTotal + 8.0
ElseIf radshrimpfriedrice.Checked = True Then
dblsubTotal = dblsubTotal + 7.5
ElseIf radeggfooyong.Checked = True Then
dblsubTotal = dblsubTotal + 7.0
End If
?
End Function
Private Sub btncalculatetotals_Click(sender As System.Object, e As System.EventArgs)
End Sub
Private Sub btnaddnew_Click(sender As System.Object, e As System.EventArgs)
End Sub
Private Sub btnCleartotals_Click(sender As System.Object, e As System.EventArgs) Handles btnCleartotals.Click
Clear display labels, check boxes and radio buttons
lblordertotal.Text = ""
lbltax.Text = ""
lblsubtotal.Text = ""
?
chkeggroll.Checked = False
chksoup.Checked = False
chkspringroll.Checked = False
chkcrabdelite.Checked = False
radsweetandsourchicken.Checked = False
radbeefandpeapods.Checked = False
radcashewchicken.Checked = False
radshrimpfriedrice.Checked = False
radeggfooyong.Checked = False
lstPrices.SelectedIndex = -1
End Sub
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
Me.Close()
End Sub
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started