



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Introduction to Program Control Structures ➢ enable a program not only to do sequential execution but also selection and repetition. ➢ must only be answerable by yes or no
→ Two way selection structure o Block of statements - group of code that is composed of more than one line; enclosing them within curly braces o Precaution for Relational Operator Associativity o Precaution for equality and assignment operator → Multiple Path selection (if-else if)
o If there is no match, the default label would execute. If there is no default label, the entire switch statement would be skipped. o The break statement is used to immediately exit from the switch statement. o The toupper (expression) statement on the switch expression is used to convert the gradeEquiv character to upper case. Repetition Structure ➢ repeatedly execute a statement or a group of statements until the specified condition is met.
o sentinel value - terminate a loop o flag value - a Boolean value that would terminate a loop → for loop - In summary the for loop operates with the following steps
→ continue statement - used skip the rest of the statements on a repetition structure.