Exam 5: Making Decisions
Exam 1: Introduction to Computing and Programming75 Questions
Exam 2: Data Types and Expressions75 Questions
Exam 3: Methods and Behaviors75 Questions
Exam 4: Creating Your Own Classes75 Questions
Exam 5: Making Decisions75 Questions
Exam 6: Repeating Instructions75 Questions
Exam 7: Arrays75 Questions
Exam 8: Advanced Collections74 Questions
Exam 9: Introduction to Windows Programming75 Questions
Exam 10: Programming Based on Events75 Questions
Exam 11: Advanced Object-Oriented Programming Features75 Questions
Exam 12: Debugging and Handling Exceptions75 Questions
Exam 13: Working With Files75 Questions
Exam 14: Working With Databases75 Questions
Exam 15: Web-Based Applications73 Questions
Select questions type
The conditional operator, also called the ____________ provides another way to express a simple if...else selection statement.
(Short Answer)
4.9/5
(81)
When strings are compared, the first character in the first operand is compared against the first character in the second operand.
(True/False)
4.8/5
(77)
When you have a single variable being tested for equality against four or more values, a one-way selection statement is the most appropriate type of conditional expression to use.
(True/False)
4.8/5
(82)
With an if statement, when you place a semicolon on the line that has the conditional expression, you create a null (empty) statement body for the true portion of the if statement.
(True/False)
4.9/5
(72)
How can the compound conditional expression ((average > 79 && average <= 89)) be written to eliminate the logical operator - without changing the logic?
(Multiple Choice)
4.9/5
(73)
Forms of the if statement include one-way, two-way, ____________, multiway, and compound.
(Short Answer)
4.9/5
(76)
Boolean variables store 0 to represent off or false and 1 to represent on or true.
(True/False)
4.8/5
(76)
With a two-way if statement, either the true statement(s) is (are) executed or the false statement(s), or both.
(True/False)
4.8/5
(84)
if (amount > 1000)
result = 1;
Else
if (amount > 500)
result = 2;
else
if (amount > 100)
result = 3;
else
result = 4;
Using the above code segment, w hat is stored in result when amount is equal to 876?
(Multiple Choice)
4.7/5
(92)
Assignment operators appear at the top of the hierarchy in the operator precedence table.
(True/False)
4.8/5
(88)
Which of the following statements regarding curly braces is NOT correct as they relate to their use with an if statement?
(Multiple Choice)
4.8/5
(86)
Equality comparisons with floating-point and decimal types often produce unpredictable results.
(True/False)
4.8/5
(76)
A comparison to determine whether the uppercase character S is less than the uppercase character W produces false.
(True/False)
4.7/5
(79)
if (a > 10)
if (b > 10)
if (c > 10)
result = 1;
else
if (b > 100)
result = 2;
else
Result = 3;
else
result = 4;
else
result = 5;
What is stored in result when a is equal to zero, b and c are equal to 100?
(Multiple Choice)
4.9/5
(79)
A company issues $5,000.00 bonuses at the end of the year to all employees who earn less than $100,000. Salary and bonus are both defined as double data types. Which of the following selection statements would assign the correct amount to bonus?
(Multiple Choice)
4.8/5
(89)
switch (phoneDigit)
{
case 1: num = 1;
break;
case 2: num = 2;
break;
case 3: num = 3;
break;
case 4: num = 4;
break;
default: num = 0;
break;
}
Looking at the example above, when phoneDigit has a value of 'Q', what value is stored in num?
(Multiple Choice)
4.8/5
(64)
Relational operators allow you to test variables to see if one is greater or less than another variable or value.
(True/False)
4.9/5
(80)
____________ operators allow you to test variables to see if one is greater or less than another variable or value.
(Short Answer)
4.9/5
(78)
if (aValue < largest ) result = aValue;
Else
Result = largest;
What happens when aValue is equal to largest in the program segment above?
(Multiple Choice)
4.8/5
(84)
Showing 21 - 40 of 75
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)