Full Access Locked
You are viewing this roadmap in Preview Mode. Upgrade your membership to unlock all missions.
Your Journey
0 / 101 MissionsC++ Introduction – Your First Program
<p> Write a C++ program that prints the following message: </p> <pre> Hello C++ </pre> <p> This challenge introduces you to the basic structure of a C++ program and how to display output on the screen. </p>
C++ Syntax – Understanding the Basics
<p> Write a C++ program that prints the message: </p> <pre> C++ Syntax Works! </pre> <p> This challenge will help you understand the basic structure and syntax of a C++ program. </p>
C++ Output – Displaying Text on the Screen
<p> Write a C++ program that prints the following message: </p> <pre> Learning C++ Output! </pre> <p> This challenge will help you practice displaying text on the console using C++. </p>
C++ New Lines – Printing Text on Multiple Lines
<p> Write a C++ program that prints the following messages on separate lines: </p> <pre> Hello C++ Welcome to Programming </pre> <p> This challenge will help you practice adding new lines in your C++ output. </p>
C++ Comments – Writing Notes in Your Code
<p> Add comments to the following C++ program to explain each line of code. Comments do not affect the program’s output. </p> <pre> #include <iostream> using namespace std; int main() { cout << "Hello C++"; return 0; } </pre>
C++ Variables – Storing Data in Your Program
<p> Write a C++ program that creates a variable to store your age and prints it. </p> <pre> Expected Output Example: My age is 21 </pre> <p> This challenge will help you understand how to declare and use variables in C++. </p>
C++ Declare Many Variables – Multiple Variables in One Line
<p> Write a C++ program that declares three integer variables in a single line and prints their sum. </p> <pre> Expected Output Example: The sum is 15 </pre> <p> This challenge will help you practice declaring multiple variables efficiently. </p>
C++ Constants – Fixed Values in Your Program
<p> Write a C++ program that declares a constant to store the value of pi (3.14) and prints it. </p> <pre> Expected Output: The value of pi is 3.14 </pre> <p> This challenge will help you understand how to use constants in C++ programs. </p>
C++ User Input – Reading Data from the User
<p> Write a C++ program that asks the user to enter their name and age, then prints a message using that information. </p> <pre> Expected Output Example: Enter your name: Akram Enter your age: 21 Hello Akram! You are 21 years old. </pre> <p> This challenge will help you practice reading input from the user using C++. </p>
C++ Basic Data Types – Understanding Variables
<p> Write a C++ program that declares a variable of each basic type and prints their values. </p> <pre> Expected Output Example: Integer: 10 Float: 3.14 Character: A Boolean: 1 </pre> <p> This challenge will help you understand the basic data types used in C++. </p>
C++ Numbers – Working with Numeric Values
<p> Write a C++ program that declares two numbers, adds them, and prints the result. </p> <pre> Expected Output Example: The sum of 5 and 10 is 15 </pre> <p> This challenge will help you practice using numeric variables and performing basic arithmetic in C++. </p>
C++ Booleans – True or False Values
<p> Write a C++ program that declares a Boolean variable, assigns it a value, and prints it. </p> <pre> Expected Output Example: The statement is true </pre> <p> This challenge will help you understand how to use Boolean values in C++ programs. </p>
C++ Characters
char grade = 'A'; cout << grade;
C++ Strings
string s = "Hi"; cout << s;
C++ Operators
Print 10 % 3
Assignment Ops
int x = 10; x += 5; cout << x;
Comparison Ops
cout << (5 == 5);
Logical Ops
cout << (true && false);
String Length
Log length of "Hello"
Access Strings
Log first char of "Hello"
Change String Char
Change "Hello" to "Jello"
Math Max/Min
Log max(5, 10)
Math Sqrt
Log sqrt(64)
Math Round
Log round(2.6)
C++ If ... Else
if 20 > 18 print 'Yes'
C++ Else
If 10>20 else print 'No'
C++ Else If
int x=10; if(x<5){} else if(x==10){cout << "OK";}
Short Hand If
int t=20; string r=(t<18)?"A":"B"; cout << r;
Switch Statement
Switch case 1 print 'One'
While Loop
While i<3
Do/While Loop
Do while 1<0
For Loop
For i=0 to 2
Break and Continue
Break if i==2
Continue if i==2
Skip 2 in 0-3
Arrays Intro
int a[]={1, 2}; cout << a[0];
Change Array Element
Change {1} to {5}
Loops and Arrays
Print {1, 2}
Omit Array Size
int a[]={1, 2}; (Theory)
Get Array Size
theory on sizeof.
Multi-Dimensional
int a[1][1]={{1}}; print a[0][0]
Structures
struct {int x;} s; s.x=5; print
Named Structures
MyStruct s; s.x=10;
References
string food="Pizza"; string &meal=food; print meal
Memory Address
theory on &x.
Pointers Intro
string* p = &food;
Dereferencing Pointers
Log *p
Modify Pointer Value
*p = "New";
Functions
Define f() and call
Function Parameters
f(name) prints 'Hi ' + name
Default Params
f() logs default
Multiple Params
sum(1, 2)
Return Values
Return 8
Pass By Reference
void f(int &x){ x=10; }
Pass Arrays to Func
Theory on array params.
Function Overloading
double f(double), int f(int).
Recursion
theory on recursion.
Classes and Objects
Create Object o from Class C
Class Methods
inside: void f(){...}
Constructors
C(){ x=5; }
Constructor Params
new C(10)
Access Modifiers
theory on modifiers.
Encapsulation
get/set x
Inheritance
class S : public P
Multi-Level Inheritance
theory on chain.
Multiple Inheritance
theory on multi.
Inheritance Access
theory on protected.
Polymorphism
theory on poly.
Files: Create/Write
theory on fstream.
Files: Read
theory on reading.
Exceptions (Try/Catch)
Try throw 505
C++ Vectors
vector v={1, 2}; cout << v[0];
Vector Push Back
push 5 to {1}
Vector Size
size of {1, 2}
STL Sort
sort {2, 1}
Map STL
m["a"]=1; print
Set STL
s.insert(1); s.insert(1); size
Stack STL
s.push(1); s.top();
Queue STL
q.push(1); q.front();
Pairs STL
pair<int, int> p={1, 2};
Auto Keyword
auto x = 5; print x
Iterators
theory on iterators.
Lambdas
[](int x){ return x+1; }
Templates Intro
template <typename T> T f(T x)
Class Templates
theory on class template.
Smart Pointers
theory on smart pointers.
Enumeration
print MID
Typedef / Using
using byte = unsigned char;
Namespaces
namespace my { int x=5; }
Bitwise Operators
5 & 1
Static Members
static int x;
Friend Functions
friend void f();
Virtual Functions
virtual void f();
Pure Virtual
virtual void f() = 0;
Dynamic Memory
int* p = new int; delete p;
Inline Functions
inline int f(){ return 1; }
C-Strings vs Strings
theory comparison.
String Comparison
Log result
String Concats
Log AB
Math Abs
Print 5
Math Floor/Ceil
print 1 2
Boolean Logic
Log 1
Path Completion
Complete all missions to earn your certificate of mastery.