Create an application that calculates and displays two raise amounts, which are based on an employee’s current salary. The current salary will be entered by the user. The two raise rates are 5% and 8%. In addition to the raise amounts, the application should also calculate and display the employee’s new salaries. Include a button in the interface that the user can click to clear the user input and calculated results from the screen.
Public Class mainForm
''' <summary>
''' Calculate button press
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
''' <remarks></remarks>
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
Dim current_calary As Double
current_calary = Double.Parse(txtSalary.Text)
Dim new_salary_raise_rates_5 As Double = current_calary + current_calary * 0.05D
Dim new_salary_raise_rates_8 As Double = new_salary_raise_rates_5 + new_salary_raise_rates_5 * 0.08D
txtSalaryRates5.Text = new_salary_raise_rates_5.ToString()
txtSalaryRates8.Text = new_salary_raise_rates_8.ToString()
End Sub
''' <summary>
''' Clear button press
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
''' <remarks></remarks>
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
txtSalary.Text = ""
txtSalaryRates5.Text = ""
txtSalaryRates8.Text = ""
End Sub
End Class
Comments
Leave a comment