Answered step by step
Verified Expert Solution
Question
1 Approved Answer
discovery In this exercise, you will learn how to use a Boolean value as the testexpression a. Start either Word, Excel, Access, or PowerPoint. Open
discovery In this exercise, you will learn how to use a Boolean value as the testexpression a. Start either Word, Excel, Access, or PowerPoint. Open the Visual Basic Editor 8. Insert a module, then create a procedure named DisplayRaiseRate. The DisplayRaiseRate procedure should assign the appropriate raise rate based on the following information: Employees coded A who have been with the company for more than three years get a 4% raise. Employees coded B who have been with the company for more than five years get a 5% raise. All other employees get a 3% raise. b. Enter the partially completed code shown in Figure 8-8. Complete the procedure by entering the appropriate expressions for both expressionlist1 and expressionlist2 (Hint: You can use the logical operators And and Or in the expressionlists.) declare variables Dim strCode As String, strYears As String Dim intYears As Integer, sngRaise As Single enter employee code and years employed strCode = InputBox ( prompt:-"Enter the employee code : ", Title:-"Code") strYears InputBox ( prompt:="Enter the number of years employed :", Title:-"Years" convert years to a number and convert code to uppercase strCodeUCase (strCode) assign raise rate Select Case True Case Case Case Else sngRaise 0.04 sngRaise - 0.05 sngRaise = 0.03 End Select Prompt : =Format ( expression:=sngRaise, Buttons:vboKOnly MsgBox Format:-"percent"), vbInformation, Title:-"Raise Rate" Figure 8-8 c. Save the procedure, then run the procedure five times. First enter A as the code and 2 as the number of years. The message box should display 3.00%. Next, enter A as the code and 10 as the number of years. The message box should display 4.00%. Next, enter B as the code and 8 as the number of years. The message box should display 5.00%. Finally, enter B as the code and 5 as the number of years. The message box should display 3.00% d. Exit the application discovery In this exercise, you will learn how to use a Boolean value as the testexpression a. Start either Word, Excel, Access, or PowerPoint. Open the Visual Basic Editor 8. Insert a module, then create a procedure named DisplayRaiseRate. The DisplayRaiseRate procedure should assign the appropriate raise rate based on the following information: Employees coded A who have been with the company for more than three years get a 4% raise. Employees coded B who have been with the company for more than five years get a 5% raise. All other employees get a 3% raise. b. Enter the partially completed code shown in Figure 8-8. Complete the procedure by entering the appropriate expressions for both expressionlist1 and expressionlist2 (Hint: You can use the logical operators And and Or in the expressionlists.) declare variables Dim strCode As String, strYears As String Dim intYears As Integer, sngRaise As Single enter employee code and years employed strCode = InputBox ( prompt:-"Enter the employee code : ", Title:-"Code") strYears InputBox ( prompt:="Enter the number of years employed :", Title:-"Years" convert years to a number and convert code to uppercase strCodeUCase (strCode) assign raise rate Select Case True Case Case Case Else sngRaise 0.04 sngRaise - 0.05 sngRaise = 0.03 End Select Prompt : =Format ( expression:=sngRaise, Buttons:vboKOnly MsgBox Format:-"percent"), vbInformation, Title:-"Raise Rate" Figure 8-8 c. Save the procedure, then run the procedure five times. First enter A as the code and 2 as the number of years. The message box should display 3.00%. Next, enter A as the code and 10 as the number of years. The message box should display 4.00%. Next, enter B as the code and 8 as the number of years. The message box should display 5.00%. Finally, enter B as the code and 5 as the number of years. The message box should display 3.00% d. Exit the application
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started