Name:     ID: 
 
Email: 

COSC 2328 Ch 13 Quiz

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

 1. 

All computer programs are written using one or more of three control structures: sequence, selection, or repetition.
 

 2. 

A repetition structure can only be a pretest loop.
 

 3. 

A condition can contain variables, constants, properties, methods, or operators.
 

 4. 

Like the condition in the If…Then…Else statement, the condition in the Do…Loop statement must evaluate to a Boolean value.
 

 5. 

The loop condition is represented by a parallelogram in a flowchart.
 

 6. 

Like counter variables, accumulator variables are assigned a value inside the loop.
 

 7. 

Like counter variables, accumulator variables are updated outside the loop.
 

 8. 

Repetition structures use accumulator variables to tally information such as the total dollar amount of a week’s payroll.
 

 9. 

The priming read is used to prime (prepare or set up) a loop.
 

 10. 

The value returned by the InputBox function is the same whether the user clicks the OK button, Cancel button, or Close button.
 

 11. 

The Windows standard is to use book title capitalization for the prompt, but sentence capitalization for the title.
 

 12. 

Any code containing a priming read must also include a matching read within the loop.
 

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

 13. 

Programmers use the ____ structure when they need the computer to repeatedly process one or more program instructions until some condition is met, at which time the repetition structure ends.
a.
decision
c.
selection
b.
repetition
d.
declaration
 

 14. 

In a(n) ____ loop, the loop condition is evaluated before the instructions within the loop are processed.
a.
pretest
c.
inline test
b.
posttest
d.
execute
 

 15. 

In a(n) ____ loop, the evaluation occurs after the instructions within the loop are processed.
a.
pretest
c.
execute
b.
inline test
d.
posttest
 

 16. 

You can use the ____ statement to code both a pretest loop and a posttest loop.
a.
For…Next
c.
Next…For
b.
While…Wend
d.
Do…Loop
 

 17. 

A(n) ____ variable is a numeric variable used for adding something together.
a.
static
c.
accumulator
b.
named
d.
counter
 

 18. 

If the user clicks the OK button, the InputBox function returns ____.
a.
an empty string
b.
the value contained in the input area of the dialog box
c.
OKValue
d.
Nothing
 

 19. 

If the user clicks either the Cancel button in the dialog box or the Close button on the dialog box’s title bar, the InputBox function returns ____.
a.
an empty string
b.
the value contained in the input area of the dialog box
c.
CancelValue
d.
nothing
 

 20. 

The empty string is represented by the ____ constant in Visual Basic.
a.
Nothing
c.
String.Empty
b.
String.Nothing
d.
Empty.String
 

 21. 

When entering the InputBox function in the Code Editor window, the prompt, title, and defaultResponse arguments must be enclosed in ____.
a.
quotation marks
c.
square brackets
b.
asterisks
d.
slashes
 

 22. 

The syntax for the InputBox function is ____.
a.
InputBox(prompt[ , title][ , defaultResponse])
b.
Input Box(prompt[ , title][ , defaultResponse])
c.
InputBox[prompt( , title)( , defaultResponse)]
d.
InputBox(prompt, title, defaultResponse)
 

 23. 

In a loop that begins with a priming read, the ____ provides the way to end a loop.
a.
priming read
c.
ending read
b.
matching read
d.
special read
 

 24. 

The result of forgetting to enter the matching read is a(n) ____ loop.
a.
empty
c.
infinite
b.
temporary
d.
short-circuited
 

 25. 

A ____ error is an error that occurs while an application is running.
a.
logic
c.
syntax
b.
compilation
d.
runtime
 



 
         Start Over