Week 03-04: Statements.
Learning Outcomes:
This chapter discusses the statement. In the most general sense, a statement is a part of your program that can be executed. That is, a statement specifies an action. C and C++ categorize statements into these groups:
■ Selection
■ Iteration
■ Jump
■ Label
■ Expression
■ Block
Included in the selection statements are if and switch. (The term conditional statement is often used in place of "selection statement.") The iteration statements are while, for, and do-while. These are also commonly called loop statements. The jump statements are break, continue, goto, and return. The label statements include the case and default statements (discussed along with the switch statement) and the label
statement (discussed with goto). Expression statements are statements composed of a valid expression. Block statements are simply blocks of code. (Remember, a block begins with a { and ends with a }.) Block statements are also referred to as compound statements.
Lesson Plan:
Lecture 01: Introduction to the (a) True and False in C and C++, (b) Selection Statements i.e. if-statements.
Lecture 02: Discussion on (a) if-else statements, (b)Nested if statement, (c) The if-else-if Ladder.
Lecture 03: Discussion on (a) The ? Alternative, (b) The Conditional Expression, (c) Switch, Nested switch Statements.
Lecture 04: Learning (a) Iteration Statements, (b) The 'for' Loop (c) for Loop Variations, (d) The Infinite Loop.
Lecture 05: Studying (a) The 'while' Loop, (b) The do-while Loop, (c) Declaring Variables within Selection and Iteration Statements.
Lecture 06: Studying (a) The return Statement, (b) The goto Statement, (c) The break Statement, (d) The continue Statement