Need help with calculating the accumulated total
Hey everyone! Newbie here! :D
I've been stuck at a particular programming problem. I have to create an application for selling T-shirts. I have to display the items purchased and calculate the total. Supposed to be easy, right? Arghh!
So far I've got:
A ComboBox - this lists the shirts sizes (xsmall. small, medium, large, xlarge, xxlarge). (name: comboShirt)
Quantity Textbox - This is beside the ComboBox. This is where i enter the quantity of the shirts. (name: txtQuant)
OK Button - When the user clicks this button, the shirt item and quantity will appear in the listbox. The total amount will appear in the textbox below. (name: btnOK)
A ListBox - This is where the items selected by the user will appear. (name: lstOrder)
Amount TextBox - this is where the total amount will appear. (name: txtPay)
The prices of the shirt are: small, medium, large, xlarge = $16.00 each
and xsmall, xxlarge = $20.00 each
Here's a link to the screenshot: tinypic.com/r/w17dw4/7
Seems pretty basic. But I just cant come up with a code to calculate the total! Can anyone give me any idea as to how to go about that? Do i do a loop? Do an If else statement?
Also, does the total show up when i click the OK button? Or should i make another button, which the user will click after ordering to calculate the total? I'm totally lost.
This is the best idea i could come up with. But it doesn't really work. I'm not even sure how to add the $20 prices in this:
|All times are GMT +5.5. The time now is 18:26.|