Wednesday's Session
Glad to see a good turnout last Wednesday. I'll keep the lab format like that from now on since it seemed to facilitate everyone who wanted help.
Brief
The goal of this lesson is to review everything that students should know up to this point and get everyone ready for the practice midterm on Wednesday.
Key Terms
No new key terms this week, except for the For loop and the While loop which doesn't
Outline
- [0-10 min] Q & A
- [5 min] Go Over Today's Quiz
- [5-10 min] Mini-Quiz
- #include <iostream>
#include <iomanip>
using namespace std;
int main()
{
// Prompt the user for a number
double n;
cout << "Enter a number: ";
cin >> n;
// Give a blank line between the input and the output
cout << endl;
while (n > 0)
{
n /= 2;
cout << n << endl;
}
cout << "All Done!";
}
- [0-10 min] Formatting Output Review
- setprecision, fixed, setw, left, right, setfill
- [0-10 min] If Statements
- Blocks
- Comparison Operators
- Boolean Logic Operators
- [5-15 min] For and While Loops
- Output a countdown from a given n
- The do ... while loop
- Control Flow
- Loop Invariant (There should be a condition that is true at the start of the loop and after each iteration of the loop)
- [5-15 min] Scoping
- [5-10 min] Magic Numbers
- [5-15 min] Go over essentials
- Declaring/initializing/assigning/modifying/etc. variables
- Stream insertion and extraction (cin and cout)
- Arithmetic with various data types
- Strings, concatenation, etc.
- [5-10 min] Dot Operator
No comments:
Post a Comment