Results 1 to 2 of 2

Thread: VB.net 2003 - movie ticket program

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2004
    Posts
    2

    VB.net 2003 - movie ticket program

    OK can someone take a look at this code and tell me what you think? I have never done any programming before, save for some low level PHP...
    I am taking a VB.NET class, and this is the first project we've done
    I am just worried I am screwing stuff up hardcore, so maybe someone can take a look for me.


    VB Code:
    1. Private Sub ExitButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitButton.Click
    2.         Me.Close()
    3.     End Sub
    4.  
    5.     Private Sub ResetButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ResetButton.Click
    6.         Me.NameTextBox.Text = ""
    7.         Me.PhoneTextBox.Text = ""
    8.         Me.AdultTextBox.Text = ""
    9.         Me.StudentTextBox.Text = ""
    10.         Me.ChildTextBox.Text = ""
    11.         Me.TotalPriceLabel.Text = "$0.00"
    12.         Me.AdultTextBox.Focus()
    13.  
    14.     End Sub
    15.  
    16.     Private Sub CalcButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CalcButton.Click
    17.         'set local constant for 6% tax rate
    18.         Const conTaxRate As Single = 0.06
    19.         'define subtotal variable
    20.         Dim sngSubTotal As Single = (Val(Me.AdultTextBox.Text) * 6) _
    21.         + (Val(Me.StudentTextBox.Text) * 5.25) + _
    22.         (Val(Me.ChildTextBox.Text) * 3.75)
    23.         Dim sngTotalPrice As Single = sngSubTotal * (1 + conTaxRate)
    24.         Me.TotalPriceLabel.Text = sngTotalPrice
    25.         'format the Total Price Label as currency
    26.         Me.TotalPriceLabel.Text = Format(Me.TotalPriceLabel.Text, "currency")
    27.         'send focus to reset button
    28.         Me.ResetButton.Focus()
    29.  
    30.     End Sub

    any thoughts?

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    For general code reviews I recommend you use the VB.Net forum.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width