🧱 Section 1 · Foundations
🟣 Checkpoint Quiz
MODULE 05 · QUIZ
C++ Foundations Quiz
Your progress in Section 1100%
🎯 What this checkpoint covers: This is a review lesson, not new teaching. It's a 10-question assessment pulling from everything in Section 1 — Lessons 1 through 4: your first program, variables and types, control flow, and functions. Skim the recap below, then take the quiz.
Recap
Section 1 in a Nutshell
Before the quiz, here's a compressed recap of the four lessons you've completed. If any of these points feel unfamiliar, it's worth a quick re-read of that lesson before you continue.
1
Lesson 1 — Introduction & First Program
C++ is a compiled, statically-typed language created by Bjarne Stroustrup. Unlike Python's interpreted model, C++ source code is translated by a compiler (
g++/clang++) into a machine-code executable before it runs. Every program needs #include <iostream>, an int main() entry point, std::cout << for output, and return 0; to signal success.2
Lesson 2 — Variables, Data Types & Operators
Every variable has a fixed, compile-time type:
int, double, float, char, bool, or std::string. auto lets the compiler infer the type from the initializer. Integer division truncates — 7 / 2 is 3, not 3.5 — and &&/||/! combine boolean logic.3
Lesson 3 — Control Flow
if/else if/else runs the first true branch. switch needs break to avoid falling through into the next case. for loops suit known iteration counts; while checks its condition first; do-while always runs its body at least once. break exits a loop; continue skips to the next iteration.4
Lesson 4 — Functions
Functions have a typed return value, name, and parameters. Pass by value copies arguments; pass by reference (
&) lets a function modify the caller's variable. Overloading allows same-named functions with different parameter lists. Recursion needs a base case to avoid running forever.🧩 C++ Foundations Checkpoint — 10 Questions
Answer all 10 questions to test your mastery of Section 1. Instant feedback on every answer.
1. What does
#include <iostream> give your program access to?2. Before a C++ program can run, it must be:
3. What is the result of
9 / 4 when both operands are int?4. Which keyword lets the compiler infer a variable's type from its initializer?
5. Which operator represents logical OR in C++?
6. What happens if you forget
break in a switch case?7. Which loop type guarantees its body runs at least once, even if the condition starts false?
8. Inside a loop, which keyword skips straight to the next iteration without exiting the loop?
9. To let a function modify the caller's original variable, you should use:
10. What must every correct recursive function have to avoid infinite recursion?
Finished the checkpoint?
Mark it complete to track your progress.
Module 05 of 26
Section 1 — C++ Foundations