You are on page 1of 5

Name: Shubham Joshi

Enrollment Number: 01014202019

BCA III Morning

Mid Term Program

Date 8 January 2021

Program:
Public Class Form1

Public Structure employee


Dim name As String
Dim g_sal As Double
End Structure

Dim emp(10) As employee


Dim count As Integer = 0
Dim index As Integer = 0

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click


If count > 6 Then
MsgBox("Cannot Input More Data", MsgBoxStyle.Critical)
End If
Try
emp(index).name = TextBox1.Text
ComboBox1.Items.Add(TextBox1.Text)
emp(index).g_sal = CType(TextBox2.Text, Double)
ComboBox2.Items.Add(TextBox2.Text)
MsgBox("Data Inserted !", MsgBoxStyle.ApplicationModal)
TextBox2.Clear()
TextBox1.Clear()
index += 1
count += 1
Catch ex As Exception
MsgBox(ex.Message & "," & MsgBoxStyle.Critical & "," & ex.Source)
End Try
End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click


Dim temp As String
Dim temp_sal As Double
ComboBox2.Enabled = False
Dim i As Integer
i = ComboBox1.SelectedIndex
ComboBox2.SelectedIndex = i
Try
Try
TextBox4.Text = "Allowance Allowed Gross Salary + 45% "
temp = ComboBox2.SelectedItem.ToString
temp_sal = CType(temp, Double)
temp_sal = temp_sal + temp_sal * 0.45
Catch
MsgBox("Please Select Emplotee Gross Salary And Employe Name",
MsgBoxStyle.Critical)
End Try

If temp_sal > 50000 Then


TextBox3.Text = ("15% Deduction")
temp_sal = temp_sal - (temp_sal * 0.15)
RichTextBox3.Text = "Employee Name ::" + ComboBox1.SelectedItem.ToString
+ vbNewLine + "45% Increment ::" + temp_sal.ToString + vbNewLine + "Final Salary(with
15% deducton) ::" + temp_sal.ToString + vbNewLine
Else
TextBox3.Text = ("10% Deduction")
temp_sal = temp_sal - (temp_sal * 0.1)
RichTextBox3.Text = "Employee Name ::" + ComboBox1.SelectedItem.ToString
+ vbNewLine + "45% Increment ::" + temp_sal.ToString + vbNewLine + "Final Salary(with
10% deducton) ::" + temp_sal.ToString + vbNewLine
End If

Catch ex As Exception
MsgBox(ex.Message & "," & MsgBoxStyle.Critical & "," & ex.Source)
End Try
End Sub

Private Sub Form1_Load(sender As Object, e As EventArgs)


TextBox3.Enabled = False
TextBox4.Enabled = False
RichTextBox3.Enabled = False
ComboBox2.Enabled = False
End Sub

Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click


End
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click


TextBox1.Clear()
TextBox2.Clear()
End Sub
End Class
Output:

1.

2.
3.

4.
File:

subham_joshi_questio
n.exe

You might also like