RSS Forums RSS

.Net Battler Needing help Desperately lol!

Please support our VB.NET advertiser: DiscountASP.NET – 3 Months Free on VB.NET Web Hosting
Reply
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!

  #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
AddThis Social Bookmark Button
Reply With Quote  
Posts: 2,628
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: 244
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: .Net Battler Needing help Desperately lol!

  #2  
Apr 8th, 2008
Dim vPrice As Decimal
        Dim vQty As Integer
        Dim vTotal As Decimal
        Dim vDiscount As Decimal
        Dim vFinal As Decimal

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

        If vTotal < 20 Then
            vDiscount = vTotal
            vFinal = vDiscount
        ElseIf vTotal >= 20 And vTotal < 49.99 Then
            vDiscount = Val(vTotal) * 0.1
            vFinal = (Val(vTotal) - Val(vDiscount))
        ElseIf vTotal > 50 Then
            vDiscount = Val(vTotal) * 0.2
            vFinal = (Val(vTotal) - Val(vDiscount))
        End If
        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  
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!

  #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  
Posts: 2,628
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: 244
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: .Net Battler Needing help Desperately lol!

  #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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Other Threads in the VB.NET Forum
Views: 684 | Replies: 3 | Currently Viewing: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 1:43 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC