discovery In this exercise, you will learn how to use a Boolean value as the tes
ID: 3600276 • Letter: D
Question
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 applicationExplanation / Answer
import java.io.File; importjava.io.IOException; public class RenameFile { public static void main(String[] args) { try // Here F is the object of the Existing file named with Includehelp which is to be renamed. // { File F=new File("f:/Includehelp.txt"); // Here T is the object of the renamed file of Includehelp which is Include.txt. // File T=new File ("f:/Include.txt"); // Rename the file Includehelp.txt into Include.txt. // F.renameTo(T); // Print the result if file renamed. // System.out.println("File Rename Successfully..."); } // If any error occurs while renaming the file. // catch(Exception e) { System.out.println(e); } } }
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.