Discussion 5-18: Problem solving in the PIC lab!

Today we're meeting in the PIC lab so you guys get some dedicated problem-solving practice time. Here is a list of problems to work on. Each problem has a comment block with a problem statement, followed by another comment block with some tests. To solve a problem, you should write the function described in the problem statement. Then you can uncomment my test code and run the program to make sure your function behaves like it should.

Update: You can see my solutions here. As usual, there are multiple valid approaches to most of these problems!