Well you could do this many ways, but since you have not indicated that you are using a Database to store you information lets assume you don't and use an array.
You could use several one-dimensional arrays or one multidimensional array. Store the information, then based on the choise by the user it grabs that value from the array(s) and uses it in calculation.
Example: (pseudo-code)
....
Dim arSMALLCosts(3) as Float
Dim arMEDCosts(3) as Float
Dim arLARGECosts(3) as Float
Dim Cost as Float
Dim LogoFee as Float
Dim qty as Integer
Dim Total as Float
.... ' Fill your arrays with costs
....
' Use some sort of logic to determine if small, medium or large is selected
Dim nValue as Integer
nValue = ' Color of the size selected
....
Cost = arSMALLCosts(nValue) ' Assuming Size selected was small
if chkLogo = True Then
LogoFee = 3.00
else
LogoFee = 0
end if
Total = qty * Cost
lblTotal.Text = Total
...
Hope this helps
:cool:
I'm trying to learn asp.net in vb.net. I have a form to order hats online because I'm learning only one hat at a time may be ordered. I have two listboxes one displays the size and the other the color, I have a checkbox which if checked adds a logo, a button which the user clicks to submit an order, and a label which confirms the order By displaying the message " The cost of your hat is (the total). Here is the rate scale:
White Blue White & Blue Small $5.99 $6.99 $7.99 Medium $6.99 $7.99 $8.99 Large $7.99 $8.99 $9.99
Hats with a logo cost 3.00 regarless of size or color.
If someone could point me in the right direction I put this in the VB.net forum because (if I understand correctly) this calculation can be done vb.net, even though it's a web form. I'm not to good at expressing calculations. So this may take more than one post.
Thanks Augie0216
"Help you give now may be help you get in the future"