Chapter 3- arrays Flashcards
You can think of an array as a collection of variables contained within a single variable
True
You access an arrays elements value just as you access the value of any other variable except that you include the element index in brackets
True
An if statement keeps repeating until it’s conditional expression evaluated to false
False
Case labels must be discrete values and cannot use operators
True
A break statement restarts a loop with a new iteration.
False
You use a ____ 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 an __
Element
The _ 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 ___ block
Command
If you want to execute one set of statements when a condition evaluated to a truthy value and another set of statements when the condition evaluated to a falsy value, you need the _ statement
If/else
The _ statement controls program flow by executing a specific set of statements, depending on the value of an expression
Switch
A _ 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 statements expression
Case
A case label consists of the keyword case, followed by a literal value or variable name, followed by a _
Colon
The _ label contains statements that execute when the value returned by the switch statement expression does not match a case label
Default
A _ statement is used to end the execution of a switch statement
Break