PDF Download
FREE AND STUDY GAMES ABOUT STACK #4119023 EXAM
QUESTIONS
Actual Qs and Ans Expert-Verified Explanation
This Exam contains:
-Guarantee passing score -79 Questions and Answers -format set of multiple-choice -Expert-Verified Explanation Question 1: A statement that may be used to stop a loop's current iteration and begin the next one is
Answer:
continue Question 2: Which of the following functions tells the cin object to skip one or more characters in the keyboard buffer?
Answer:
cin.ignore Question 3: Which of the following statements will pause the screen until the [Enter] key is pressed?
Answer:
cin.get();
Question 4: A special value that marks the end of a list of values is a
Answer:
sentinel
Question 5: Something within a while loop must eventually cause the condition to become false or a(n) ________ results.
Answer:
infinite loop Question 6: The ________ causes a program to wait until information is typed at the keyboard and the [Enter] key is pressed.
Answer:
cin object Question 7: In C++ you are required to name your variables so they indicate the purpose they will be used for.
Answer:
False
Question 8: The preprocessor executes after the compiler.
Answer:
False
Question 9: What is the value of average after the following code executes?
double average; average = 1.0 + 2.0 + 3.0 / 3.0;
Answer:
4.0 Question 10: An initialization expression may be omitted from the for loop if no initialization is required.
Answer:
True Question 11: Multiple relational expressions cannot be placed into the test condition of a for loop.
Answer:
True
Question 12: What will the following code display?
int x = 23, y = 34, z = 45; cout << x << y << z << endl;
Answer:
233445
Question 13: Data items whose values do NOT change while the program is running are
Answer:
literals Question 14: The statements in the body of a while loop may never be executed while the statements in the body of a do-while loop will be executed
Answer:
at least once Question 15: How many characters will the following statement read into the variable myString?cin >> setw(10) >> myString;
Answer:
9 Question 16: Without this statement appearing in a switch construct, the program "falls through" all of the statements below the one with the matching case expression.
Answer:
break
Question 17: In the following statement, which operator is used first?
while (x++ < 10)
Answer:
<
Question 18: What will the following code display?
int number = 6; cout << ++number << endl;
Answer:
7
Question 19: Which of the following must be included in any program that uses the cout object?
Answer:
the header file iostream Question 20: In a cout statement, which of the following will advance the output position to the beginning of the next line?
Answer:
endl or Question 21: A debugging process where you, the programmer, pretend you are a computer and step through each statement while recording the value of each variable at each step is known as
Answer:
hand tracing Question 22: Which of the following will allow the user to input the values 15 and 20 and have them stored in variables named base and height, respectively?
Answer:
cin >> base >> height; Question 23: The default section of a switch statement performs a similar task similar to the ________ portion of an if/else if statement.
Answer:
trailing else Question 24: Select all that apply. Which of the following statements is(are) TRUE about named constants?
Answer:
The content of a named constant is read-only.
A named constant is defined using the const qualifier.
The value of a named constant cannot be changed while the program is running.Question 25: ________ reads a line of input, including leading and embedded spaces, and stores it in a string object.
Answer:
getline