Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Guidance...

Guidance...

Scheduled Pinned Locked Moved Visual Basic
salestutorialquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 10694570
    wrote on last edited by
    #1

    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.

    U 1 Reply Last reply
    0
    • U User 10694570

      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.

      U Offline
      U Offline
      User 10694570
      wrote on last edited by
      #2

      This is what I have so far... Am I on the right track?

      Public Class frmSalesData
      Dim intCars, intTickets, intPopcorn, intCandy As Integer

      Private 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

      L M 2 Replies Last reply
      0
      • U User 10694570

        This is what I have so far... Am I on the right track?

        Public Class frmSalesData
        Dim intCars, intTickets, intPopcorn, intCandy As Integer

        Private 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

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Looks reasonable to me, and you didn't receive any harsh comments yet. If it does what the assignment states (and compiles), then it's a go :thumbsup:

        Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

        1 Reply Last reply
        0
        • U User 10694570

          This is what I have so far... Am I on the right track?

          Public Class frmSalesData
          Dim intCars, intTickets, intPopcorn, intCandy As Integer

          Private 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

          M Offline
          M Offline
          Mycroft Holmes
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups