(TCO 7) In an SQL Query statement used in a VBScript program, what Boolean operator can be used to test a set of conditions whereby

COMP 230 Introduction to Scripting and Database with Lab Week 8 Final Exam Answers


Question 1. 1. (TCO 7) In an SQL Query statement used in a VBScript program, what Boolean operator can be used to test a set of conditions whereby any condition being true must test true? (Points : 5)

Question 2. 2. (TCO 7) Which one of the following is a correct SELECT clause in a VBScript program for selecting the fields: FirstName and LastName and Age? (Points : 5)

Question 3. 3. (TCO 7) What SQL clause is used in a VBScript program to determine the Table or Tables to be accessed in an SQL Query statement? (Points : 5)

Question 4. 4. (TCO 7) Which one of the follows fields would be suitable as a primary key in a table that contains employee records? (Points : 5)

Question 5. 5. (TCO 1) Which Windows shutdown command switch is used to log off the current user of the local computer? (Points : 5)

Question 6. 6. (TCO 1) Which one of the following Windows NET commands will allow other computers to access the C:\Data directory under the share name UserData? (Points : 5)

Question 7. 7. (TCO 1) From the Start/Run dialog, the command used to open the 32-bit Windows command prompt is _____. (Points : 5)

Question 8. 8. (TCO 1) Which of the following Windows commands will shutdown and power down the computer FileServer in 2 minutes? (Points : 5)

Question 9. 9. (TCO 6) What WSH object is required for VBScript File I/O? (Points : 5)

Question 10. 10. (TCO 6) To evaluate whether a file exists or not before you overwrite it in VBScript, use the following command (assuming that fso is an object of type Scripting.FileSystemObject). (Points : 5)

Question 11. 11. (TCO 6) The following VBScript statement will open a text file. 

Question 12. 12. (TCO 2) Given the rules of operator precedence, what value would the variable contain after the following statement was executed? distance = 2 + 5 * 3 (Points : 5)

Question 13. 13. (TCO 2) What is an example of a numeric constant? (Points : 5)

Question 14. 14. (TCO 2) What is the problem with the following statement? 75 = percent (Points : 5)

Question 15. 15. (TCO 2) What is the best choice for a variable name representing a bank balance? (Points : 5)

Question 16. 16. (TCO 2) What is the problem with the following statement? 65 = seniorAge (Points : 5)

Question 17. 17. (TCO 5) What name is best suited to a function or subroutine that calculates overtime pay? (Points : 5)

Question 18. 18. (TCO 5) A good example of a well-named constant is _____. (Points : 5)

Question 19. 19. (TCO 3) What VBScript decision-making statement would be for a single condition and two alternative code blocks to be executed? (Points : 5)

Question 20. 20. (TCO 3) What produces the same result as the following pseudocode?

Question 21. 21. (TCO 3) In VBScript, which relational operator is used to test for equality? (Points : 5)

Question 22. 22. (TCO 3) Boolean expressions can have which outcomes? (Points : 5)

Question 23. 23. (TCO 3) When using the _____ operator, both conditions must be true in order for the entire expression to be evaluated as true. (Points : 5)Question 24. 24. (TCO 4) What is the issue with the following VBScript While loop?

Question 24. 24. (TCO 4) What is the issue with the following VBScript While loop?

Question 25. 25. (TCO 4) When a VBScript loop control variable is not altered during loop execution, a(n) _____ loop may result. (Points : 5)

Question 27. 27. (TCO 4) When a variable is incremented by 1, _____. (Points : 5)

Question 28. 28. (TCO 4) What is the term used to represent individual items in an array? (Points : 5)

Question 1. 1. (TCO 1) Write the Windows CLI commands that will Clear the screen; Turn off Command echo; and display the current IP address, Subnet Mask, and Default Gateway. (Points : 13)

Question 2. 2. (TCO 1) Write the Windows CLI command that will shutdown and restart your computer in 2 minutes with the message “Restart in 2 Minutes!!” (Points : 13)

Question 3. 3. (TCO 2) Write the VBScript code lines that perform the following tasks: Define a variable name that is initialized to “John Doe” and a variable age that is initialized to 35. USING THESE VARIABLES, display the following message: “Your name is John Doe and your age is 35.” (Points : 14)

Question 4. 4. (TC0 3) Given the variables hoursWorked and payRate, write the VBScript code that will calculate grossPay. Keep in mind that any hours worked over 40 are paid at time and a half. (Points : 14)

Question 5. 5. (TCO 3) Write the VBScript code that implements this logic. Given the numeric variable age, display the message “You are a Senior” if age is greater than or equal to 65, otherwise display the message “You are not a Senior”. (Points : 14)

Question 1. 1. (TCO 5) Write a VBScript function called MaxNum that accepts two numbers and returns the largest to the two numbers. (Points : 14)

Question 2. 2. (TCO 6) Write the VBScript code that will delete the file C:\Data\DataFile.txt using a Script.FileSystemObject, but do this only if the file exists. (Points : 14)

Question 3. 3. (TCO 7) Assuming that you are connected to a database called Computers.mdb with a table called Inventory with the fields Computer, Hostname Room_Num, CPU_Type, Num_CPUs, Bit_Size, OS_Type, Memory, and HDD_Size. Write the SQL Query String sqlStr such that the fields Computer, Room_Num, and OS_Type will be displayed for the records that indicate an OS_Type of “Fedora 10” or “Windows XP.” The returned records should be sorted by OS_Type. (Points : 14)