This Visual Basic code defines variables to store an employee's hours and hourly rate. When a button is clicked, it multiplies the hours and rate to calculate pay. If one radio button is checked, it displays the pay amount and labels it as tax exempt. If the other is checked, it calculates pay with an 18% tax deduction and displays the results.
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
53 views
Exercise 2
This Visual Basic code defines variables to store an employee's hours and hourly rate. When a button is clicked, it multiplies the hours and rate to calculate pay. If one radio button is checked, it displays the pay amount and labels it as tax exempt. If the other is checked, it calculates pay with an 18% tax deduction and displays the results.
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1
Exercise #2
Public Class Form1
Dim Hours As Decimal Dim Rate As Decimal
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click Hours = TextBoxNum1.Text Rate = TextBoxNum2.Text Label4.Text = Hours * Rate If RadioButton1.Checked Then Label4.Text = Hours * Rate Label5.Text = "EXEMPT FROM TAXES" ElseIf RadioButton2.Checked Then Label4.Text = (Hours * Rate) - ((Hours * Rate) * 0.18) End If End Sub End Class