I'm making an application to display the total price of a order. It decides the price based on the number of items ordered and if the customer is a wholesale or retailer.
Calculation it uses:
1-4 items = $10 per item if wholesaler.
5+ items = $9 each if wholesaler.
1-3 items = $15 per item if retailer.
4-8 item = $14 per item if retailer.
9+ item = $12 per item if retailer.
I'm stuck on the calculation and confused as to how I would do it.
The GUI is complete, here is what I have so far:
Picture of GUI: http://i.imgur.com/P2tDz.png
Dim quantity As Decimal
Dim price As Decimal
Dim wholesaler As Integer
Dim retailer As Integer
Integer.TryParse(txtUnits.Text, price)
chkRetailer.Text = retailer
chkWholesale.Text = wholesaler
If wholesaler Then
If Quantity <= 4 Then
Price = 10
Else
Price = 9
End If
ElseIf retailer Then
If Quantity <= 3 Then
Price = 15
ElseIf Quantity <= 8 Then
Price = 14
Else
Price = 12
End If
End If
lblTotPrice.Text = price * quantity
lblTotPrice.Text = price.ToString("C0")
It's the calculation I'm confused on, I have the display and the declarations correct I believe.
Thank you.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…