Udemy
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
C++ for Beginners: Programming, OOP & Coding Exercises
Rating: 4.0 out of 5(65 ratings)
244 students

C++ for Beginners: Programming, OOP & Coding Exercises

Learn C++ variables, loops, arrays, functions and OOP, then practise input rules, score summaries and numeric types.
Last updated 10/2026
English
English [Auto],

What you'll learn

  • Write C++ control flow using conditions, loops and arrays.
  • Organise a calculation into functions and test its expected result.
  • Explain classes, encapsulation, inheritance and polymorphism at an introductory level.
  • Summarise sample scores using explicit input rules and boundary cases.
  • Explain how numeric types and integer division affect an average.

Coding Exercises

This course includes our updated coding exercises so you can practice your skills as you learn.

See a demo
Image of coding exercise example

Course content

9 sections • 52 lectures • 4h 56m total length
  • Installing Codeblocks - IDE for C++ Development16:20

    Install CodeBlocks with MinGW and Dev C++ to set up a C++ development environment, write and compile hello world, and understand executable versus source code.

  • Variables15:56

    View variables as store locations with symbolic names that hold values and can change during program execution. Learn through simple C examples of integers, assignments, and basic operations.

  • 3 Tips to Get Even More Value Out of this Course0:53
  • Data Types11:18

    Explore core data types in programming—bool, int, char, float, double, and string—along with memory implications, strong versus weak typing, and the difference between assignment and equality.

  • Variable Operators8:54

    Master C++ variables by declaring, storing, and updating values, then apply arithmetic, relational, and logical operators, including remainder, to build expressions and boolean decisions.

  • Write a simple "Hello World" Program
  • Solution to the "Hello World" Coding Problem0:04

Requirements

  • No previous C++ course is necessary. You should be comfortable managing source files and willing to test short examples repeatedly.
  • For local practice, use a C++ compiler and code editor compatible with the lessons. A separate sample folder helps you keep experiments and working versions organised.
  • Basic arithmetic will help with score and average examples. More advanced mathematics is not required for the introductory programming tasks.

Description

Learn C++ fundamentals by combining explanations with small coding problems and a practical score-summary exercise. This course moves from variables and control flow to functions and object-oriented ideas, with a separate SQL section for learners who want introductory database exposure.

Follow the development-environment demonstration, then work with types, operators, conditions, loops, arrays and file input and output. Object-oriented lessons introduce classes, methods, encapsulation, inheritance and polymorphism. Exercises provide opportunities to attempt a solution before comparing it with the accompanying explanation.

What to practise

  • Translate a short requirement into inputs, steps and an expected result.

  • Trace an array or loop without losing track of its valid range.

  • Explain a function's responsibility and how it receives or returns information.

  • Choose types deliberately when calculating a total or an average.

The final reading labs bring these ideas together. Define valid score input, summarise the data and compare ordinary and boundary cases. A separate activity examines C++ averages and the effect of type choices. Keeping the expected answer beside your code makes it easier to spot a result that looks plausible but is wrong.

Choose this course if you are starting C++ or returning to basic programming and want lessons supported by exercises. The curriculum also contains database topics, so review the balance if your priority is a particular language area.

Allow time to compile and change the examples in your own practice project. Recorded editor screens and tool versions may differ from your setup; consult current compiler documentation when needed. The focus is building a foundation you can explain and extend, rather than completing a large production application.

Making C++ logic visible through practice

A beginner C++ programme can combine several ideas even when it is only a few lines long. A value has a type, a condition chooses a path and a function produces a result. This course introduces those building blocks and then extends the discussion to objects, files and databases. The reading workshops provide focused opportunities to inspect input rules and numerical results. The intention is an introductory foundation you can explain, not a promise of exhaustive coverage of the entire C++ language or advanced application architecture.

Working with values deliberately

The variables and data-types lessons give you a place to connect representation with a task. A count, a score and an average may need different treatment. Before performing a calculation, state what each value means and what result you expect. This is useful when a program compiles but gives an unexpected number. You can investigate whether the problem concerns the formula, the chosen types or the input assumption. That is more informative than changing several expressions at once until one example appears to work.

Choosing between cases

Conditional logic turns a requirement into a decision. Write the cases in plain language before translating them into C++ syntax. If a score is accepted within a range, the values at the range boundaries deserve attention. A rule that works for an obvious middle value may still classify an edge incorrectly. The recorded examples support this kind of small investigation. Keep your expected result separate from the program's actual result so that a surprising output leads to a question rather than an automatic change in your expectation.

Loops and arrays

The repeated-processing sections introduce a common relationship: visit a collection and do something with its values. Identify which positions are valid and how the loop progresses through them. Trace the first and final expected visits. If you are summarising data, also identify the value that carries the partial result. This makes the algorithm easier to explain and gives you a way to locate a mistake. The course is a foundation for that reasoning, not a comprehensive treatment of every container, iterator or performance technique available in modern C++.

Functions as manageable units

A function is useful when it has a responsibility that can be stated clearly. Ask what it receives, what it returns and which assumptions it makes. The course introduces functions alongside file-related material so that you can begin separating tasks within a program. In practice, check a small calculation independently before combining it with more input or display logic. If an operation changes information beyond its result, include that in your explanation. Clear boundaries make it easier to compare an intended task with the implementation you are studying.

Understanding objects

The OOP section introduces classes, methods, encapsulation, inheritance and related ideas. Connect each term with a concrete role in an example. An object represents something, stores state and exposes operations according to rules. A useful explanation distinguishes that instance from the class that defines it. The beginner material gives you vocabulary for organising code without requiring a large design. Use it to make behaviour clearer, rather than adding complexity simply because a concept sounds more advanced.

The score-summary reading lab

The practical article asks you to summarise scores using clear input rules. This gives validation and boundary cases a purpose. Define which values belong in the calculation before deciding how to total them. A missing or invalid value should not quietly become an ordinary score without a stated rule. Keep a small table of sample inputs and expected summaries. This is a reading workshop you can extend independently, not a claim that the course includes a full assessment application or a production reporting system.

Why numeric types matter to averages

The additional article on averages focuses attention on a result that can look plausible while losing information. Integer division and the type used for a calculation can affect the answer. Explain the result you intend before trusting a number printed by the program. Choose a small dataset whose average you can calculate by hand, then compare it with the code's output. The useful skill is recognising that a correct-looking formula still depends on representation and evaluation rules. This gives the earlier type lessons a concrete practical connection.

Where to go after the foundation

The SQL extension introduces database concepts as a broader view of stored information. It does not make this a complete database-development course. Choose the curriculum if you want a structured first pass through C++ logic and OOP with exercises you can investigate. A compatible compiler, an editor and time for small experiments will help. Your next step can then be chosen deliberately: more language features, additional projects or deeper work on data structures. The foundation is strongest when it leaves you able to explain your own examples and the assumptions behind their results.

Curriculum at a glance

  • Variables & Data Types

  • If-Statements and Conditional Logic

  • Loops and Iteration

  • Arrays

  • Functions & Files

  • Object-oriented Programming

  • Beyond C++: From C++ to SQL - Using Databases to Store Data

Who this course is for:

  • You want a first C++ course covering control flow, arrays, functions and the vocabulary of object-oriented programming.
  • You have written a few programs but want to become more systematic about input rules, expected results and small test cases.
  • You are moving from another beginner language and want to see how familiar programming ideas appear in C++.
  • You enjoy numerical exercises and want to understand how data types and integer division affect a calculated result.