'Project:
RMO case project
'Purpose:
illustrates use of all units of programming logic studied this semester
'Created by:
Cheril Grimmett on 4/24/15
'Modified by:
Matt Creech 4/28/15
'coding calcbutton
Option Explicit On
Option Strict On
Option Infer Of
Public Class mainForm
Private Sub exitButton_Click(sender As Object, e As EventArgs) Handles [Link]
Close()
End Sub
Private Sub resetButton_Click(sender As Object, e As EventArgs) Handles [Link]
[Link]()
[Link]()
[Link]()
[Link]()
[Link]()
[Link]()
[Link]()
End Sub
Private Sub mainForm_Load(sender As Object, e As EventArgs) Handles [Link]
End Sub
Private Sub calcButton_Click(sender As Object, e As EventArgs) Handles [Link]
'dim variables
Dim quantity As Integer
Dim price As Single
Dim vendorCode As String
Dim discount As Single
Dim subtotal As Single
'Error Check
While Not IsNumeric([Link])
[Link] = InputBox("Please enter a valid number for quantity", "ERROR")
End While
While Not IsNumeric([Link])
[Link] = InputBox("Please enter a valid number for price", "ERROR")
End While
quantity = CInt([Link])
price = CSng([Link])
vendorCode = [Link]
subtotal = (quantity * price)
'select case for determining the discount
Select Case vendorCode
Case Is = "S"
discount = (subtotal
Case Is = "H"
discount = (subtotal
Case Is = "F"
discount = (subtotal
Case Is = "C"
discount = (subtotal
Case Is = "T"
discount = (subtotal
Case Is = "W"
discount = (subtotal
Case Else
subtotal += 12
* 0.2D)
* 0.35D)
* 0.25D)
* 0.2D)
* 0.45D)
* 0.22D)
End Select
[Link] = [Link]("c2")
[Link] = [Link]("c2")
[Link] = (subtotal - discount).ToString("C2")
End Sub
End Class