StaffCoder
C+

C++ Programming Exercises

C++
6 modules · 26 challengesSign up
Module 1 of 6 · 5 challenges

Types & Functions

Learn how to split whole numbers with integer division and remainder, let the compiler deduce return types with auto, overload one function for different argument types, round values the standard way, and build a kitchen unit converter.
Finish every challenge, or complete the star challenge, to complete the module.

Challenges

5 challenges

Batch Portion Math

Sign up to unlock
50%1 of 2 solvedeasy
About this challenge

Write the kitchen scale's batch helpers: full trays, leftover cookies, the exact average portion weight and whole kilograms, using C++ integer and floating arithmetic.

Solved in a browser IDE and graded by tests. Sign up to solve

Scale Reading Types

Sign up to unlock
—No data yeteasy
About this challenge

Make three sensor helpers with deduced return types produce exactly the types the display expects: a wide tick count, a fractional percentage and a single character.

Solved in a browser IDE and graded by tests. Sign up to solve

Baking Tray Areas

Sign up to unlock
—No data yeteasy
About this challenge

Add an int overload of tray_area so square trays measured in whole tiles report an int tile count, while the double version keeps working.

Solved in a browser IDE and graded by tests. Sign up to solve

Nutrition Label Rounding

Sign up to unlock
—No data yeteasy
About this challenge

Write the label printer's rounding helpers with the standard rounding functions: two decimals with halves away from zero, rounding down, rounding up and nearest whole gram.

Solved in a browser IDE and graded by tests. Sign up to solve

Unit Converter

STAR
Solving it completes the module
—No data yeteasy
About this challenge

Build the kitchen scale's conversion module: typed temperature overloads, integer time splits, deduced-type helpers and standard rounding for ounces, cups, days and tare corrections.

Solved in a browser IDE and graded by tests. Sign up to solve

About this path

Learn modern C++23 from fundamentals to advanced concepts, covering types, functions, memory, OOP, templates, and concurrency.

Frequently asked questions

4

What will I practice in this path?

6 modules: Types & Functions, Control Flow & Loops, Strings & string_view, References & const, Vectors & Arrays and Structs & Enums.

How many C++ exercises are there, and how hard are they?

26 exercises, all easy.

What does this path run on?

Challenges run on C++.

Do I need to install anything?

No. Every challenge runs in a browser-based IDE with everything already set up, and your code is graded automatically against a test suite.

We use cookies that are necessary to run Staffcoder, and optional analytics cookies to see which pages get used. Analytics stays off unless you accept. Read our Cookie Policy.