Videos and Reading (online and textbook):
All of the following are required except the items labeled Optional are, well, optional
(i.e., things that may be interesting but do not directly pertain to your success in this course).
- The Accumulator Pattern
-
Video (embedded in a web page) [9:36 minutes]
-
Video (as an mp4 that you can download if you want)
- More on Conditionals (IF statements and variants thereof)
Recall that you should have already done some reading on conditionals
in your Session 5 Preparation.
- Textbook reading: Section 3.3 — Nested Branches (pages 106 - 109, 4 pages).
Focus your attention on:
- The concept of levels of decision making, as exemplified in Table 3 on page 106.
- The notation for nested IF statements, per the example on page 107.
- The useful Programming Tip 3.2 on hand-tracing.
- Textbook reading: Section 3.4 — Multiple Alternatives (pages 109 - 112, 4 pages).
Focus your attention on:
- The concept of multiple alternatives, as demonstrated in Table 4.
- The notation for if-elif ... else statements,
and why that notation is better than nested IF statements for describing multiple alternatives.
- The importance of the order in which the conditions are listed in if-elif ... else statements,
and how to get that order right.
- Optional
textbook reading:
Section 3.5 — Flowcharts (pages 112 - 115, 3 pages)
Optional reading, but be sure you can READ a flowchart (and know what one is).
Some would say that flowcharts are rarely of use
in problems of real-world size, but it is important that you know what they are.
- Test Cases — Coverage and Boundary Testing
- Textbook reading: Section 3.6 — Problem Solving: Test Cases (pages 116 - 117, 2 pages).
Read this important section carefully. Be sure you understand:
- What it means to cover all the branches of the program.
- What a boundary condition is,
and why they are important to test.
- What testing for invalid input means,
and when you should and should not include such testing.
- What Test-First Programming is and its two primary benefits:
- It clarifies the specification (WHAT your code needs to do).
- It gives insight into finding a reasonable implementation (HOW your code does it).
- Optional
online reading:
Test-First Programming