Programming Fundamentals Using C++

Welcome! This is the online home of a complete, free, self-study course. Repository: nadeem-majeedch/Programming-Fundamentals-Using-C-

๐Ÿš€ Start here โ€” 30 minutes to your first program

  1. Getting Started โ€” install a C++ compiler (Windows ยท Linux ยท macOS ยท or use an online compiler), then compile the courseโ€™s sanity-check program.
  2. How to Study โ€” the read โ†’ run โ†’ modify โ†’ solve โ†’ debug โ†’ revise method. Two minutes to read; the whole course works better with it.
  3. Lesson 1 โ€” what a program looks like, and your first C++ program.

Thatโ€™s it โ€” youโ€™re a programmer in training.


What this course is

A beginner-to-advanced journey through programming fundamentals, taught entirely in C++, designed so you can study it without an instructor:

The full plan: Syllabus.


Course map

Stage Units You learn toโ€ฆ
Foundations 01โ€“03 write, run, and understand your first programs; variables, types, arithmetic, input/output โ€” deep-dive: C++ Foundations module
Control flow 04โ€“06 make decisions, repeat work, and design loops (+ Project 1)
Structure 07โ€“09 decompose problems into functions; manage collections of data
Algorithms & data 10โ€“12 search, sort, process text, and store files (+ Project 2)
Memory & objects 13โ€“15 pointers, dynamic memory, classes, and object-oriented design
Capstone 16 complete a real project integrating everything (+ Project 3)

Full week-by-week table: Syllabus.


How the course fits together

        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚ Unit pages  โ”‚  index โ†’ lessons โ†’ practice
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
   โ–ผ      โ–ผ         โ–ผ          โ–ผ         โ–ผ           โ–ผ
lessons  examples  exercises  lab     quiz       revision
(session) (.cpp    (3 kinds)  (starter (10 Q +   (flashcards
 pages    files)              +solution debug    + checklist)
                              +Debug It) activities)

Every piece exists so you can check your own work โ€” the course never leaves you stuck.


ย  ย 
๐Ÿงญ Study method How to Study ยท Study Guide
๐Ÿ›ซ Week-0 module Getting Started lesson ยท Setup checklist ยท First-program exercise ยท Troubleshooting
๐Ÿง  Problem-solving module Think before you code: 20 worked scenarios + lab
๐Ÿ”ง C++ Foundations module Language toolkit: structure, types, operators, conversions + 60+ practice items, lab, quiz
๐Ÿ’ฌ C++ Input/Output module The conversation: cout, cin, formatting, the buffer, getline, the mixing trap + 5 labs
๐Ÿ”€ Decisions module Requirements โ†’ logic: if/else-if/nested, switch, ternary, decision tables, boundaries + 8 labs
๐Ÿ” Iteration module Repeat with purpose: while/do-while/for, counters, accumulators, sentinels, break/continue, nesting + 10 labs and a mini-project
๐Ÿงฉ Functions module Breaking problems into machines: parameters, returns, scope, references, overloading, refactoring + 10 refactor exercises, 8 labs, and a toolkit mini-project
๐Ÿ“ฆ Arrays module Many values, one name: boxes and bounds, the classic passes, arrays with functions, matrices + 7 labs and the Marks Analyzer mini-project
๐Ÿ”ค Strings module Working with text: the two ways to hold text, indexing, find/substr, cctype, conversions + 26 exercises, 7 labs and the Text Analysis Toolkit mini-project
๐Ÿ“ Files module Data that outlives the program: ifstream/ofstream/fstream, open-check-close, line-based vs formatted reading, CSV, record storage, file errors + 18 exercises, 10 debugging hunts, 10 challenges, 6 file labs and the File-Based Student Management System
๐Ÿ“ Pointers module Addresses, arrows, and ownership: &/*, references, out-parameters, dynamic memory with new/delete, the three failure families + 10 memory-tracing drills, 4 safe labs and the Quiz Runner mini-project
๐Ÿ—‚๏ธ Records module Organizing related data: struct, members, initialization, arrays of records, nesting, passing/returning, enum and enum class + 22 exercises, 10 debugging hunts, 6 record-keeping labs and the Student Record Management System
โš™๏ธ Algorithms module Recursion, searching & sorting: base cases and the call stack, factorial/Fibonacci/digit recursion, linear and binary search, bubble/selection/insertion sort, complexity intuition + 32 exercises, 15 hand traces, 10 debugging hunts, 15 challenges, the Algorithm Performance and Comparison Lab, and the Project 2 brief
๐Ÿž Debugging & Testing module Finding bugs and preventing them: the error taxonomy, reading diagnostics, the debugging workflow, breakpoints/stepping/inspection, assertions, boundary & invalid-input testing, regression testing, defensive programming + 20 broken programs and the Debugging Challenge Lab
๐Ÿ›๏ธ OOP module From procedures to objects: classes, encapsulation, constructors/destructors, this, const member functions, composition, class design, operator<<, vectors of objects โ€” no inheritance by design + 26 exercises, 10 design drills, 7 labs and the Object-Oriented Mini Project
๐Ÿงฌ Inheritance & Polymorphism module Building on classes: base/derived, protected, constructor order, virtual dispatch, abstract classes, interfaces, the composition-vs-inheritance decision + 22 exercises, 10 debugging hunts, 10 design judgements, 5 hierarchy labs and the Media Library mini-project
โšก Operator Overloading & Templates module (advanced) Code that works for many types: member vs non-member operators, comparison and stream operators, function and class templates, generic contracts, honest limitations + 20 exercises, 8 debugging hunts, 6 design problems, 8 challenges, 5 labs โ€” explicitly optional enrichment
๐Ÿ“ฆ Standard Template Library module (advanced) The library youโ€™ve been reaching for: vector/array/deque/list, stack/queue/priority_queue, set/map and their unordered cousins, iterators and ranges, the workhorse algorithms, introductory lambdas, the choice table + 25 exercises, 10 debugging hunts, 15 challenges, 6 labs and the Media Catalogue mini-project โ€” optional enrichment after the capstone
๐Ÿ›ก๏ธ Robustness module (advanced) Errors, exceptions, and programs that refuse to lie: try/catch/throw, the standard and custom exception families, exception safetyโ€™s four levels, validation layering, the silent-failure gallery + 15 exercises, 10 debugging hunts, 10 challenges, 8 earlier-lab refactors and the Robust Student/Bank/Inventory Application lab โ€” optional enrichment after the capstone
โœจ Modern C++ module What to know, what to adopt: the fundamentals every student should know (const correctness, references, nullptr, enum class, range-for, lambdas, library-first) separated from the modern practices to adopt (RAII, auto with restraint, constexpr, unique_ptr/shared_ptr, move semantics conceptually, retiring raw new/delete) + 18 exercises, 8 debugging hunts, 6 challenges and the Modernisation Lab โ€” the Unit 16 toolkit, capstone-ready
๐Ÿงฉ Modular Programming module From one file to organized programs: declarations vs definitions, header/source split, include guards, namespaces, separate compilation and linking, multi-file command-line builds, project layout, modular design, circular dependencies + a complete multi-file example project, 15 exercises, 10 debugging hunts, 8 organization tasks and the Modular Programming Lab โ€” capstone prep
๐Ÿ“… Plan 16-Week Roadmap ยท Syllabus
๐Ÿง  Learn how to learn How to Learn Programming: the skills guide โ€” reading code, typing instead of copying, predicting, debugging, the Recommended Study Cycle (Read โ†’ Predict โ†’ Code โ†’ Run โ†’ Test โ†’ Debug โ†’ Explain โ†’ Extend), the notebook, the portfolio, escaping tutorial dependency
๐Ÿงช Labs & projects Assessment ยท Grading rubrics
๐Ÿ”ฌ Programming Labs 42 scenarios in five levels: beginner to integrated โ€” billing, student systems, inventory, banking, library, text analysis, scheduling, data processing โ€” each with requirements, test cases, hints, complete solution, explanation, and a testing checklist
๐Ÿ—๏ธ Projects 10 builds from beginner to integrated: calculator โ†’ number analysis โ†’ grade analyzer โ†’ expense tracker โ†’ quiz app โ†’ inventory โ†’ library โ†’ contacts โ†’ file-based student system โ†’ integrated OOP system โ€” each with milestones, test plan, edge cases, rubric, hints, reference solution, and design notes
๐Ÿงฎ Practice Bank 200 categorized problems in five tiers: beginner โ†’ basic โ†’ intermediate โ†’ advanced โ†’ challenge across 17 topics โ€” every problem with statement, difficulty, topics, I/O, constraints, sample tests, graded hints, reference solution, and explanation, plus a progress checklist
๐Ÿ“ Self-Assessment System 34 instruments ยท 366 questions: 16 weekly quizzes, 8 topic revision tests, 4 cumulative tests, 2 comprehensive practice finals โ€” every question with difficulty label, hidden answer key, and explanation, plus scoring bands and a post-exam worksheet
๐Ÿ“– Reference Glossary ยท Compiler error catalogue ยท FAQ ยท Completion checklist
๐Ÿงฐ Tools VS Code tips ยท Online compilers
๐Ÿ‘จโ€๐Ÿซ Instructor About Dr. Muhammad Nadeem Majeed
๐Ÿ“„ Licence MIT โ€” free to study, adapt, and share with attribution

About the instructor

This course is written and maintained by Engr. Dr. Muhammad Nadeem Majeed, Professor, Department of Data Science (PUCIT), University of the Punjab, Lahore โ€” read more on the About page.


*Ready? โ†’ Getting Started