Services
Discover
Homeschooling
Ask a Question
Log in
Sign up
Filters
Done
Question type:
Essay
Multiple Choice
Short Answer
True False
Matching
Topic
Computing
Study Set
Starting Out with C++
Quiz 4: Making Decisions
Path 4
Access For Free
Share
All types
Filters
Study Flashcards
Practice Exam
Learn
Question 1
True/False
As a rule of style, when writing an if statement you should indent the conditionally-executed statements.
Question 2
True/False
If the expression on the left side of the following is true, the expression on the right side will not be checked. (a > = b) || (c == d)
Question 3
Multiple Choice
Whereas < is called a relational operator, x < y is called a(n)
Question 4
True/False
The following code correctly determines whether x contains a value in the range of 0 through 100, inclusive. if (x > 0 && <= 100)
Question 5
Multiple Choice
Relational operators allow you to __________ numbers.
Question 6
True/False
The value of result in the following expression will be 0 if x has the value of 12. result = x > 100 ? 0 : 1;
Question 7
Multiple Choice
What is assigned to the variable result given the statement below with the following assumptions: X = 10, y = 7, and x, result, and y are all int variables. Result = x >= y;
Question 8
Multiple Choice
After the following code executes, what is the output if user enters 0? int x = -1; cout << "Enter a 0 or 1: "; cin >> x; if (c)
\quad
cout << "true" << endl; else
\quad
cout << "False" << endl;
Question 9
True/False
You should be careful when using the equality operator to compare floating point values because of potential round-off errors.
Question 10
True/False
Both of the following if statements perform the same operation. 1. if (sales > 10000)
\quad
\quad
commissionRate = 0.15; 2. if (sales > 10000) commissionRate = 0.15;
Question 11
Multiple Choice
When a relational expression is False, it has the value
Question 12
True/False
An expression that has any value other than 0 is considered true by an if statement.
Question 13
Multiple Choice
The __________ is an equality (or comparison) operator.
Question 14
True/False
The default section is required in a switch statement.
Question 15
True/False
The conditional operator takes two operands.
Question 16
Multiple Choice
What is the output of the following code segment if the user enters 90 for the score? Cout << "Enter your test score: "; Cin >> test_score; If (test_score < 60) Cout << "You failed the test." << endl; If (test_score > 60) Cout << "You passed the test." Else Cout << "You need to study harder next time." << endl;
Question 17
True/False
If the expression on the left side of the following is False, the expression on the right side will not be checked. (a > = b) && (c == d)
Question 18
Multiple Choice
After the following code executes, what is the value of my_value if the user enters 0? Cin >> my_value; If (my_value > 5) My_value = my_value + 5; Else if (my_value > 2) My_value = my_value + 10; Else My_value = my_value + 15;