• Best of luck to the class of 2024 for their HSC exams. You got this!
    Let us know your thoughts on the HSC exams here
  • YOU can help the next generation of students in the community!
    Share your trial papers and notes on our Notes & Resources page
MedVision ad

Visual Basic - Vending Machine Project help (1 Viewer)

daina

New Member
Joined
Feb 14, 2007
Messages
22
Gender
Undisclosed
HSC
2009
Can anyone help me on this task on how to make a (soft drink) vending machine using visual basic (visual studio 2005).

Most infact everone in my class as finished the assignment except me and i need desperate help and fast.
 

Jamoz

New Member
Joined
May 9, 2008
Messages
16
Gender
Male
HSC
2008
lol what the heck are u tryin to do?
what help do you need? be more specific.. we can help but we're not gonna do it for you.
 

Sandchairs

Shoopin Da Woop
Joined
May 18, 2007
Messages
137
Location
Newcastle
Gender
Male
HSC
2008
as much as im pretty sure this would take me bout 2 hours for the core of the code with 4 hours to make it look good i really need to know what the question is before i go into some kind of programming spree
 

daina

New Member
Joined
Feb 14, 2007
Messages
22
Gender
Undisclosed
HSC
2009
Sandchairs said:
as much as im pretty sure this would take me bout 2 hours for the core of the code with 4 hours to make it look good i really need to know what the question is before i go into some kind of programming spree

Well we need to creeate a vending mahchine that when a button is pressed a drink appears for each drink pressed. We have to design what the vending machine looks like. We need the vending machine to be able to calculate the price and give the change.
 

daina

New Member
Joined
Feb 14, 2007
Messages
22
Gender
Undisclosed
HSC
2009
Sandchairs said:
as much as im pretty sure this would take me bout 2 hours for the core of the code with 4 hours to make it look good i really need to know what the question is before i go into some kind of programming spree

Well we need to creeate a vending mahchine that when a button is pressed a drink appears for each drink pressed. We have to design what the vending machine looks like. We need the vending machine to be able to calculate the price and give the change.
 

mrpet3rr

Member
Joined
Aug 22, 2007
Messages
88
Location
City
Gender
Male
HSC
2008
go planet source code or something. Understand the code by Step in Step out, change variable names, edit the code to ur needs and make it better and its all good!

www.planet-source-code.com
and just search vending machine im sure a few vending machine programs will be there

edit - Oh yes and another thing remember u can have the most SIMPLEST program ever. its all about the documentation . just make sure the program has an array of records (cant remember if you need anything else)
 

chook 05

Sum Fulla
Joined
Feb 7, 2007
Messages
40
Gender
Male
HSC
2008
heres something to get you started... sorry if youve already done this part of the code... but i ran out of time to do more :)

Code:
[COLOR=seagreen]'general decs[/COLOR]
[COLOR=royalblue]Option Explicit[/COLOR]
 
Dim Change, MoneyIn, Itemprice[COLOR=royalblue] As Double[/COLOR]
Dim Selected [COLOR=royalblue]As Integer[/COLOR]
Dim Item(7, 1), ItemName [COLOR=royalblue]As String[/COLOR]
 
 
[COLOR=royalblue]Private Sub[/COLOR] Calculate_Click() [COLOR=seagreen]'command button[/COLOR]
[COLOR=seagreen]'if the user enters their amount via a text box[/COLOR]
[COLOR=seagreen]'then the algorithm will be:[/COLOR]
MoneyIn = Money.Text 'name of textbox
Itemprice = Item(Selected, 1)
Change = MoneyIn - Itemprice
lblChange.Caption = Format(Change, "$##.00")
Call Vend(ItemName) [COLOR=seagreen]'this is the sub where u graphically vend it[/COLOR]
[COLOR=royalblue]End Sub[/COLOR]
 
 
[COLOR=royalblue]Private Sub[/COLOR] Form_Load()
[COLOR=seagreen]'below is an example of an item within your machine[/COLOR]
[COLOR=seagreen]'coke is placed in the first position, ie: the top[/COLOR]
[COLOR=seagreen]'left spot. The images themselves should be placed[/COLOR]
[COLOR=seagreen]'in a control array.[/COLOR]
[COLOR=seagreen]'  __________[/COLOR]
[COLOR=seagreen]' /          \[/COLOR]
[COLOR=seagreen]' | 0  1  2  |[/COLOR]
[COLOR=seagreen]' |          |[/COLOR]
[COLOR=seagreen]' | 3  4  5  |[/COLOR]
[COLOR=seagreen]' |          |[/COLOR]
[COLOR=seagreen]' | 6  7  8  |[/COLOR]
[COLOR=seagreen]' |          |[/COLOR]
[COLOR=seagreen]' ------------[/COLOR]
Item(0, 0) = "Coke" 'item name
Item(0, 1) = 3.5 'item price
[COLOR=seagreen]'positions 1 to 8 (or further) are filled with other items[/COLOR]
[COLOR=royalblue]End Sub[/COLOR]
 
 
[COLOR=royalblue]Private Sub[/COLOR] picItem_Click(Index [COLOR=royalblue]As Integer[/COLOR])
Selected = Index
[COLOR=royalblue]End Sub[/COLOR]
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top