.Net Battler Needing help Desperately lol!

Please support our VB.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Reply

Join Date: Mar 2008
Posts: 5
Reputation: ferrier18 is an unknown quantity at this point 
Solved Threads: 0
ferrier18 ferrier18 is offline Offline
Newbie Poster

.Net Battler Needing help Desperately lol!

 
0
  #1
Apr 8th, 2008
Hey guys, This is what im trying to achieve:
Add the code that
• Calculates the total amount (Price * Qty)
• Then apply the following discounts:
• Total is < 20 0% discount
• Total in the range 20-49.99 10% discount
• Total is >50 20% discount
• Subtract the discount from the total
• Finally, display the discounted total amount

And heres what i have so far: I can't go any further cos i'm stuck with absolutely no idea what to do! I would greatly appreciate any help that's given to me... Thanks guys

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim vPrice As Decimal
Dim vQty As Integer
Dim vTotal As Decimal

vPrice = Val(InputBox("Enter a price"))
vQty = Val(InputBox("Enter a qty"))
vTotal = Val(vPrice * vQty)

If vTotal < 20 Then
vTotal = vTotal
ElseIf vTotal >= 20 And vTotal < 49.99 Then
vTotal = Val(vTotal) * Val(1.1)
ElseIf vTotal > 50 Then
vTotal = Val(vTotal) * Val(1.2)
End If
MessageBox.Show("Toal is " & vTotal)
End Sub
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,640
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: .Net Battler Needing help Desperately lol!

 
0
  #2
Apr 8th, 2008
  1. Dim vPrice As Decimal
  2. Dim vQty As Integer
  3. Dim vTotal As Decimal
  4. Dim vDiscount As Decimal
  5. Dim vFinal As Decimal
  6.  
  7. vPrice = Val(InputBox("Enter a price"))
  8. vQty = Val(InputBox("Enter a qty"))
  9. vTotal = Val(vPrice * vQty)
  10.  
  11. If vTotal < 20 Then
  12. vDiscount = vTotal
  13. vFinal = vDiscount
  14. ElseIf vTotal >= 20 And vTotal < 49.99 Then
  15. vDiscount = Val(vTotal) * 0.1
  16. vFinal = (Val(vTotal) - Val(vDiscount))
  17. ElseIf vTotal > 50 Then
  18. vDiscount = Val(vTotal) * 0.2
  19. vFinal = (Val(vTotal) - Val(vDiscount))
  20. End If
  21. MessageBox.Show("Final Price is " & vFinal)
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 3
Reputation: unabomber1 is an unknown quantity at this point 
Solved Threads: 0
unabomber1 unabomber1 is offline Offline
Newbie Poster

Re: .Net Battler Needing help Desperately lol!

 
0
  #3
Apr 8th, 2008
End If
MessageBox.Show("Toal is " & vTotal)
End Sub
You havent even tried spell checking! Go read the books before you post your homework.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,640
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: .Net Battler Needing help Desperately lol!

 
0
  #4
Apr 8th, 2008
Originally Posted by unabomber1 View Post
You havent even tried spell checking! Go read the books before you post your homework.
don't added other problem. its just a little mistaken in spell.
ok. happy coding
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the VB.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC