0% found this document useful (0 votes)
82 views

Exercise 8 Word

This code calculates different monetary amounts based on checkboxes selected. It defines variables for basic pay, waiting pay, forwarding pay, and ID pay. When the calculate button is clicked, it checks which checkboxes are selected and calculates the total pay by adding the appropriate pay rates to the basic pay, outputting the result to a label. It has logic to handle all possible combinations of single, double, and triple checkbox selections.

Uploaded by

api-310300017
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
82 views

Exercise 8 Word

This code calculates different monetary amounts based on checkboxes selected. It defines variables for basic pay, waiting pay, forwarding pay, and ID pay. When the calculate button is clicked, it checks which checkboxes are selected and calculates the total pay by adding the appropriate pay rates to the basic pay, outputting the result to a label. It has logic to handle all possible combinations of single, double, and triple checkbox selections.

Uploaded by

api-310300017
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Public Class Form1

Dim basic As Decimal


Dim waiting As Decimal
Dim forward As Decimal
Dim ID As Decimal
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles btnCalculate.Click
basic = 25
waiting = 3.5
forward = 3.5
ID = 3.5
If chkwaiting.Checked = True Then
lblmoney.Text = basic + waiting
ElseIf chkforwarding.Checked = True Then
lblmoney.Text = basic + forward
ElseIf chkID.Checked = True Then
lblmoney.Text = basic + ID
End If
If chkwaiting.Checked = False And chkforwarding.Checked = False And chkID.Checked =
False Then
lblmoney.Text = basic
ElseIf chkwaiting.Checked = True And chkforwarding.Checked = True And chkID.Checked =
True Then
lblmoney.Text = basic + waiting + forward + ID
ElseIf chkwaiting.Checked = True And chkforwarding.Checked = True And chkID.Checked =
False Then
lblmoney.Text = basic + waiting + forward
ElseIf chkwaiting.Checked = True And chkforwarding.Checked = False And chkID.Checked =
True Then
lblmoney.Text = basic + waiting + ID
ElseIf chkwaiting.Checked = False And chkforwarding.Checked = True And chkID.Checked =
True Then
lblmoney.Text = basic + ID + forward
End If
End Sub
End Class

You might also like