|
-
Aug 31st, 2012, 02:59 PM
#1
Thread Starter
New Member
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!!!
-
Sep 1st, 2012, 10:41 AM
#2
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 ...
-
Sep 1st, 2012, 02:56 PM
#3
Thread Starter
New Member
Re: Help !! Programming assignment
Thanks ... I will!!
-
Sep 1st, 2012, 03:10 PM
#4
Member
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.
-
Sep 1st, 2012, 03:11 PM
#5
Member
Re: Help !! Programming assignment
I have the same issue and posted in that forum. Unfortunatly no one has responded. Any suggestions.
-
Sep 1st, 2012, 03:11 PM
#6
Thread Starter
New Member
Re: Help !! Programming assignment
absolutely. Let's try and see what we come up with. what do you have so far?
-
Sep 1st, 2012, 03:14 PM
#7
Member
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...
-
Sep 1st, 2012, 03:20 PM
#8
Thread Starter
New Member
Re: Help !! Programming assignment
not sure how to reply. send me your MSN. Do you have hotmail?
-
Sep 1st, 2012, 03:30 PM
#9
Member
Re: Help !! Programming assignment
I dont I just have FB chat....
-
Sep 1st, 2012, 03:31 PM
#10
Thread Starter
New Member
Re: Help !! Programming assignment
do I search for you as Amanda Harrell??
-
Sep 1st, 2012, 03:33 PM
#11
Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|