пятница, 22 апреля 2016 г.

CIS 115 Final Exam


1. (TCO 1) Receiving information from the user is considered a(n) _____ operation.
(Points : 5)
input
process

assignment
output
Question 2.2. (TCO 2) Which variable name is invalid?
(Points : 5)
tax_rate
StudentName
2012budget
None of the above
Question 3.3. (TCO 3) Which symbol is used in a flowchart for both selection and repetition?
(Points : 5)
Rectangle
Diamond
Parallelogram
Lozenge
Question 4.4. (TCO 2) Set course = “CIS115” is a process. Which data type would you expect the course variable to have?
(Points : 5)
Integer
Real
String
Any of the above
Question 5.5. (TCO 3) Which tool is used by developers to depict the relationship between modules?
(Points : 5)
Desk-checking
Flowcharts
Pseudocode
Hierarchy charts
Question 6.6. (TCO 2) When a program evaluates mathematical expressions, which of the following operators (or mathematical operations) has the highest precedence?
(Points : 5)
Addition
Multiplication
Subtraction
All have equal precedence.
Question 7.7. (TCOs 2, 7) Which one of the following is not a valid assignment statement in a program?
(Points : 5)
b = -b
x – 6 = a
a = a + 1
None of the above
Question 8.8. (TCO 2) Which value will be contained in the variableafter the following statement is executed?
= 2 + 8 / 2 * 5
(Points : 5)
1
22
4
None of the above
Question 9.9. (TCO 2) Which statement indicates that the variablerep is being used as an accumulator?
(Points : 5)
rep = 0
rep = rep + 1
rep = rep + x
rep = rep + 10
Question 10.10. (TCO 4) For the following expression to be false, _____.
condition1 OR condition2
(Points : 5)
both conditions must be false
both conditions must be true
either condition can be false
either condition can be true
Question 11.11. (TCOs 2, 7, and 8) Review the partial pseudocode below. Which is the correct math expression to complete the algorithm and calculate the total sale?

Prompt “Enter quantity purchased: “
Input quantity
Prompt “Enter price each: “
Input price
Set _____
Display “total price: “ + total

(Points : 5)
total = price
total = quantity * price
total = quantity + price
total = quantity
Question 12.12. (TCOs 3, 4, and 8) Review the pseudocode below. Which will be displayed when this algorithm executes?

Set x = 11
If ((x > 10) AND (x < 20))="">
Display “the IF path executes”
Else
Display “the ELSE path executes”
EndIf
(Points : 5)
the IF path executes
the ELSE path executes
10
(x > 10) AND (x < 20)="">
Question 13.13. (TCOs 3, 4, and 8) Which value gets displayed for the variable X?
Set A = 6
Set B = 10
Set C = 20
If (B > 15) OR (A = 5) OR (C <= 15)="" then="">
Set X = 1
Else
Set X = 0
EndIf
Display X
(Points : 5)
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
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)="">
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
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
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
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
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
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
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
11
Question 11.11. (TCOs 5 and 6) Which loop would be used to process each element of an array declared as the following?

int[] nums = new int[5];
(Points : 5)
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++)="">
Question 12.12. (TCO 6) A zero-based array named sales has been declared and loaded with the values 100, 1100, 3400, 5550, 3000, 22300, and 1200. Which value(s) will be stored in the array element sales[0]?
(Points : 5)
100
1100
3400
100, 1100
Question 13.13. (TCOs 7 and 8) Using this statement in C# to output the value of the variable num will result in which type of error?
WriteLine.Console(num);
(Points : 5)
Syntax error
Runtime error
Logic error
No error
Question 14.14. (TCOs 3 and 8) Which of the following statements is not true?
(Points : 5)
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.
  • In stock

Комментариев нет:

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