Lesson 1 PREFINALS Flashcards
It is used to “jump out” of a switch statement.
Break Statement
It can also be used to jump out of a loop.
Break Statement
This statement breaks one iteration
(in the loop), if a specified condition occurs,
and continues with the
next iteration in the loop.
Continue Statement
It allows us to
execute specific blocks of code a number of
times.
Repetition Control Structures
is a statement or block of
statements that is repeated as long as some condition is satisfied.
While loop
the statement inside this loop is executed several times as long as the condition is satisfied.
Do while loop
It allows execution of the same code a number of times.
for loop
It Initializes the loop variable.
Initialization Expression
It compares the loop variable to some limit value
Loop Condition
It updates the loop variable
Step Expression
These are used to store multiple values in a single variable, instead of declaring separate variables for each value.
Arrays
To declare this, define the variable type, specify the name of the array followed by square brackets and specify the number of elements it should store:
Array
You can access an array element by referring to the index number inside _______
Square Brackets []
These are like a row of boxes where you can store things where each box can hold one item, such as a number or a word. For example, in an array of numbers, the first box might hold 5, the second 10, and so on
1D Arrays
In 1D Array, you can easily find or change what’s in each box by referring to its position, called an _______.
Index