please help me ASAP ...l need a code yoour
Answer: See the code below:
1. VendingMachineForm.Designer.vb: System generated class. Don't modify
------------------------.
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
_
Partial Class VendingMachine
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form
Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.ProductLabel = New System.Windows.Forms.Label()
Me.ProductComboBox = New System.Windows.Forms.ComboBox()
Me.PurchaseProductButton = New System.Windows.Forms.Button()
Me.SuspendLayout()
'
'ProductLabel
'
Me.ProductLabel.AutoSize = True
Me.ProductLabel.Location = New System.Drawing.Point(33, 33)
Me.ProductLabel.Name = "ProductLabel"
Me.ProductLabel.Size = New System.Drawing.Size(77, 13)
Me.ProductLabel.TabIndex = 0
Me.ProductLabel.Text = "Select Product"
'
'ProductComboBox
'
Me.ProductComboBox.DropDownStyle =
System.Windows.Forms.ComboBoxStyle.DropDownList
Me.ProductComboBox.FormattingEnabled = True
Me.ProductComboBox.Items.AddRange(New Object() {"Simba cheese and
onion", "Simba Nik Naks", "Fritos corn chips", "Lays", "Doritos",
"Fet sum mor", "Diddle Daddle", "Oreo", "Snickers", "Bar One", "Kit
Kat", "Lunch Bar", "Coca-cola", "Bon Aqua", "Fanta Grape",
"Twist"})
Me.ProductComboBox.Location = New System.Drawing.Point(128,
34)
Me.ProductComboBox.Name = "ProductComboBox"
Me.ProductComboBox.Size = New System.Drawing.Size(121, 21)
Me.ProductComboBox.TabIndex = 1
'
'PurchaseProductButton
'
Me.PurchaseProductButton.Location = New System.Drawing.Point(130,
81)
Me.PurchaseProductButton.Name = "PurchaseProductButton"
Me.PurchaseProductButton.Size = New System.Drawing.Size(119,
23)
Me.PurchaseProductButton.TabIndex = 2
Me.PurchaseProductButton.Text = "Purchase a Product"
Me.PurchaseProductButton.UseVisualStyleBackColor = True
'
'VendingMachine
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!,
13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(354, 273)
Me.Controls.Add(Me.PurchaseProductButton)
Me.Controls.Add(Me.ProductComboBox)
Me.Controls.Add(Me.ProductLabel)
Me.Name = "VendingMachine"
Me.Text = "Vending Machine"
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents ProductLabel As Label
Friend WithEvents ProductComboBox As ComboBox
Friend WithEvents PurchaseProductButton As Button
End Class
---------------------------------------
2. VendingMachineForm.vb: User class. Write all your code in this class.
--------------------------------
Public Class VendingMachine
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles
PurchaseProductButton.Click
Dim ProductCodes = New Integer() {11, 12, 13, 14, 21, 22, 23, 24,
31, 32, 33, 34, 41, 42, 43, 44}
Dim ProductPrices = New Double() {10.0, 10.0, 10.0, 10.0, 10.0,
5.0, 5.0, 10.0, 10.0, 10.0, 10.0, 10.0, 15.0, 10.0, 15.0,
15.0}
Dim SelectedProductIndex As Integer
SelectedProductIndex = ProductComboBox.SelectedIndex
If Not (SelectedProductIndex > -1) Then
MsgBox("No Product selected. Please try again.")
Else
Dim SelectedProduct As String
SelectedProduct = ProductComboBox.SelectedItem
Dim MsgToShow = "Selected Product: " & SelectedProduct & ",
Price: R " & ProductPrices(SelectedProductIndex)
MsgBox(MsgToShow)
End If
End Sub
End Class
---------------------------------
Criven products in a vending machine (Tahle and their respective prices (Table 2), develop VBA en...
please guys l need a code ASAP which runs not tips
...l need to submit my assignment as soon as possible... please
help VBA simple code
Criven products in a vending machine (Tahle and their respective prices (Table 2), develop VBA ende that would undertake the tollowing tasks after the customer clicks the 'purchase a producibttn: u. Tutheじustomer: i. Reive the custum' selcted product codu ii. Cunlim and display the customer's selected pruduct und product price. iii. Roccive the customer's...
1. Create a new multi-class Java program which implements a vending machine simulator which contains the following functionality: A) At program startup, the vending machine is loaded with a variety of products in a variety of packaging for example soda/tonic/Coke in bottles, peanuts in bags, juice in cartons, etc. Also included is the cost of each item. The program should be designed to easily load a different set of products easily (for example, from a file). Also at program startup,...