Results 1 to 11 of 11

Thread: Help !! Programming assignment

  1. #1
    New Member
    Join Date
    Aug 12
    Posts
    6

    Help !! Programming assignment

    8. If the user leaves the Customer, Hours, or Parts textboxes blank, produce an error message (using a MessageBox) that informs the user to enter the appropriate information and do not display the information in the listbox.
    9. Create variables to hold the customer, phone, hours, and parts information. Name the variables customer, phone, hours, and parts. Their data types should be string, string, double, and double, respectively.
    10. When the user clicks the Display Bill button, prompt the user to enter in the date of the services. Store this information in a variable called service_date. Display this date and the date the invoice is due (30 days from the date entered) in the listbox as shown below. [Hint: use the AddDays function]. Store the due date in a variable called due_date.
    11. Convert the customer name variable to upper case before displaying it in the listbox.
    12. Whenever the user clicks the Display Bill button, the listbox should be cleared before displaying the new results.
    13. To calculate the amounts, create three variables (labor_cost, parts_cost, and total_cost), and display these amounts in the listbox as shown below.
    14. Be sure to use currency format where appropriate.
    15. Be sure that the columns line up appropriately. [Hint: you can use the built-in Visual Basic constant “vbTab” to create neat columns in your listbox.]

    THE FOLLOWING IS WHAT I DID BUT I AM GETTING AN ERROR

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplayBill.Click
    Dim Customer As String
    Dim Phone As String
    Dim Hours As Double
    Dim Parts As Double

    If txtCustomer.Text.Length = 0 AndAlso
    txtHours.Text.Length < 0 AndAlso txtParts.Text.Length = 0 Then
    'display an instructive MessageBox
    MessageBox.Show("Please enter the appropriate information in the empty boxes! Please" & vbCrLf & "complete the empty boxes.", "Illegal operation", _
    MessageBoxButtons.OK, _
    MessageBoxIcon.Exclamation)
    Else

    ' Do Calculations
    Customer = CStr(txtCustomer.Text)
    Phone = CStr(mtbPhone.Text)
    Hours = CDbl(txtHours.Text)
    Parts = CDbl(txtParts.Text)
    lstBill.Items.Clear()
    lstBill.Items.Add("Customer:" & Customer)
    lstBill.Items.Add("Phone:" & Phone)
    lstBill.Items.Add("Hours Cost:" & Hours * 35)
    lstBill.Items.Add("Parts Cost:" & Parts * 0.05)
    lstBill.Items.Add("Total Cost:" & Hours * 35 + Parts * 0.05)

    End If

    End Sub
    End Class

    PLEASEEEEEEE HELP!!!

  2. #2
    Frenzied Member
    Join Date
    May 06
    Location
    some place in the cloud
    Posts
    1,624

    Re: Help !! Programming assignment

    It would be better if you post in the Visul Basic .NET forum
    JG


    ... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...

  3. #3
    New Member
    Join Date
    Aug 12
    Posts
    6

    Re: Help !! Programming assignment

    Thanks ... I will!!

  4. #4
    Member
    Join Date
    Sep 12
    Posts
    35

    Re: Help !! Programming assignment

    Jenny, I am working on the same assignment and cannot get any help. I attempted to post the same question in the forum mentioned above but have not received any responses....I was okay up until number 8 as well. If you would like to work together please get back with me.

  5. #5
    Member
    Join Date
    Sep 12
    Posts
    35

    Re: Help !! Programming assignment

    I have the same issue and posted in that forum. Unfortunatly no one has responded. Any suggestions.

  6. #6
    New Member
    Join Date
    Aug 12
    Posts
    6

    Re: Help !! Programming assignment

    absolutely. Let's try and see what we come up with. what do you have so far?

  7. #7
    Member
    Join Date
    Sep 12
    Posts
    35

    Re: Help !! Programming assignment

    do you have fb or some form of IM? It might be quicker going back and forth with each other... I messaged you on your profile so I am hoping that form of communication is private so I can give you my info...

  8. #8
    New Member
    Join Date
    Aug 12
    Posts
    6

    Re: Help !! Programming assignment

    not sure how to reply. send me your MSN. Do you have hotmail?

  9. #9
    Member
    Join Date
    Sep 12
    Posts
    35

    Re: Help !! Programming assignment

    I dont I just have FB chat....

  10. #10
    New Member
    Join Date
    Aug 12
    Posts
    6

    Re: Help !! Programming assignment

    do I search for you as Amanda Harrell??

  11. #11
    Member
    Join Date
    Sep 12
    Posts
    35

    Re: Help !! Programming assignment

    you got it

Posting Permissions

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