CS 101: Code Examples
This page links to code examples presented in class.
| Date | Code example | Description |
|---|---|---|
| Feb 4 | birthday.cpp | read in and print out user’s birthday |
| Feb 9 | average.cpp | compute average of four numbers |
| Feb 11 | ticket.cpp | Compute ticket price based on age |
| Feb 23 | guess.cpp | Guessing game using while loop |
| Mar 4 | rectangle.cpp | Draw an outlined rectangle |
| Mar 9 | test_prime.cpp | Determine whether integer is prime, find factors |
| Mar 9 | checkerboard.cpp | Print a checkerboard pattern |
| Mar 16 | temperatures.cpp | Read temperatures into array, find high temperature |
| Mar 23 | plate.cpp | Simulate heat transfer on a rectangular plate |
| Mar 25 | box.cpp | Draw an outlined box using functions |
| Apr 13 | values.cpp | Read/print values using arrays/functions |
| Apr 13 | values2.cpp | Read values, compute mean using arrays/functions |
| Apr 20 | powerof2.cpp | Compute power of 2 using pointer/reference parameter |
