Exam 5: The Selection Structure

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

The code for the following is ____. "If the value of password is not bottomsUp, display the message Access denied.":

(Multiple Choice)
4.8/5
(33)

A selection structure allows you to teach the computer how to make decisions.

(True/False)
4.9/5
(40)

A(n) ____ structure starts with the pseudocode keyword Select, followed by the name of the variable to test for equality with a variety of values, and ends with a colon.

(Multiple Choice)
4.8/5
(47)

In many programming languages the relational operator for testing whether two values are equal is <=.

(True/False)
4.9/5
(29)

The simplest selection structure is one in which an action is taken if the condition evaluates to true, but no action is taken if the condition evaluates to false. This structure is called the ____.

(Multiple Choice)
4.8/5
(37)

Selections can be nested inside other selections.

(True/False)
4.7/5
(37)

In pseudocode, a dual-outcome selection consists of three parts: • The word If, the condition expression, and the word Then • The statement or statements to be performed if the condition is true; indented for readability • The words End If lined up under the word If

(True/False)
4.8/5
(33)

Structures can contain other structures, and they can be contained in other structures. They can also overlap.

(True/False)
5.0/5
(38)

With a selection structure, your program can choose between alternate courses of action.

(True/False)
4.9/5
(45)

The pseudocode for the following problem is ____. Suppose all students in grade 12 at a high school are to be selected for a field trip, but the boys are leaving on the 8:30 a.m. bus and the girls are leaving at 9:00 a.m.

(Multiple Choice)
4.9/5
(38)

A selection contained in the scope of another selection is called a ____.

(Multiple Choice)
4.9/5
(38)

In JavaScript, braces ({ }) are used to define the scope of a selection structure's true and false branches.

(True/False)
4.7/5
(33)

The following statement concatenates a customer's name: custName = firstName + " " + lastName

(True/False)
4.8/5
(37)

On a flowchart, the End If statement in pseudocode is represented by the square connector symbol.

(True/False)
4.8/5
(32)

JavaScript allows using the keywords else if together and does not require nested braces around nested structures.

(True/False)
4.9/5
(36)

The end command, which is an exception to structured programming principles, is the most efficient way to exit a Case structure.

(True/False)
4.8/5
(44)

For nested selections that test the same variable for different values, developers created the ____, which is actually a variation of the selection structure.

(Multiple Choice)
4.9/5
(40)

Nested selections, when written formally, require indentations for each new Else statement.

(True/False)
4.9/5
(40)

The code for the following is ____. "If the value of numCorrect is equal to 3, set bonusPoints to 10 and display the message Congratulations! You win 10 bonus points."

(Multiple Choice)
4.7/5
(47)

The following symbols are known as ____. <, >, ==, <=, >=, !=

(Multiple Choice)
4.8/5
(33)
Showing 21 - 40 of 50
close modal

Filters

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