diff --git a/3 - Functional Programming/1.2 - Control Statements.tex b/3 - Functional Programming/1.2 - Control Statements.tex index 6191d35..3db8d87 100644 --- a/3 - Functional Programming/1.2 - Control Statements.tex +++ b/3 - Functional Programming/1.2 - Control Statements.tex @@ -380,3 +380,24 @@ This program will output \pigOut{Loop Started} followed by a listing of 0 throug So as you can see unlike a Break statement which stops a loop in its tracks a Continue statement just says stop processing this iteration of the loop and continue to the next. \subsection{Conclusion} +We have finished a substantial chapter so lets re-cap. +We have covered how to go about controlling the flow of our programs. +To make decisions based on the value of variables as well as to continue the execution of code until a given condition is met and even how to control those features. +\par + +If, If-Else and Else-If statements allow us to use conditionals to perform given blocks of code given the output of the conditional. +\par + +Switch statements are used to perform a given block of code given the specific value of a variable. +\par + +For loops allow us to use a counter to execute a given block of code based on the size of the counter. +\par + +While and Do-While loops allow us to execute a given block of code while a conditional evaluates to true. +A While loop checks the conditional before executing the code block while a Do-While will execute the code block first before checking the conditional. +\par + +Lastly, we use Break and Continue statements to control our control statements. +A Break statement is used to break free from a loop and stop its execution. +A Continue statement allows a loop to skip to the next iteration. diff --git a/Programming In General.pdf b/Programming In General.pdf index 15b8b72..72a1ce1 100644 Binary files a/Programming In General.pdf and b/Programming In General.pdf differ