Computer Science > EXAM > COMP 230 - Final Exam - 1 (Highly Rated Paper) | 100% Correct Solution. (All)
1. (TCO 7) The general syntax of an SQL select statement is . (Points : 5) Select—From—Where Get—Date—Where Select—Update—When Select—Condition—Table 2. (TCO 7) In a VBScript SQL... Query statement, what Boolean operator can be used to test a set of conditions whereby all conditions must be true? (Points : 5) OR AND XOR NOT 3. (TCO 7) The in a table is the column that makes each record different from all others. (Points : 5) unique record primary key sort key magic field 4. (TCO 7) What task(s) are involved in designing a database table? (Points : 5) Naming each record Naming each field Naming each field and providing data types Inserting all of the data 5. (TCO 1) Which of the following Windows commands will shutdown and restart the computer FileServer in 2 minutes? (Points : 5) shutdown -r -m //FileServer -t 2 shutdown -r -m //FileServer -t 120 shutdown -r -m \\FileServer -t 2 shutdown -r -m \\FileServer -t 120 6. (TCO 1) Which Windows shutdown command switch is used to shutdown and turn off a local or a remote computer? (Points : 5) -h /halt -s /shut 7. (TCO 1) Which one of the following Windows NET commands options is not used to control services with the NET ?????ServiceName? (Points : 5) STOP START CONTINUE PAUSE DELETE 8. (TCO 1) The NETSH command that will set the IP address of the interface name NIC to a DHCP- supplied IP address is . (Points : 5) netsh interface set ip address “NIC” source=dhcp netsh interface ip address “NIC” source=dhcp netsh interface ip set address “NIC” source=dhcp netsh interface set ip address source=dhcp “NIC” 9. (TCO 6) The following VBScript statement will open a text file. Set file = fso.OpenTextFile(“C:\Data\CustData.txt”, ?, ??, ???) To create a new file if it doesn’t exist, the value of ??must be . (Points : 5) 1 2 false true 10. (TCO 6) In creating a VBScript Scripting.FileSystemObject, you must start the code line with . (Points : 5) Let fso = CreateObject Set fso = CreateObject Let fso = new Object Set fso = new Object 11. (TCO 6) The following VBScript statement will open a text file. Set file = fso.OpenTextFile(“C:\Data\CustData.txt”, ?, ??, ???) To open this file for reading, the value of ?must be . (Points : 5) 1 2 true false 12. (TCO 2) What is the problem with the following statement? average = (60 + 75) /100 (Points : 5) Parentheses are not allowed. Data types don't match. Average should be in quotes. There is no problem with this statement. 13. (TCO 2) What is the multiplication operator? (Points : 5) = ^ * % 14. (TCO 2) What is the assignment operator? (Points : 5) = ^ * % 15. (TCO 2) What is the best choice for a variable name representing an interest rate? (Points : 5) i interest ir interestRate 16. (TCO 2) If a variable holds the value "Ferrari," what is its data type? (Points : 5) Numeric Integer Floating point String 17. (TCO 5) In what way do VBScript named constants differ from variables? (Points : 5) There is no difference. The value of a constant does not change. Constants do not have identifier names. Constants are not used in modern programming. 18. (TCO 5) Variables declared in the main section of a VBScript program have what scope? (Points : 5) Local Global Local and global Nonvisibility 19. (TCO 3) What characters can be used to force operator precedence? (Points : 5) Parentheses Dollar signs Question marks Double quotes 20. (TCO 3) What produces the same result as the following pseudocode? if empRate>= 10.00 then if empRate< 20.00 then print empIdNumber, empLastName, empFirstName endif endif (Points : 5) if empRate>= 10.00 AND empRate< 20.00 hen print empIdNumber, empLastName, empFirstName end if ifempRate>= 10.00 AND empRate< 20.00 then WScript.EchoempIdNumber&empLastName&empFirstName end if ifempRate>= 10.00 OR empRate< 20.00 print empIdNumber, empLastName, empFirstName end if ifempRate>= 10.00 OR empRate< 20.00 WScript.EchoempIdNumber&empLastName&empFirstName end if 21. (TCO 3) What VBScript Boolean operator could be used to replace the nested selection structure in this pseudocode? if empMedicalIns = "Y" then if empDentalIns = "Y" then print empIdNumber, empLastName, empFirstName endif endif (Points : 5) XOR AND OR NOT 22. (TCO 3) In VBScript, when you combine Boolean operators, the operators take precedence, meaning their values are evaluated first. (Points : 5) EQV XOR OR AND 23. (TCO 3) A decision that is inside of another decision is known as a decision. (Points : 5) grouped nested compound binary 24. (TCO 4) What is the problem with the following VBScript Do While loop? count = 1 Do While count < 10 WScript.Echo count Loop (Points : 5) The loop control variable is not initialized. The loop control variable is not altered. The loop test should check "greater than" instead of "less than." The loop body is missing. 25. (TCO 4) The number of elements in an array is called the of the array. (Points : 5) width height size depth 26. (TCO 4) How many times will the following VBScript Do While loop execute the loop body? count = 0 Do While count < 10 count = count + 1 Loop (Points : 5) 0 10 9 11 27. (TCO 4) VBScript arrays are most efficiently processed using . (Points : 5) selection structures nested statements stacked statements loops 28. (TCO 4) In VBScript, the array declaration dim data(10) indicates the array data can have a maximum of elements or components. (Points : 5) 9 10 11 12 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) To Clear the screen cls To Turn off Command echo @echo off To display the current IP address, Subnet Mask, and Default Gatew ay ipconfig 2. (TCO 1) Write the Windows CLI NET commands that will turn the Spooler service OFF and then ON. (Points : 13) net stop "Print Spooler" net start "Print Spooler" 3. (TCO 2) Write the VBScript code lines that define a constant TAXRATE that is 25%, a variable basePay that is $1000, and a variable bonusPay that is $500. Calculate the net pay, and assign that value to netPay. Then, calculate the taxes, and assign that value to taxWithheld. (Points : 14) Const TAXRATE=.25 dim basePay, bonusPay, netPay, taxWithheld basePay = 1000 bonusPay = 500 netPay = (basePay + bonusPay) * (1 - TAXRATE) taxWithheld = (basePay + bonusPay) * TAXRATE 4. (TC0 3) Given the variables hoursWorked and payRate, write the VBScript code that will calculate grossPay such that all hoursWorked 40 will be paid at time and a half. (Points : 14) Dim payRate Dim hoursWorked Dim grossPay payRate = InputBox("Enter the pay Rate :") hoursWorked = InputBox("Enter the hours w orked :") if hoursWorked> 40 then grossPay = 40 * payRate + (hoursWorked - 40) * 1.5 * payRate else grossPay = hoursWorked * payRate End if MsgBox "Gross Pay " & grossPay 1. (TCO 4) Write the VBScript code that uses a Do Until loop to display all of the integer values stored in the array numArray(100) . (Points : 14) Dim a Dim numArray(100) Dim str For a=0 to ubound(numArray) numArray(a)=a next For a=0 to ubound(numArray) str=str & a & ", " next Msgbox Left(str,Len(str)-2) 2. (TCO 5) Write a VBScript function called MaxNum that accepts two numbers and returns the largest to the two numbers. (Points : 14) Function MaxNum(ByVal num1, ByVal num2) If (num1 > num2) Then MaxNum = num1 Else MaxNum = num2 End If End Function 3. (TCO 6) Write the VBScript code that defines the Scripting.FileSystemObject and the file C:\Data\DataFile.txt for writing. Make sure the file will be created if it doesn’t exist, and ensure that the format is ASCII. (Points : 14) Const ForAppending = 8 dim objFS, objSt Set objFS = CreateObject("Scripting.FileSystemObject") Set objSt = objFS.OpenTextFile("C:\data\DataFile.txt", ForAppending, True) 4. (TCO 7) Assuming that you are connected to a database called Computers.mdb with the fields Computer, Hostname Room_Num, CPU_Type, Num_CPUs, Bit_Size, OS_Type, Memory, Speed and HDD_Size, write the SQL Query String sqlStr such that all the fields will be displayed for the records that indicate a speed less than two and a memory value less than four. The returned records should be sorted by Room_Num. (Points : 14) sqlStr = "SELECT * FROM Computers WHERE (( Speed < 2) And (Computers.Memory < 4)) ORDER Room_Num;" [Show More]
Last updated: 2 years ago
Preview 1 out of 6 pages
Buy this document to get the full access instantly
Instant Download Access after purchase
Buy NowInstant download
We Accept:
Can't find what you want? Try our AI powered Search
Connected school, study & course
About the document
Uploaded On
May 05, 2022
Number of pages
6
Written in
This document has been written for:
Uploaded
May 05, 2022
Downloads
0
Views
96
In Scholarfriends, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.
We're available through e-mail, Twitter, Facebook, and live chat.
FAQ
Questions? Leave a message!
Copyright © Scholarfriends · High quality services·