Concepts

This post serves to provide convenient links to reviews of programming concepts such as:

TIP

The above links are new concept summaries, each with a few practice exercises.

Mr. Gordon used a couple of different large language models to generate these, then proof-read them and corrected a variety of errors.

You can hone your programming skills, using these concepts, by trying the following puzzles.

Recap

Optionally, you could review these two brief videos where Mr. Gordon identifies:

  1. how to use a loop to count occurrences of a certain condition
  2. how to separate the logic into individual functions

Puzzles

For each puzzle below, write both a command-line program with logic that solves the problem, and automated unit tests. You may use the getInput function to collect user input.

  1. Friendly Numbers
  2. Chip’s Fast Food Emporium

TIP

If at all possible, do not try these puzzles alone. Work with a friend from class. Try some examples out on a whiteboard or a sheet of paper. Then describe in point-form English what steps you need to take to solve the program in code. Try to apply the concept of functional decomposition to break the larger problem up into smaller parts – using functions also makes your code testable.

Here is an example of Mr. Gordon following the process described above to solve the ISBN Numbers puzzle – note that this video has chapters to allow you to hone in on the part of the problem solving process you are most interested in: