Chapter 54 - Selection Flashcards
What is sequence?
» Executing instructions one after another
What is assignment?
» A value is assigned to a variable
What is another name for selection?
» Branching
What is selection?
» Branching is where a decision as to which part of the program is to be run is made - based on the state of a Boolean expression
What does > mean?
» Greater than
What does < mean?
» Less than
What does <= mean?
» Less than or equal
What does >= mean?
» Greater than or equal to
What does != mean?
» Not equal
What are the features of if/else statements?
» Present a Boolean condition and a block of code that is run if the condition is true
When is switch/case statements useful?
» When a choice has to be made between several alternatives
How can you start of a switch/case statement?
» switch x:
case “what ever the case is” :
case “etc..” :
What is the defauly statement in a swich/case statement?
» It runs if none of the cases is true, same as else
What does BRA mean?
» Branch always
What dose BRP mean?
» Branch if the value in the accumulator is positive