input
process assignment output |
tax_rate
StudentName 2012budget None of the above |
Rectangle
Diamond Parallelogram Lozenge |
Integer
Real String Any of the above |
Desk-checking
Flowcharts Pseudocode Hierarchy charts |
Addition
Multiplication Subtraction All have equal precedence. |
b = -b
x – 6 = a a = a + 1 None of the above |
1
22 4 None of the above |
rep = 0
rep = rep + 1 rep = rep + x rep = rep + 10 |
both conditions must be false
both conditions must be true either condition can be false either condition can be true |
total = price
total = quantity * price total = quantity + price total = quantity |
the IF path executes
the ELSE path executes 10 (x > 10) AND (x < 20)=""> |
5
0 10 1 |
1. (TCOs 2,4, 5, and 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 15 have a 5% sales tax. The 16–30 codes have a sales tax of 6%. Codes above 30 have a sales tax of 7%. The purchase amount and county code are entered by the user. Use a loop to validate that the county code is between 8 and 40. Display the amount of the sales tax and the total. (Points : 20)
Question 2.2. (TCOs 3, 4, and 8) In the following pseudocode, which raise will an employee in Department 6 receive?
If department < 2=""> Set raise = 1000 Else If department < 6=""> Set raise = 2500 Else Set raise = 3000 EndIf EndIf (Points : 5) |
1,000
2,500
3,000
0
2,500
3,000
0
Question 3.3. (TCOs 3 and 4) Which of the selection structures determine whether the user enters any number other than 25?
(Points : 5) |
If commission <> 25
If commission <=>
If (commission >= 20) && (commission <>
If (commission >=20) || (commission <= 25)="">
If commission <=>
If (commission >= 20) && (commission <>
If (commission >=20) || (commission <= 25)="">
Question 4.4. (TCOs 3, 4, and 8) Which value gets displayed for the variable Z?
Set balance = 700 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 (Points : 5) |
3
2
6
7
2
6
7
Question 5.5. (TCO 5) The variable used in the expression controlling the loop is known as the _____.
(Points : 5) |
loop control variable
loop iterations
loop expression variable
loop body
loop iterations
loop expression variable
loop body
Question 6.6. (TCO 5) A FOR loop is considered what type of loop?
(Points : 5) |
A counted loop
A post-test loop
An event-controlled loop
A selection structure
A post-test loop
An event-controlled loop
A selection structure
Question 7.7. (TCO 5) In the following code, how many times will the loop body be executed?
int num; for (num = 10; num <= 20;num+=""> { Console.WriteLine(num); } (Points : 5) |
0
3
4
6
3
4
6
Question 8.8. (TCOs 3, 5, and 8) In the following code, how many times will the loop body be executed?
int x=1; while(x<> { Console.WriteLine(x); x = x + 1; } (Points : 5) |
0
1
6
7
1
6
7
Question 9.9. (TCO 6) Which is an array element?
(Points : 5) |
A specific value in an array
An alternate name for an array
A number that indicates the position of a particular item within an array
A number that represents the highest value stored within an array
An alternate name for an array
A number that indicates the position of a particular item within an array
A number that represents the highest value stored within an array
Question 10.10. (TCO 6) Which is the value of the index used to access the last element in a C# array declared as the following?
int[] num = new int[10]; (Points : 5) |
0
9
10
9
10
11
for (int index = 1; index <4;>
for (int index = 0; index <6;> for (int index = 1; index <5;> for (int index = 0; index <5; index++)=""> |
100
1100 3400 100, 1100 |
Syntax error
Runtime error Logic error No error |
A sub procedure is a procedure that performs actions.
A function procedure is a procedure that performs actions. A sub procedure returns a value to the point from which it was called. A function procedure returns a value to the point from which it was called. |

Комментариев нет:
Отправить комментарий