Structures Flashcards
What are the Boolean operators
Not
And
Or
What is NOT’s function
NOT is a unary operator, it is applied to only one value and inverts it:
-not true = false
-not false = true
What is AND’s function
AND yields TRUE only if both values are TRUE
-false AND false = false
-false AND true = false
-true AND false = false
-true AND true = true
What is OR’s function?
OR yields TRUE if at least one value is TRUE
-true OR true = true
-true OR false = true
-false OR true = true
-false OR false = false
What are the 2 types of loops?
Pre test loop
Post test loop
What are the 2 types of Pre Test Loops and Post Test Loops?
Counter
Sentinel
When are Counters and Accumulators used?
Counters and Accumulators are used within a repetition structure to calculate totals, subtotals, and averages.
What must be done to all Counters and Accumulators?
All Counters and Accumulators must be Initialized and Updated
What is Initializing?
Initializing is assigning a beginning value to a variable
(typically, but not always, 0)
When is initialization usually performed and why?
Initialization is usually performed outside the loop body, and this is because it only needs to be done once
What is Updating?
Updating is adding a number to the value stored in a variable
What are Counters updated by?
Counters are updated by a Constant Value
What are Accumulators updated by?
Accumulators are updated by an amount that varies