Exam 4: Implementing Conditional Logic

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

To save a few keystrokes, Ruby allows programmers to replace the when keyword with the : character when formulating a conditional statement using an if expression.

(True/False)
4.7/5
(32)

Which of the following is not true about flowcharts?

(Multiple Choice)
4.9/5
(29)

You can use conditional modifiers to group and control the execution of one or more statements, making your scripts easier to read and maintain.

(True/False)
4.9/5
(33)

The unless expression is the polar opposite of the if expression.

(True/False)
4.8/5
(36)

The between? method can be used to perform which of the following tasks?

(Multiple Choice)
4.7/5
(36)

The if modifier is used to create complex conditional evaluations spread out over multiple lines.

(True/False)
4.8/5
(39)

The Ternary Operator is an operator that facilitates the inclusion of a conditional expression within another statement

(True/False)
4.7/5
(33)

Which of the following is true regarding case code blocks?

(Multiple Choice)
4.9/5
(37)

To determine if two values are not equal, which comparison operator should be used?

(Multiple Choice)
4.9/5
(40)

Both the = and the == operators can be used to evaluate two expressions or value in order to determine if they are equal.

(True/False)
4.9/5
(40)

A case block is well suited to situations where you need to compare a single value to a whole range of possible matches.

(True/False)
4.8/5
(40)

An if statement code block begins with the if keyword and ends with what keyword?

(Multiple Choice)
4.9/5
(33)

Nesting works just as effectively with unless expressions as it does with if expressions.

(True/False)
4.8/5
(37)

The unless modifier is the logical opposite of the if modifier.

(True/False)
4.9/5
(45)

The if modifier is attached to the end of a Ruby statement in order to conditionally control its execution.

(True/False)
4.9/5
(39)

The elsif keyword permits the evaluation of additional conditional tests when working with an if statement code block.

(True/False)
4.9/5
(37)

In most cases, it takes ____ lines of code to set up a case block when compared to an if expression that contains multiple elseif keywords.

(Multiple Choice)
4.7/5
(32)

Which of the following statements best describes the Ternary operator?

(Multiple Choice)
4.8/5
(38)

Which of the following is true when it comes to nesting conditional statements?

(Multiple Choice)
4.8/5
(41)

The unless modifier is a conditional evaluation appended to the end of Ruby statements that performs the opposite type of evaluation as the if modifier.

(True/False)
4.8/5
(39)
Showing 21 - 40 of 49
close modal

Filters

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