Exam 4: Performing Loops
Exam 1: An Overview of Object-Oriented Programming and C++55 Questions
Exam 2: Evaluating C Expressions51 Questions
Exam 3: Making Decisions50 Questions
Exam 4: Performing Loops51 Questions
Exam 5: Understanding Arrays, Strings and Pointers55 Questions
Exam 6: Using C++ Functions51 Questions
Exam 7: Using Classes56 Questions
Exam 8: Class Features and Design Issues53 Questions
Exam 9: Understanding Friends and Overloading Operators52 Questions
Exam 10: Understanding Inheritance53 Questions
Exam 11: Using Templates54 Questions
Exam 12: Handling Exceptions51 Questions
Exam 13: Advanced Input and Output55 Questions
Exam 14: Advanced Topics53 Questions
Select questions type
Match each term with the correct statement below.
Premises:
contains sections that initialize, evaluate, and alter a loop control variable
Responses:
while loop
pretest loop
sentinel value
Correct Answer:
Premises:
Responses:
Free
(Matching)
4.7/5
(41)
Correct Answer:
What types of mistakes are easy to make when working with loops?
Free
(Essay)
4.7/5
(26)
Correct Answer:
Whether you are first learning to use repetition statements or you are an experienced programmer, it is easy to make several types of mistakes:
- Adding an unwanted semicolon
- Forgetting curly braces
- Failing to alter a loop control variable
- Failing to initialize a loop control variable
- Making the same types of mistakes you can make with selections, including forgetting that C++ is case sensitive, assuming indentation has a logical purpose, using = instead of ==, and using the AND operator when you intended to use the OR operator,
The following loop will execute ____ time(s).
Number = 1;
While(number
Free
(Multiple Choice)
4.8/5
(32)
Correct Answer:
D
A ____ loop is one that must execute a specific number of times.
(Multiple Choice)
4.9/5
(30)
When you write a loop, what actions must be taken with the loop control variable?
(Essay)
4.7/5
(47)
The segment of code shown below displays "Hello!" ____ times:
Int count;
Const int NUM_LOOPS = 5;
Count = 0;
While( count
(Multiple Choice)
4.9/5
(30)
If you fail to initialize a loop control variable, C++ will automatically assign a value of 0 to the variable.
(True/False)
4.8/5
(42)
In C++, a(n) ____ has an unknown value and is of no practical use.
(Multiple Choice)
4.9/5
(45)
In the following segment of code,
Number = 1;
While(number
The body of the loop is ____.
(Multiple Choice)
4.8/5
(35)
Many programmers recommend that you initialize every variable in your programs.
(True/False)
4.9/5
(40)
A(n) ____________________ loop is one in which the loop control variable is tested after the loop body executes.
(Short Answer)
4.8/5
(32)
Match each term with the correct statement below.
Premises:
contains the statements that execute within a loop
Responses:
loop control variable
while loop
iterator
Correct Answer:
Premises:
Responses:
(Matching)
4.7/5
(33)
In most C++ compilers you can stop an infinite loop from executing by pressing the Ctrl + ____________________ or Ctrl + Break keys.
(Short Answer)
4.8/5
(39)
To create a loop that executes at least one time, you should use a ____ loop.
(Multiple Choice)
4.8/5
(40)
Totals are ____________________ by processing individual records one at a time in a loop and adding numeric data to a total.
(Short Answer)
4.8/5
(49)
A priming _________________________ is an input statement that initializes a variable before a loop begins.
(Essay)
4.8/5
(38)
Showing 1 - 20 of 51
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)