Back

Challenge Set 9

Unlocks after Activity 1.19. Three code challenges, and the drop that collects them.

divider

What This Set Is For

All three of these know how many passes they will make before they start. That is the whole difference between these and Challenge Set 8, where none of the programs could know.

None of these needs a while loop anywhere. If you find yourself writing one, stop and ask what number you already have — it is usually sitting in a variable two lines up.


Both Are Briefs

Nobody lists the steps on either page. You get a result somebody wants, and you write the requirements list first — input, calculate, output, and every decision you had to make yourself.

If that is unfamiliar, read it once here: How to Read a Brief, in Challenge Set 1.


The Challenges

Times Table is one star and is the plainest counted loop the course will ever ask for — the number of passes never changes, only the number being multiplied. Add It Up is also one star and is that same loop with a running total added on top — the same for, one more idea. Fizz Buzz is two stars, and every line of it is something you have had for weeks. The difficulty is entirely in the order you put four branches in, and a wrong order produces no error at all.

These are options, not a checklist. Pick whichever combination gets you to what the dropbox asks for — Times Table and Add It Up are both easier ways in than Fizz Buzz.


Which Homework These Feed

Part 3's pool is collected right after this activity. That pool is these three plus the three from Challenge Set 8 — six available, and the drop asks for two of them.

The pool keeps growing after that. The next two activities add seven more challenges to the same pool, and a later drop asks for three more. Anything you do now counts toward one of them, so nothing you finish early is wasted.

The dropbox says how many. This page only says what is available.

Commence Challenges