Write and run a visual payroll program for 10 employee of a company.The gross pay sums the basic pay, housing allowance and professional allowance (where applicable).Workers grade levels range from 1to 16. Housing allowance of workers is 30% of basic pay for workers on levels 8 to 16 and 40% for levels 1-7 workers.Transport allowance is 20% of basic pay for all workers. Hazard allowance is 15% of basic pay for only levels 8-16 workers. The net pay, which is the take home pay is the gross pay tax (10% of gross pay). Designs form through which each workers data can be entered. In a flowchart form
Module Module1
Sub Main()
For i As Integer = 1 To 10
Console.WriteLine("Enter the detail information for worker {0}: ", i)
Console.Write("Enter the basic pay: ")
Dim basic_pay As Double = Integer.Parse(Console.ReadLine())
Console.Write("Enter the worker grade levels range from 1 to 16: ")
Dim worker_level As Integer = Integer.Parse(Console.ReadLine())
Dim housing_allowance As Double = basic_pay * 0.3
If worker_level >= 1 And worker_level <= 7 Then
housing_allowance = basic_pay * 0.4
End If
Dim transport_allowance As Double = basic_pay * 0.2
Dim hazard_allowance As Double = 0
If worker_level >= 8 And worker_level <= 16 Then
hazard_allowance = basic_pay * 0.15
End If
Dim gross_pay As Double = basic_pay + housing_allowance + hazard_allowance + transport_allowance
Dim net_pay As Double = gross_pay - gross_pay * 0.1
Console.WriteLine("The gross pay = {0}", gross_pay.ToString("C"))
Console.WriteLine("The net pay = {0}", net_pay.ToString("C"))
Console.WriteLine()
Next
Console.ReadLine()
End Sub
End Module
Comments
Leave a comment