(TCO 1) Displaying data on the screen is considered a(n) _____ operation
(TCO 2) Which statement is not true about variable names
(TCO 3) The statement below would be placed within what symbol on a flowchart?
balance < 1000="">
balance < 1000="">
(TCO 2) Set rate = 15.50 is a process. What data type would you expect the variable, rate, to have
(TCO 3) Which is not one of the three basic control structures used in programming
(TCO 2) When an expression includes relational, logical, and arithmetic operators, which type of operator is evaluated last
(TCOs 2, 7) What is the problem with the following assignment statement, given that grade is an integer variable
(TCO 2) What value will be contained in the variable x after the following statement is executed?
(TCO 2) The statement below indicates that the variable rep is being used as a(n) _____.
rep = rep + num
rep = rep + num
(TCO 4) For the following expression to be true, _____.
condition1 OR condition2
condition1 OR condition2
(TCOs 2, 7, 8) Review the partial pseudocode below. What is the correct math expression to complete the algorithm and calculate 50% of a cost?
Prompt “Enter total cost: “
Input cost
Set _____
Display “50% of the cost is: “ + total
Prompt “Enter total cost: “
Input cost
Set _____
Display “50% of the cost is: “ + total
(TCOs 3, 4, 8) Review the pseudocode below. What will be displayed when this algorithm executes?
Set x = 20
If ((x > = 10) AND (x < 20))="">
Display “the IF path executes”
Else
Display “the ELSE path executes”
EndIf
Set x = 20
If ((x > = 10) AND (x < 20))="">
Display “the IF path executes”
Else
Display “the ELSE path executes”
EndIf
(TCOs 3, 4, 8) What value gets displayed for the variable X?
Set A = 6
Set B = 10
Set C = 15
If (B < 15)="" and="" ((a="5)" or="" (c=""><= 15))="">
Set X = 1
Else
Set X = 0
EndIf
Display X
Set A = 6
Set B = 10
Set C = 15
If (B < 15)="" and="" ((a="5)" or="" (c=""><= 15))="">
Set X = 1
Else
Set X = 0
EndIf
Display X
(TCOs 3, 4, 8) In the following pseudocode, what raise will an employee in Department 5 receive?
If department < 3="">
Set raise = 25
Else
If department < 5="">
Set raise = 50
Else
Set raise = 75
EndIf
EndIf
If department < 3="">
Set raise = 25
Else
If department < 5="">
Set raise = 50
Else
Set raise = 75
EndIf
EndIf
(TCOs 3, 4) Which of the selection structures determines whether the user enters a number outside a range of 5 and 15
(TCOs 3, 4, 8) What value gets displayed for the variable Z?
Set balance = 800
Set stateCode = 6
Set creditCode = 7
If (balance <> 800) OR (stateCode<> 6) OR (creditCode<> 7) then
Set Z = 3
Else
Set Z = 2
EndIf
Display Z
Set balance = 800
Set stateCode = 6
Set creditCode = 7
If (balance <> 800) OR (stateCode<> 6) OR (creditCode<> 7) then
Set Z = 3
Else
Set Z = 2
EndIf
Display Z
(TCO 5) What happens when the loop control variable is not changed within the loop body?
(TCO 5) In Visual Basic, which of the following statements is false
(TCO 5) In the following code, how many times will the loop body be executed
(TCOs 3, 5, 8) In the following code, how many times will the loop body be executed?
Dim x as Integer
x = 10
While x <=>
Console.Writeline(x)
x = x + 1
End While
Dim x as Integer
x = 10
While x <=>
Console.Writeline(x)
x = x + 1
End While
(TCO 6) Suppose you have an array named number, and two of its elements are number(1) and number(4). You know that _____.
(TCO 6) What is the value of the index used to access the last element in a Visual Basic array declared as?
Dim num(12) As Integer
Dim num(12) As Integer
(TCOs 5, 6) Which loop would be used to process each element of an array declared as the following?
(TCO 6) A zero-based array named sales has been declared and loaded with the values 100, 1100, 3400, 5550, 3000, 22300, 1200. What value(s) will be stored in the array element sales(2)?
(TCOs 7, 8) What type of error occurs when a program successfully executes but produces incorrect results?
(TCOs 3, 8) Execution of your program in Visual Basic starts with the _____ module
(TCOs 2, 3, 8) Your program will read in a tax rate as a percentage (i.e., input 8 for 8%) and the prices of three items. The program is to calculate the total price (before tax) of the items, the tax payable on those items (using the specified tax rate), and the total amount of the sale including tax. Print the total price (before tax), the amount of tax, and the total amount of the sale as output
(TCOs 3, 4, 8) PART 1 (10 points): A department store is having a customer appreciation sale. Depending on the total dollars purchased, the customer could receive a discount on his or her total purchases. You are to develop pseudocode that will obtain the total dollars purchased from the user, determine the discount percentage, and display the total amount due. When the purchases are more than $500, the discount is 10%. When the purchases are $500 or less, the discount is 6%.
(TCOs 4, 5, 8) Write a program to input a purchase amount and calculate the sales tax and total due. The sales tax depends on the county identifying code. Counties with a number less than 10 have a 6% sales tax. The 11–25 codes have a sales tax of 7%. Codes above 25 have a sales tax of 8%. The purchase amount and county code are entered by the user. Use a loop to validate that the county code is between 1 and 30. Display the amount of the sales tax and the total
(TCOs 5, 8) Write a Visual Basic loop that counts up from 5 to 100 by 5s
(TCOs 5, 6, 8) Review the following scenario and complete the design:
Scenario
You have been asked by the Payroll department to create a program that will calculate the weekly pay for the company’s 30 employees. The employee names and pay will be stored in arrays. The program will prompt the user to provide each employee’s full name, hourly pay rate, and hours worked. The program will then ask whether the employee is single or married. If an employee is married, the tax rate is 25%; if he or she is single, the tax rate is 20%. Also, if the employee worked more than 40 hours in a week, the number of hours greater than 40 is paid a rate 1.5 times the pay rate.
After all data are input and calculated, the program will display a payroll report with a list of all the employee names and weekly pay. In addition, the program will display the total payroll for the week and the average weekly pay.
Scenario
You have been asked by the Payroll department to create a program that will calculate the weekly pay for the company’s 30 employees. The employee names and pay will be stored in arrays. The program will prompt the user to provide each employee’s full name, hourly pay rate, and hours worked. The program will then ask whether the employee is single or married. If an employee is married, the tax rate is 25%; if he or she is single, the tax rate is 20%. Also, if the employee worked more than 40 hours in a week, the number of hours greater than 40 is paid a rate 1.5 times the pay rate.
After all data are input and calculated, the program will display a payroll report with a list of all the employee names and weekly pay. In addition, the program will display the total payroll for the week and the average weekly pay.
Write a program using Visual Basic, prompt the user for the appropriate input, and display the output as described above. You may assume all data are valid. Provide a program introduction message that tells the user how to use the program
Комментариев нет:
Отправить комментарий