
Visual basic Help PLEASE!!?
I have an assignment due and I cannot figure out how to code this for the life of me.
This is the information;
Table
Pieces of Equipment Half Day Full day
1. Rug Cleaner $16.00 $24.00
2. Lawn Mower $12.00 $18.00
3. Paint Sprayer $20.00 $30.00
I have to write a program that displays the information from the table in the list box when an appropriate button is clicked and displays a bill in another list box based on the item number and time period chosen by a customer. The bill should include a $30.00 deposit.
One way to approach it is by using Types or classes and Arrays.
For Example you could have a type in a module:
Type Equipments
EquipmentName as String
HalfDayPrice as Single
FullDayPrice as Single
End Type
Then put it as array:
public equip() as Equipments
public gIntTotal as integer
Public gInCurrent as Integer
Now you simply recreate the array as a new one is posted. And add each one to it's respective array. When you add it to list box one shuffle through the array gathering the name of the equipment.
you could also use collectioins instead of arrays keeping a collection there, and refer to it by key so that you'd be able to refer to it accurately.
set Equips = colEquips("List" & lstEquipments.ListIndex)
lstHalfDay.addItem(equips.HalfDayPrice)
lstFullDay.addItem(equips.FullDayPrice)
Either way would help out in your problem.
