Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hello. Im trulely, truely in despirate need of answers to some questions i have.

ID: 3692529 • Letter: H

Question

Hello. Im trulely, truely in despirate need of answers to some questions i have. If possible can i please, please get these answers back to me within the hour. I would truely appreceiate it.

1. Assuming that you are connected to a database table called Computers with the fields Computer, Hostname Room_Num, CPU_Type, Num_CPUs, Bit_Size, Speed, OS_Type, Memory, and HDD_Size. write the SQL Query String sqlStr such that all the fields will be displayed for the records that indicate a speed greater than 2 and a memory value greater than 4. The returned records should be sorted by OS_Type.

2. Write the VBScript code lines that perform the following tasks: Define a variable age that is initialized to 35. Display a message that uses the variable to display Your age is 35, but 10 years ago, you were 25. Note: The value 25 is calculated from the variable age. Also note the period at the end of the displayed output.

3. Given the variables hoursWorked and payRate, write the VBScript code that will calculate grossPay such that all hoursWorked above 40 hours will be paid at time and a half.

4. Write a VBScript function called GetName( ) that prompts the user to input his or her name and returns the name value. Use the StdIn and StdOut streams for input and output.

5. Write the NETSH command that will set the IP address of the interface name “NIC” to 192.168.100.10 255.255.255.0 with a default-gateway of 192.168.100.1 and a metric of 1.

6. Write the Windows CLI command that will map the network share called PublicData on FileServer1 to the X: drive for the user netuser with a password of netpass.

Explanation / Answer

1. Assuming that you are connected to a database table called Computers with the fields Computer, Hostname Room_Num, CPU_Type, Num_CPUs, Bit_Size, Speed, OS_Type, Memory, and HDD_Size. write the SQL Query String sqlStr such that all the fields will be displayed for the records that indicate a speed greater than 2 and a memory value greater than 4. The returned records should be sorted by OS_Type.

sqlStr = "SELECT Computer, Room_Num, and OS_TypeFROMComputers WHERE (OS_Type= “Fedora 10”OROS_Type= “WindowsXP.”)ORDER BY Computers. OS_Type;"

2. Write the VBScript code lines that perform the following tasks: Define a variable age that is initialized to 35. Display a message that uses the variable to display Your age is 35, but 10 years ago, you were 25. Note: The value 25 is calculated from the variable age. Also note the period at the end of the displayed output.

ageStr = "35"
ageStr10 = CStr( CInt(ageStr)-10)
WScript.StdOut.WriteLine("Your Age is " &vbTab &vbTab &ageStr "but ten years ago, you were" &vbTab &vbTab &ageStr10)

3. Given the variables hoursWorked and payRate, write the VBScript code that will calculate grossPay such that all hoursWorked above 40 hours will be paid at time and a half.

Dim payRate

Dim hoursWorked

Dim grossPay

payRate = InputBox("Enter the pay Rate :")

hoursWorked = InputBox("Enter the hours worked :")

if hoursWorked> 40 then

grossPay = 40 * payRate + (hoursWorked - 40) * 1.5 * payRate

else

grossPay = hoursWorked * payRate

End if

MsgBox "Gross Pay

4. Write a VBScript function called GetName( ) that prompts the user to input his or her name and returns the name value. Use the StdIn and StdOut streams for input and output.

Sample VBScript Code:

strUserInput = GetUserInput( "Please enter your name:" )
WScript.Echo "Your name is: " & strUserInput

5. Write the NETSH command that will set the IP address of the interface name “NIC” to 192.168.100.10 255.255.255.0 with a default-gateway of 192.168.100.1 and a metric of 1.

netsh interface ip set address “NIC” source=static 192.168.100.10 255.255.255.0 192.168.100.1 1