Public Class Form1 Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents Label4 As System.Windows.Forms.Label Friend WithEvents TextBox1 As System.Windows.Forms.TextBox Friend WithEvents TextBox2 As System.Windows.Forms.TextBox Friend WithEvents TextBox3 As System.Windows.Forms.TextBox Friend WithEvents ListBox1 As System.Windows.Forms.ListBox Friend WithEvents RadioButton1 As System.Windows.Forms.RadioButton Friend WithEvents RadioButton2 As System.Windows.Forms.RadioButton Friend WithEvents Button1 As System.Windows.Forms.Button Friend WithEvents Button2 As System.Windows.Forms.Button Friend WithEvents Button3 As System.Windows.Forms.Button Private Sub InitializeComponent() Me.Label1 = New System.Windows.Forms.Label Me.Label2 = New System.Windows.Forms.Label Me.Label3 = New System.Windows.Forms.Label Me.Label4 = New System.Windows.Forms.Label Me.TextBox1 = New System.Windows.Forms.TextBox Me.TextBox2 = New System.Windows.Forms.TextBox Me.TextBox3 = New System.Windows.Forms.TextBox Me.ListBox1 = New System.Windows.Forms.ListBox Me.RadioButton1 = New System.Windows.Forms.RadioButton Me.RadioButton2 = New System.Windows.Forms.RadioButton Me.Button1 = New System.Windows.Forms.Button Me.Button2 = New System.Windows.Forms.Button Me.Button3 = New System.Windows.Forms.Button Me.SuspendLayout() ' 'Label1 ' Me.Label1.BackColor = System.Drawing.SystemColors.Desktop Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 20.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label1.Location = New System.Drawing.Point(88, 8) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(240, 40) Me.Label1.TabIndex = 0 Me.Label1.Text = "Ye Olde Junk Co." ' 'Label2 ' Me.Label2.BackColor = System.Drawing.SystemColors.Desktop Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label2.Location = New System.Drawing.Point(192, 56) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(160, 24) Me.Label2.TabIndex = 1 Me.Label2.Text = "Employee Name" ' 'Label3 ' Me.Label3.BackColor = System.Drawing.SystemColors.Desktop Me.Label3.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label3.Location = New System.Drawing.Point(192, 96) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(160, 24) Me.Label3.TabIndex = 2 Me.Label3.Text = "Hours Worked" ' 'Label4 ' Me.Label4.BackColor = System.Drawing.SystemColors.Desktop Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label4.Location = New System.Drawing.Point(192, 136) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(160, 24) Me.Label4.TabIndex = 3 Me.Label4.Text = "Pay Rate" ' 'TextBox1 ' Me.TextBox1.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.TextBox1.Location = New System.Drawing.Point(384, 56) Me.TextBox1.Name = "TextBox1" Me.TextBox1.Size = New System.Drawing.Size(104, 23) Me.TextBox1.TabIndex = 4 Me.TextBox1.Text = "" ' 'TextBox2 ' Me.TextBox2.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.TextBox2.Location = New System.Drawing.Point(384, 96) Me.TextBox2.Name = "TextBox2" Me.TextBox2.Size = New System.Drawing.Size(104, 23) Me.TextBox2.TabIndex = 5 Me.TextBox2.Text = "" ' 'TextBox3 ' Me.TextBox3.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.TextBox3.Location = New System.Drawing.Point(384, 136) Me.TextBox3.Name = "TextBox3" Me.TextBox3.Size = New System.Drawing.Size(104, 23) Me.TextBox3.TabIndex = 6 Me.TextBox3.Text = "" ' 'ListBox1 ' Me.ListBox1.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.ListBox1.ItemHeight = 24 Me.ListBox1.Items.AddRange(New Object() {"Employee Name: ", "Employee Status : ", "Gross Pay : ", "Federal Tax : ", "NY Taxes : ", "Net Pay : "}) Me.ListBox1.Location = New System.Drawing.Point(24, 192) Me.ListBox1.Name = "ListBox1" Me.ListBox1.Size = New System.Drawing.Size(344, 148) Me.ListBox1.TabIndex = 11 ' 'RadioButton1 ' Me.RadioButton1.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.RadioButton1.Location = New System.Drawing.Point(48, 80) Me.RadioButton1.Name = "RadioButton1" Me.RadioButton1.TabIndex = 12 Me.RadioButton1.Text = "Part-Time" ' 'RadioButton2 ' Me.RadioButton2.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.RadioButton2.Location = New System.Drawing.Point(48, 112) Me.RadioButton2.Name = "RadioButton2" Me.RadioButton2.TabIndex = 13 Me.RadioButton2.Text = "Full-Time" ' 'Button1 ' Me.Button1.Location = New System.Drawing.Point(384, 200) Me.Button1.Name = "Button1" Me.Button1.Size = New System.Drawing.Size(104, 32) Me.Button1.TabIndex = 14 Me.Button1.Text = "Calculate" ' 'Button2 ' Me.Button2.Location = New System.Drawing.Point(384, 248) Me.Button2.Name = "Button2" Me.Button2.Size = New System.Drawing.Size(104, 32) Me.Button2.TabIndex = 15 Me.Button2.Text = "Clear" ' 'Button3 ' Me.Button3.Location = New System.Drawing.Point(384, 296) Me.Button3.Name = "Button3" Me.Button3.Size = New System.Drawing.Size(104, 32) Me.Button3.TabIndex = 16 Me.Button3.Text = "Close" ' 'Form1 ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.BackColor = System.Drawing.SystemColors.Desktop Me.ClientSize = New System.Drawing.Size(504, 357) Me.Controls.Add(Me.Button3) Me.Controls.Add(Me.Button2) Me.Controls.Add(Me.Button1) Me.Controls.Add(Me.RadioButton2) Me.Controls.Add(Me.RadioButton1) Me.Controls.Add(Me.ListBox1) Me.Controls.Add(Me.TextBox3) Me.Controls.Add(Me.TextBox2) Me.Controls.Add(Me.TextBox1) Me.Controls.Add(Me.Label4) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label1) Me.Name = "Form1" Me.Text = "Form1" Me.ResumeLayout(False) End Sub #End Region Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If TextBox1.Text = "" Then MessageBox.Show("Please enter Employee Name", "missing Information") Exit Sub End If If TextBox2.Text = "" Then MessageBox.Show("Please enter Hours Worked", "Missing Information") Exit Sub End If If TextBox3.Text = "" Then MessageBox.Show("Please enter Pay Rate per hour", "Missing Information") Exit Sub End If If RadioButton1.Checked = False And RadioButton2.Checked = False Then MessageBox.Show("Please select Full-Time or Part-Time", "Missing Information") Exit Sub End If Dim Name As String Dim hours As Double Dim Pay As Double Dim gross As Double Dim otpay As Double Dim othours As Double Dim type As String Name = TextBox1.Text hours = CDbl(TextBox2.Text) Pay = CDbl(TextBox3.Text) If RadioButton2.Checked = True And hours > 40 Then type = "Full-Time" othours = hours - 40 otpay = 1.5 * Pay * othours gross = (40 * Pay) + otpay Else If RadioButton2.Checked = True Then type = "Full-Time" gross = hours * Pay type = "Full-Time" Else If RadioButton1.Checked = True Then type = "Part-Time" gross = hours * Pay End If End If End If ListBox1.Items.Clear() ListBox1.Items.Add("Employee Name: " & Name) ListBox1.Items.Add("Employee Status : " & type) ListBox1.Items.Add("Gross Pay : " & Format(gross, "currency")) ListBox1.Items.Add("Federal Tax : " & Format((gross * 0.2), "currency")) ListBox1.Items.Add("NY Taxes : " & Format((gross * 0.1), "currency")) ListBox1.Items.Add("Net Pay : " & Format((gross * 0.7), "currency")) End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Clear() TextBox2.Clear() TextBox3.Clear() ListBox1.Items.Clear() ListBox1.Items.Add("Employee Name: ") ListBox1.Items.Add("Employee Status : ") ListBox1.Items.Add("Gross Pay : ") ListBox1.Items.Add("Federal Tax : ") ListBox1.Items.Add("NY Taxes : ") ListBox1.Items.Add("Net Pay : ") End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.Close() End Sub End Class