Question: 8. Open the Turner Solution (Turner Solution.sln) file contained in the VB2012Chap03 Turner Solution folder. If necessary, open the designer window. The application calculates the
8. Open the Turner Solution (Turner Solution.sln) file contained in the VB2012\Chap03
\Turner Solution folder. If necessary, open the designer window. The application calculates the new hourly pay for each of three job codes, given the current hourly pay for each job code and the raise percentage (entered as a decimal number). The application should display the message “Raise percentage: XX” in a label control on the form. The XX in the message should be replaced by the actual raise percentage.
a. Code the Exit button so that it ends the application when it is clicked.
b. Before the form appears, use the InputBox function to prompt the personnel clerk to enter the raise percentage in decimal form. You will use the raise percentage to calculate the new hourly pay for each job code.
c. Use the pseudocode shown in Figure 3-50 to code the Calculate button’s Click event procedure. Be sure to use variables. (Do not use the Val function.) Create a named constant for the “Raise percentage:” message. Format the new hourly pay amounts using the “N2” formatString. Format the raise rate (in the message) using the “P0”
formatString.
d. Save the solution and then start the application. When you are prompted to enter the raise percentage, type .05 (the decimal equivalent of 5%) and then click the OK button. Use the following information to calculate the new hourly pay for each job code:
Current hourly pay for job code 1: 5 Current hourly pay for job code 2: 6.5 Current hourly pay for job code 3: 8.75
e. Close the Code Editor window and then close the solution.
btnCalc Click event procedure 1. calculate each new hourly pay = current hourly pay * raise rate + current hourly pay 2. display the new hourly pays in the appropriate label controls 3. display the message and raise rate in the lblMessage control 4. send the focus to the txtCurrent1 control
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
