You are on page 1of 1

'Project Name: 'Purpose: ' 'Made by:

Computer Bug Calculates total price (less discount, if applicable) based on the selected course and number registered and displays total price and a random billing number. Christopher Mann on 10-30-2013

Option Explicit On Option Strict On Option Infer Off Public Class mainForm Private Sub calculateButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles calculateButton.Click Dim registered, total, number As Single Dim randomGenerator As New Random Const basic As Single = 70 Const windows As Single = 75 Const word As Single = 85 Const excel As Single = 90 registered = CSng(registeredTextBox.Text) Select Case True Case basicRadioButton.Checked total = basic * registered Case windowsRadioButton.Checked total = windows * registered Case wordRadioButton.Checked total = word * registered Case excelRadioButton.Checked total = excel * registered End Select If registered >= 15 Then total = CSng(total - (total * 0.2)) End If totalLabel.Text = total.ToString("c2") number = randomGenerator.Next(1001, 2002) billingLabel.Text = CStr(number) End Sub Private Sub exitButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles exitButton.Click Close() End Sub End Class

You might also like