|
| Learning objectives for chapter 7 |
| 1 | Learn to use else-if logic to select from among several sets of statements depending on conditions being met. |
| 2 | Learn to use switch-statements that test cases of int variables and char variables. |
| 3 | Learn the difference between event-controlled and count-controlled loops, and how to implement each. |
| 4 | Learn how to implement for-loops. |
| 5 | Learn what are nested loops and how to manage them in a program. |
| 6 | Learn how to reverse logic by applying DeMorgan's Theorem. |
|
| |
Learning objective(s) addressed |
| |
1 | 2 | 3 | 4 | 5 | 6 |
| Exercises |
Right-click (or control-click on a Mac) the title to save its PDF to your system. |
|
| 7.1 |
Using Switch-statements PDF |
| X | | | | |
| 7.2 |
Input Validation PDF |
| | X | X | | |
| 7.3 |
Making Change While PDF |
| | X | X | | |
| 7.4 |
Coin Toss, v.2.0 PDF |
| | X | X | | |
| 7.5 |
Coin Toss, v.3.0 PDF |
| | X | X | X | |
| 7.6 |
The Game Of War, v.2.0 PDF |
X | | X | | | |
| 7.7 |
The Game Of War, v.3.0 PDF |
X | | X | | X | |
| 7.8 |
The Rock-Scissors-Paper Game, v.1.0 PDF |
X | | X | | X | |
| |
| Samples |
Right-click (or control-click on a Mac) the title to save its PDF to your system. |
|
| 7.1 |
About For-loops PDF |
| | | X | | |
| 7.2 |
About Nested Loops PDF |
| | | | X | |
| 7.3 |
About DeMorgan's Theorem PDF |
| | | | | X |
| |
| Videos |
|
| 7.1 |
Click HERE for a YouTube-like video that shows how to develop code with loops.
It's 20 minutes long, using C++ with the JNotePad editor and the Visual Studio command line compiler, on a Windows PC.
It demonstrates the development of a program that uses an event-controlled, while-true-if-break loop, with else-if logic.
|
X | | X | | | |
| 7.2 |
Click HERE for a YouTube-like video that shows how to develop the MasterMind game "from scratch".
View the video to see how a problem similar to Rock-Paper-Scissors is developed.
It's 70 minutes long, using C++ with the JNotePad editor and the g++ XCode command-line compiler on a Mac.
It demonstrates the development of a program that uses an event-controlled, while-true-if-break loop, with else-if logic.
|
X | | X | | | |
|
| Code from the chapter in order of their appearance in the text |
|
|