Lessons
Lessons
C++ is used in many areas, from developing system software and game engines to embedded systems and performance-intensive applications.
Lessons
Lesson 1
Write your first program: print text and numbers with std::cout, and fix compiler errors.
Worth 80 XP
Lesson 2
Keep values in int, double and std::string variables, calculate, and join text with +.
Worth 155 XP
Lesson 3
Make your program decide with if, else if and else, and combine conditions with && and ||.
Worth 120 XP
Checkpoint
Work out who wins a hero's fight with a dragon, how armor helps, and when the hero levels up.
Worth 30 XP
Output
Hits needed: 7Dragon's strikes: 6Damage taken: 84The hero wins. Health left: 16XP: 2750Level: 6 (level up!)
Lesson 5
Keep values in a std::vector, read them by index, and use size(), push_back() and pop_back().
Worth 125 XP
Lesson 6
Repeat code with while and for, loop over vectors, and find sums, averages and largest values.
Worth 165 XP
Checkpoint
Print a playlist with song lengths, find the longest, and see which songs fit your bus ride.
Worth 30 XP
Output
1. Pixel Heart (3:34)2. Rainy Tuesday (4:05)3. Dancing Robots (5:12)4. Moon Bike (3:07)5. Midnight Pizza (4:20)6. Paper Rocket (3:18)Total: 23:36Longest: Dancing Robots (5:12)Songs over 4 minutes: 3Songs for the ride:Pixel HeartRainy TuesdayDancing RobotsTime left: 2:09
Lesson 8
Write functions with parameters, default values and return values, and pass vectors to them.
Worth 110 XP
Lesson 9
Let functions change your variables through int& references, and use int* pointers and nullptr.
Worth 120 XP
Lesson 10
Build a program that prints test results with grades, the class average and the best student.
Worth 85 XP
Output
Max is not in the class.TEST RESULTSAdam: 45 points, grade AEmma: 41 points, grade BFinn: 50 points, grade AJack: 17 points, grade FLucy: 38 points, grade BAverage score: 38.2Best: Finn (50 points)Failed: 1
C++ is used for game engines, system software, embedded devices and anywhere speed matters. The course starts with printing and variables and goes on to conditions, vectors, loops and functions, ending with references and pointers.
Your programs are compiled and run right in the browser, with real compiler error messages. Between lessons, you write a dragon fight and a playlist on your own, and in the final project a program that prints a class's test results, grades and average.