Exam 5: Making Decisions

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

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
(95)

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)

if (aValue < largest ) result = aValue; Else Result = largest; What happens when aValue is equal to largest in the program segment above?

(Multiple Choice)
4.9/5
(83)

The assignment operators and the conditional operator ? : are right-associative.

(True/False)
4.9/5
(70)

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
(81)

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
(84)

Boolean variables store 0 to represent off or false and 1 to represent on or true.

(True/False)
4.9/5
(88)

Forms of the if statement include one-way,two-way,____________,multiway,and compound.

(Short Answer)
4.8/5
(75)

The <,>,<=,and >= are called the logical operators of the language.

(True/False)
4.9/5
(82)

The conditional expression,sometimes called "the test," must evaluate to true.

(True/False)
4.9/5
(84)

How can the compound conditional expression ((average > 79 && average <= 89))be written to eliminate the logical operator - without changing the logic?

(Multiple Choice)
4.7/5
(84)

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,b and c are equal to 200?

(Multiple Choice)
4.8/5
(64)

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
(80)

By properly ____________ the else clauses with their corresponding if clauses,you encounter fewer logic errors that necessitate debugging.

(Short Answer)
4.8/5
(91)

With a two-way if statement,either the true statement(s)is (are)executed or the false statement(s),or both.

(True/False)
4.7/5
(73)
Showing 61 - 75 of 75
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)