01/19/2006
Midterm.
4 X 25= 100
Q2a)Design a form called Dr Ebrahimi payroll (instead put your own name) (2points).
The form has three textbox labeled as EMPLOYEE’S ID, HOURS WORKED and HOURLY RATE (2 points).
A button known as COMPUTE GROSS PAY will compute the gross pay for the employee (2 points).
The output will be display in a textbox labeled as GROSS PAY (2 points). ( total 8 points)
Q2b) Expand the above program to compute the employee’s tax amount. An input text box labeled as TAX RATE is to enter the tax rate. In addition the tax rate should set in property 0.30 for 30% - by default. (3 points).
A button known as COMPUTE TAX AMOUNT will figure out the employee’s tax amount (3 points).
The output will display in a text box labeled as TAX AMOUNT (3 points). (9 points)
Extra credit- Instead of compute button use text4.textchanged( ) to compute the tax amount.
Q2c) Expand the above program to compute the net pay. A button known as COMPUTE NET PAY will compute the net pay (4 points).
The output will be display in a text box labeled as NET PAY (4 points). (8 points)
Extra credit- instead of text box numbering such as textbox1.text use a proper name in the properties such as empid.text.
Q3A)Expand the above program to repeat for 5 employees. 1
Declares all variables used in the program.2
Assign each input variable by inputbox (“PLEASE ENTER EMPLOYEE’S ID”). 2
Assign value of each input variable to the respective text box2.
Similarly assign value of each output Variable to the respective text box. 2
Only use one command button captioned as COMPUTE 5 EMPLOYEE.1 (10)
Q3b) Display the employee counter by a msgbox 2at the end of each round in the loop or assign the value of the counter variable to a textbox labeled as COUNTER2.(4)
Q3c) loop the number of employees interactively by an inputbox.3
Assign the input value of the input box as a number of the employees2. The program will loop depends on the entered value (6 or 10).(5)
Extra credit- program should loop until a sentinel value is entered.
Q3d) Expand the program to take all the data from the input file3 called employee.txt3 (6)
Q4a) Modify the above program
to use a variable tax rate. Assign the tax rate based on the computed gross pay.
Tax rate for gross pay more than $500.00 is 20%, for more than $300.00 is 15%,
and 10% for the rest. You can use the following:
If ………….Then
………….
ElseIf ……. Then
………….
Else
………….
End If
Q4b) Include marital status (Single, Married) as input to your form. You can use a TextBox or RadioButton, etc. For Single employees, additional 10% will be added to the tax rate. For Married employees, 5% will be subtracted from tax rate.
Q4c) Error-checking: Use If … Then statements to check for errors on two of the TextBoxes such as hours worked, hourly rate, or gross pay (e.g. hours worked must be greater than 0 and less than 56, and gross pay must be greater than zero, etc.).
For example:
For hours worked greater than 56, you can display an error message such as MsgBox(“Please enter correct hours worked.”)
NOTE: Question 5F is shorting and all you have to do is follow Page 157. When you sort the search becomes faster. If you dont sort it you would have to go end of the loop.