Chapter 3 Flashcards
T/F You can think of an array as a collection of variables contained within a single variable
True
T/F You access an array element’s value just as you access the value of any other variable, except that you must include the element index in brackets
True
T/F An if statement keeps repeating until its conditional expression evaluates to false
True
T/F Case labels must be discrete values and cannot use operators
True
T/F A break statement restarts a loop with a new iteration
False
You use a(n) BLANK when you want to store a group or a list of related information in a single, easily managed location
array
Each piece of data contained in an array is called a(n) BLANK
element
The BLANK statement is used to execute specific programming code if the evaluation of a conditional expression returns a truthy value
if
A set of statements contained within a set of braces is known as a(n) BLANK block
command
If you want to execute one set of statements when a condition evaluates to a truthy value and another set of statements when the condition evaluates to a falsy value, you need the BLANK statement
if/else
The BLANK statement controls program flow by executing a specific set of statements, depending on the value of an expression
switch
A(n) BLANK label in a switch statement represents a specific value and is followed by one or more statements that are executed if the value of the label matches the value of the switch statement’s expression
case
A case label consists of the keyword case, followed by a literal value or variable name, followed by a(n) BLANK
colon
The BLANK label contains statements that execute when the value returned by the switch statement does not match a case label
default
A(n) BLANK statement is used to end the execution of a switch statement
break