Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Private Sub btnCalculate_Click(sender As Object, e As EventArgs) Handles btnCalculate.Click
- Dim monthlyFee As Double
- If txtMonths.Text > 1 And txtMonths.Text < 24 Then
- If radAdult.Checked = True Then
- monthlyFee = 40
- ElseIf radChild.Checked = True Then
- monthlyFee = 20
- ElseIf radSenior.Checked = True Then
- monthlyFee = 30
- ElseIf radStudent.Checked = True Then
- monthlyFee = 25
- End If
- If chkYoga.Checked = True Then
- monthlyFee = monthlyFee + 10
- End If
- If chkKarate.Checked = True Then
- monthlyFee = monthlyFee + 30
- End If
- If chkTrainer.Checked = True Then
- monthlyFee = monthlyFee + 50
- End If
- Dim numofMonths As Integer
- numofMonths = txtMonths.Text
- txtMonthlyFee.Text = (monthlyFee.ToString("c"))
- txtTotalFee.Text = (monthlyFee.ToString("c") * numofMonths.ToString("c")).ToString("c")
- Else
- MessageBox.Show("Enter a valid amount of Months (1-24).")
- End If
- End Sub
- Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click
- Close()
- End Sub
- Private Sub btnClear_Click(sender As Object, e As EventArgs) Handles btnClear.Click
- radAdult.Checked = False
- radChild.Checked = False
- radSenior.Checked = False
- radStudent.Checked = False
- txtMonthlyFee.Clear()
- txtMonths.Clear()
- txtTotalFee.Clear()
- chkKarate.Checked = False
- chkTrainer.Checked = False
- chkYoga.Checked = False
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement