0% found this document useful (0 votes)
23 views2 pages

Tuition Fee Code

The document contains code for a tuition fee calculator application. It uses if/else statements to determine the price based on year level and course selected from dropdowns. It then calculates lab units, tuition units, and total fee and displays the results.

Uploaded by

Mike Seo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views2 pages

Tuition Fee Code

The document contains code for a tuition fee calculator application. It uses if/else statements to determine the price based on year level and course selected from dropdowns. It then calculates lab units, tuition units, and total fee and displays the results.

Uploaded by

Mike Seo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Public Class Form11

Private Sub btnCalcu_Click(sender As Object, e As EventArgs) Handles


btnCalcu.Click
Dim Price, Quan1, Quan2, QuanTU, QuanLU, TU, LU, MF, TotalFee As Single

If lstYL.SelectedIndex = 0 And cboCourse.SelectedIndex = 0 Or


cboCourse.SelectedIndex = 1 Then
Price = 1000
ElseIf lstYL.SelectedIndex = 0 And cboCourse.SelectedIndex = 2 Or
cboCourse.SelectedIndex = 3 Then
Price = 2000
ElseIf lstYL.SelectedIndex = 1 And cboCourse.SelectedIndex = 0 Or
cboCourse.SelectedIndex = 1 Then
Price = 750
ElseIf lstYL.SelectedIndex = 1 And cboCourse.SelectedIndex = 2 Or
cboCourse.SelectedIndex = 3 Then
Price = 1500
ElseIf lstYL.SelectedIndex = 2 And cboCourse.SelectedIndex = 0 Or
cboCourse.SelectedIndex = 1 Then
Price = 500
ElseIf lstYL.SelectedIndex = 2 And cboCourse.SelectedIndex = 2 Or
cboCourse.SelectedIndex = 3 Then
Price = 1000
ElseIf lstYL.SelectedIndex = 3 And cboCourse.SelectedIndex = 0 Or
cboCourse.SelectedIndex = 1 Then
Price = 250
ElseIf lstYL.SelectedIndex = 3 And cboCourse.SelectedIndex = 2 Or
cboCourse.SelectedIndex = 3 Then
Price = 500
ElseIf cboCourse.SelectedIndex < 0 Then
MessageBox.Show("No Course Selected", "Tuition Fee")
Exit Sub
Else
MessageBox.Show("No Year Level Selected", "Tuition Fee")
Exit Sub
End If
Quan1 = 100
Quan2 = 1000
QuanTU = nudTU.Text
QuanLU = nudLU.Text
If QuanLU = 0 Then
MessageBox.Show("Pls. enter Lab. Units", "Tuition Fee")
Exit Sub
End If

TU = Quan1 * QuanTU
LU = Quan2 * QuanLU
MF = Price
TotalFee = TU + LU + MF
txtLF.Text = FormatNumber(LU, 2)
txtTF.Text = FormatNumber(TU, 2)
txtMF.Text = FormatNumber(MF, 2)
txtTotalF.Text = FormatNumber(TotalFee, 2)
End Sub

Private Sub btnClear_Click(sender As Object, e As EventArgs) Handles


btnClear.Click
lstYL.ClearSelected()
cboCourse.Text = ""
txtLF.Text = ""
nudLU.Text = 0
nudTU.Text = 0
txtMF.Text = ""
txtTF.Text = ""
txtTotalF.Text = ""
End Sub

Private Sub btnClose_Click(sender As Object, e As EventArgs) Handles


btnClose.Click
Me.Close()
End Sub
End Class

You might also like