C# quiz 5

Ace your homework & exams now with Quizwiz!

What keywords should you use to initiate a for-loop in C#?

for

step value

The amount by which a loop control variable changes on each cycle

scope

The area of a program in which a variable or named constant is known and can be used

do loop

checks at the "bottom" of the loop after the first iteration

What should an accumulator variable be set to before it is used to accumulated a total?

0

What are the block of statements that are executed in a loop considered to be part of?

A loop body

empty body

A loop body with no statement in it

infinite loop

A loop that (theoretically) never ends.

for loop

A shorthand structure for programming a definite loop

loop control variable

A variable that controls the execution of a while loop

outer loop

Contains an inner loop when loops are nested

A bug has resulted in your program executing at infinite loop. What key can be pressed in conjunction with the C or Break(pause) key to escape the loop?

Ctrl

You cannot use a while loop for indefinite loops?

False

garbage

The value of an uninitialized variable

You can improve loop performance by using prefix incrementing?

True

Totals that are summed one at a time in a loop are known as what type of totals?

accumulated

counted loop

another name for a definite loop

Loops that are controlled by reducing a variable are utilizing what type of loop control variable?

decrementing

What type of loop checks a Boolean expressions at the "bottom" of the loop after each repetition has occurred?

do loop

What type of loop allows you to indicate the starting value of for the control loop variable, the test condition that controls loop entry, and the expression that alters the loop control variable all in one convenient place?

for loop

A value such as a 'Y' pr 'N' that must be supplied in order to stop a loop is known as what type of value?

sentinel value

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?

the variable is limited to the scope of the loop


Related study sets

Ch. 32 Evolution & Diversity of Modern Gymnosperms & Angiosperms

View Set

Senior Seminar - Module 9: Monitoring for Health Problems

View Set