<< Week 3
Class schedule
Week 5 >>
Last updated 2017 February 1
Week 4 — Loops and developing programs
Loops
Example programs.
Do while loop control statement
example
.
Use right click on a web page to see and copy the source text. Click on script links to see the js files.
Class exercise
Develop a multiplication table
The starting point
— Hard-coded table
The midway point
— Replaced the variable parts of the table with values read from the screen. But still have the number of rows hard-coded because each row is programmed with its own loop.
A solution
A refactored solution
— the solution instead of being one large function is split into a collection of smaller functions.