Before coming to Class 2, please complete the following prep work:
| Task | Resource Type | Link | Instructions |
|---|---|---|---|
| Watch | Lecture | Week 1, Continued | Watch the week's second lecture. Again, feel free to watch on 1.5x speed if it suits you. |
| Task | Resource Type | Link | Instructions |
|---|---|---|---|
| Watch | Doug's Playlist | Conditional Statements | Doug's video will explore different kinds of conditional statements (don't worry too much about switch statements). |
| Read | Lecture Notes | Conditions | Read the lecture notes about conditions, optionally rewatch this portion of the lecture. Stop when you get to the Loops header. |
| Follow-Along | Walkthrough | conditions-0 | Follow along with David Malan to create a program using if/else statements. Grab the pseudocode to start writing the program here. |
| Follow-Along | Walkthrough | conditions-1 | Build off your previous program, following David to add in a else if branch. Grab the pseudocode to start writing the program here. |
| Do | Exercise | Age Restrictions | Try the Age Restriction exercise to practice using conditionals. |
| Watch | Doug's Playlist | Operators | Watch Doug's video about operators. There's a fair amount of text on the screen, so you may want to take notes if you find that helpful. You can also check out the Operators section of the C Language cheat sheet in the Helpful Resources here. |
| Do | Exercise | Decade | Try the Decade exercise, where you'll need to fix program that has a bug. As a reminder, a bug is an error or flaw in a computer program that causes it to produce an incorrect or unexpected result. |
| Watch | Short | Boolean Values | Watch this short that reviews boolean values. Vipul writes notes on the screen, so feel free to write your own notes. |
| Task | Resource Type | Link | Instructions |
|---|---|---|---|
| Read | Lecture Notes | Week 1, continued / Loops | Read the lecture notes on loops to get an introduction to for loops, and optionally rewatch the video. Stop at the Integer Overflow header. |
| Read | Lecture Notes | Week 1, continued / Loops, continued | Read another section on loops, this time talking about while loops. Stop at the Variables header. |
| Watch | Short | Loops | Watch this short about Loops. As a heads up, at the 5:34 mark you will see a program that has main method whose argument is different than void. You can ignore this for now; we'll come back to it later in the course. Check out the C Language cheat sheet in the Helpful Resources here when you're done for a recap. |
| Follow-Along | Walkthrough | Positive | Follow along with David to create a program using a do-while loop. Also take note of when he talks about scope near the end of the video. Grab the pseudocode to start writing the program here. |
| Do | Exercise | Validate | Do the Validate exercise to practice using a do-while loop. You'll use the modulo operator to make sure the user is giving you an even number. |
| Watch | Doug's Playlist | Loops | Watch Doug's video about loops, which will provide a good recap of the different kinds of loops. |
| Read | Resource | For vs While | Here we briefly illustrate how for loops and while loops truly are just different syntaxes for accomplishing the same thing. |
| Do | Exercise | Countdown | Try the Countdown exercise for more practice with loops. |
| Task | Resource Type | Link | Instructions |
|---|---|---|---|
| Watch | Short | Variables | Watch this short that goes into more detail about variables, including declaring variables, naming conventions, and using variables with loops. |
| Read | Resource | Convoluted | An example of good vs bad ways of using variables. |
| Task | Resource Type | Link | Instructions |
|---|---|---|---|
| Watch | Short | Libraries | Watch this short video about libraries. This will give you a better idea of how programming languages work. |
| Read | Lecture Notes | Week 1, continued / Functions and Arguments | As you read through the notes about functions and arguments, consider copying the example code into your IDE to familiarize yourself with user-defined functions. Stop at the Problem Set 1 header (although you'll probably just read it, because it's right there and it's two sentences long). |
| Do | Exercise | How many oranges? | Get some practice using a library function!. You'll use a function from the <math.h> library called ceil. |
| Task | Resource Type | Link | Instructions |
|---|---|---|---|
| Follow-Along | Section | Debugging with Dan Armendariz | The Debugger is an awesome tool that will help you understand what the heck your code is doing by letting you observe, line by line, as it executes. As you watch this demo video, copy everything Dan does in your own IDE. Grab the pseudocode to start writing the program here. |
| Do | Exercise | Debug | Practice with the debugger! |