Discussion 11-1

Functions

Today we practiced with functions. Most of the stuff I wanted to emphasize is in the source code below (read the comments!) but here are a couple of extra points:

Examples

Midterm prep

If I were you guys, I'd spend my midterm prep time as follows. First, go reread all the professor's slides. Then, spend your remaining study time on practice problems, either from the bottom of this page or from here. Make sure to do practice problems with just pencil+paper instead of typing your code! It's hard at first to get the syntax right when you're used to Visual Studio helping find mistakes for you, but you won't have Visual Studio's help during the test!

Google searches

Here are some Google searches you could try if you're having trouble with today's material. I'm deliberately trying to choose search terms that you could have thought of yourself!

Extra stuff to try for fun (not required)

In the "pe5.cpp" example above, I converted a previously-written program into a new version that does the same thing but uses a function. Here are links to other old programs we've written together. Try setting up the function version yourself if you want extra practice!