'Program:
sheddCh08HandsOn
'Programmer:
Bradley Shedd
'Date:
August 22, 2006
'Description: Look up the price for bulk
coffee
'
based upon quantity and type.
'
uses a structure and arrays, and prints a report
'
of the transactions from the array.
'Folder:
sheddCh08HandsOn
Public Class
bulkCoffeeForm
' Declare structure and module-level variables
Structure
CoffeeSale
Dim typeString
As String
Dim quantityString
As String
Dim priceDecimal
As Decimal
End Structure
Private transactionCoffeeSale(20)
As CoffeeSale
Private numberTransactionsInteger
As Integer
Private priceDecimal(,)
As Decimal = _
{{2.6D, 2.9D, 3.25D}, {4.9D, 5.6D, 6.1D}, {8.75D, 9.75D, 11.25D}}
Private selectedButtonString
As String
Private Sub
clearButton_Click(ByVal sender
As System.Object, ByVal
e As System.EventArgs)
Handles clearButton.Click
' Remove the selection from the list and
' clear the price.
' Select first radio button.
quarterPoundRadioButton.Select()
' Clear coffee type selection.
coffeeTypeComboBox.SelectedIndex = -1
priceTextBox.Clear()
End Sub
Private Sub
exitButton_Click(ByVal sender
As System.Object, ByVal
e As System.EventArgs)
Handles exitButton.Click
' Terminate the project.
Dim responseDialogResult
As DialogResult
responseDialogResult = MessageBox.Show("Print
the report?", _
"Terminate the Application",
MessageBoxButtons.YesNo, _
MessageBoxIcon.Question)
If responseDialogResult =
DialogResult.Yes Then
printButton_Click(sender, e)
End If
Me.Close()
End Sub
Private Sub
GroupBox1_Enter(ByVal sender
As System.Object, ByVal
e As System.EventArgs)
Handles GroupBox1.Enter
End Sub
Private Sub
printButton_Click(ByVal sender
As System.Object, ByVal
e As System.EventArgs)
Handles printButton.Click
End Sub
End Class