Guidance...
-
Can someone please guide me through this?
In this program you will create a Windows Form application that will calculate and display the money made by a drive-in movie theater each night. The movie theater has two types of nights. A “Regular” night is where each person in a guest car has to buy a ticket, and each ticket costs $10. A “Car” night is a special promotion where there is one price per car of $15, no matter how many guests are in the car.
In addition to the cost of entry (either Regular or Car), the theater sells popcorn and candy but the price of the items depends on the type of night. On a Regular night popcorn costs $1.50 per box and on a special Car night popcorn costs $2.00 per box. On a Regular night candy cost $2.25 per candy box, while on a special Car night candy cost $3.00 per box.
On any night, the maximum number of cars allowed in is 500 and the maximum number of individual tickets is 3,000; the theater can produce 4,500 bags of popcorn each night and has 4,000 candy items.
Once the total sales are calculated, the program will display a summary message with the type of night, the total number of cars, the total ticket sales, the total popcorn sales, the total candy sales, and the total sales amount.
-
Can someone please guide me through this?
In this program you will create a Windows Form application that will calculate and display the money made by a drive-in movie theater each night. The movie theater has two types of nights. A “Regular” night is where each person in a guest car has to buy a ticket, and each ticket costs $10. A “Car” night is a special promotion where there is one price per car of $15, no matter how many guests are in the car.
In addition to the cost of entry (either Regular or Car), the theater sells popcorn and candy but the price of the items depends on the type of night. On a Regular night popcorn costs $1.50 per box and on a special Car night popcorn costs $2.00 per box. On a Regular night candy cost $2.25 per candy box, while on a special Car night candy cost $3.00 per box.
On any night, the maximum number of cars allowed in is 500 and the maximum number of individual tickets is 3,000; the theater can produce 4,500 bags of popcorn each night and has 4,000 candy items.
Once the total sales are calculated, the program will display a summary message with the type of night, the total number of cars, the total ticket sales, the total popcorn sales, the total candy sales, and the total sales amount.
This is what I have so far... Am I on the right track?
Public Class frmSalesData
Dim intCars, intTickets, intPopcorn, intCandy As IntegerPrivate Sub btnExit\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub btnClear\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click Me.txtNumCars.Clear() Me.txtNumTickets.Clear() Me.txtNumPopcorn.Clear() Me.txtNumCandy.Clear() Me.lblTotal.Text = Nothing Me.txtNumCars.Focus() End Sub Private Sub btnCalculate\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click Dim strMessage As String Dim dblNumCars, dblNumTickets, dblNumPopcorn, dblNumCandy As Double Dim dblTotalSales As Double If radRegular.Checked = True Then Me.lblTotal.Text = "Tonight was a REGULAR night." ElseIf radCar.Checked = True Then Me.lblTotal.Text = "Tonight was a CAR night." End If Double.TryParse(Me.txtNumCars.Text, dblNumCars) Double.TryParse(Me.txtNumTickets.Text, dblNumTickets) Double.TryParse(Me.txtNumPopcorn.Text, dblNumPopcorn) Double.TryParse(Me.txtNumCandy.Text, dblNumCandy) dblTotalSales = dblNumTickets + dblNumPopcorn + dblNumCandy strMessage = "The total number of cars present was: " & dblNumCars.ToString() & \_ "The total number of tickets sold was: " & dblNumTickets.ToString() & \_ "The total popcorn sales were: " & dblNumPopcorn.ToString("N2") & \_ "The total candy sales were: " & dblNumCandy.ToString("N2") Me.lblTotal.Text = strMessage End Sub
End Class
-
This is what I have so far... Am I on the right track?
Public Class frmSalesData
Dim intCars, intTickets, intPopcorn, intCandy As IntegerPrivate Sub btnExit\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub btnClear\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click Me.txtNumCars.Clear() Me.txtNumTickets.Clear() Me.txtNumPopcorn.Clear() Me.txtNumCandy.Clear() Me.lblTotal.Text = Nothing Me.txtNumCars.Focus() End Sub Private Sub btnCalculate\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click Dim strMessage As String Dim dblNumCars, dblNumTickets, dblNumPopcorn, dblNumCandy As Double Dim dblTotalSales As Double If radRegular.Checked = True Then Me.lblTotal.Text = "Tonight was a REGULAR night." ElseIf radCar.Checked = True Then Me.lblTotal.Text = "Tonight was a CAR night." End If Double.TryParse(Me.txtNumCars.Text, dblNumCars) Double.TryParse(Me.txtNumTickets.Text, dblNumTickets) Double.TryParse(Me.txtNumPopcorn.Text, dblNumPopcorn) Double.TryParse(Me.txtNumCandy.Text, dblNumCandy) dblTotalSales = dblNumTickets + dblNumPopcorn + dblNumCandy strMessage = "The total number of cars present was: " & dblNumCars.ToString() & \_ "The total number of tickets sold was: " & dblNumTickets.ToString() & \_ "The total popcorn sales were: " & dblNumPopcorn.ToString("N2") & \_ "The total candy sales were: " & dblNumCandy.ToString("N2") Me.lblTotal.Text = strMessage End Sub
End Class
-
This is what I have so far... Am I on the right track?
Public Class frmSalesData
Dim intCars, intTickets, intPopcorn, intCandy As IntegerPrivate Sub btnExit\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub btnClear\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click Me.txtNumCars.Clear() Me.txtNumTickets.Clear() Me.txtNumPopcorn.Clear() Me.txtNumCandy.Clear() Me.lblTotal.Text = Nothing Me.txtNumCars.Focus() End Sub Private Sub btnCalculate\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click Dim strMessage As String Dim dblNumCars, dblNumTickets, dblNumPopcorn, dblNumCandy As Double Dim dblTotalSales As Double If radRegular.Checked = True Then Me.lblTotal.Text = "Tonight was a REGULAR night." ElseIf radCar.Checked = True Then Me.lblTotal.Text = "Tonight was a CAR night." End If Double.TryParse(Me.txtNumCars.Text, dblNumCars) Double.TryParse(Me.txtNumTickets.Text, dblNumTickets) Double.TryParse(Me.txtNumPopcorn.Text, dblNumPopcorn) Double.TryParse(Me.txtNumCandy.Text, dblNumCandy) dblTotalSales = dblNumTickets + dblNumPopcorn + dblNumCandy strMessage = "The total number of cars present was: " & dblNumCars.ToString() & \_ "The total number of tickets sold was: " & dblNumTickets.ToString() & \_ "The total popcorn sales were: " & dblNumPopcorn.ToString("N2") & \_ "The total candy sales were: " & dblNumCandy.ToString("N2") Me.lblTotal.Text = strMessage End Sub
End Class
Good stuff. To add elegance use a
StringBuilder
for your message. Normally you would get ragged on for posting an assignment (and was roundly ignored), posting the solution got you the upvote ;)Never underestimate the power of human stupidity RAH