Name:     ID: 
 
Email: 

C# Quiz 3

Multiple Choice
Identify the choice that best completes the statement or answers the question.
 

 1. 

When you declare an object, what are the character fields set to?
a.
‘ ‘
c.
0
b.
null
d.
false
 

 2. 

What is a garbage value in the C# programming language?
a.
It is an unknown, unassigned value.
c.
It is a variable that holds output text after it is displayed.
b.
It is a variable that is used as a placeholder.
d.
It is a variable that is assigned a value that has no purpose.
 

 3. 

What operator is used for the purpose of creating objects in C#?
a.
new
c.
reserve
b.
initialize
d.
save
 

 4. 

What type of loop allows you to indicate the starting value for the loop control variable, the test condition that controls loop entry, and the expression that alters the loop control variable, all in one convenient place?
a.
repeat
c.
while
b.
for
d.
do
 

 5. 


What can be used to distinguish each element from the others in an array?
a.
an element operator
c.
an object location
b.
a subscript
d.
an element ID
 

 6. 

What C# method should you use in order to arrange an array in ascending order?
a.
BinarySearch()
c.
Sort()
b.
Reverse()
d.
Order()
 

 7. 

Totals that are summed one at a time in a loop are known as what type of totals?
a.
incremented
c.
decremented
b.
derived
d.
accumulated
 

 8. 

When using nested loops, what loop is contained entirely within an outer loop?
a.
for loop
c.
inner loop
b.
pretest loop
d.
posttest loop
 

 9. 

What will be the highest subscript value possible for an array with 15 elements?
a.
17
c.
14
b.
16
d.
15
 

 10. 

An array subscript can be an expression, but only as long as the expression evaluates to what type?
a.
boolean
c.
float
b.
double
d.
int
 

 11. 

You are writing a program that defines a variable within a loop, and then tries to use that variable outside the loop. However, the program does not run as intended. What is the issue?
a.
The variable is being overwritten inside the loop.
c.
The variable is declared with an incorrect type.
b.
The variable name conflicts with a built in keyword.
d.
The variable is limited to the scope of the loop.
 

 12. 

What technique can be used to combine two different loops into one?
a.
pretesting loop
c.
loop fusion
b.
short-circuiting loop
d.
loop accumulation
 

 13. 

What can you use to assign a list of nondefault values to array elements at declaration?
a.
initializer list
c.
array specification
b.
array initializer
d.
value specification
 

 14. 

A loop that is controlled by user input rather than altered by arithmetic is known as what type of loop?
a.
sentinel
c.
indefinite
b.
infinite
d.
definite
 

 15. 

What type of loop checks a Boolean expression at the "top" of the loop before the body has a chance to execute?
a.
while
c.
switch
b.
repeat
d.
do
 

True/False
Indicate whether the statement is true or false.
 

 16. 

When loop structures are nested, the inner loop must be entirely contained within the outer loop; loops can never overlap.
 

 17. 

In C#, arrays are objects.
 

 18. 

You cannot use a while loop for indefinite loops.
 

 19. 

When you instantiate an array, you can choose its location in memory.
 

 20. 

You can improve loop performance by using prefix incrementing.
 

 21. 

In C#, an array's elements are numbered beginning with 1.
 

 22. 

A Boolean expression is evaluated within every while loop to determine whether the loop body will execute.
 

 23. 

The power of arrays becomes apparent when you use subscripts that are variables rather than constant values.
 

 24. 

Statements in a for loop body cannot be blocked.
 

 25. 

Arrays are useful when you need to store just one value in memory at a time.
 



 
         Start Over