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
- Getting Started โ install a C++ compiler (Windows ยท Linux ยท macOS ยท or use an online compiler), then compile the courseโs sanity-check program.
- How to Study โ the read โ run โ modify โ solve โ debug โ revise method. Two minutes to read; the whole course works better with it.
- 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:
- 16 units ยท 32 sessions โ one unit per week at 5โ7 hours/week, or your own pace.
- Every concept has examples you run, modify, and break.
- Every unit has exercises, a lab with starter + solution, a quiz with a full answer key, debug activities, challenges, and a revision sheet.
- Three projects (Weeks 5, 10, 16) consolidate your skills, ending with a capstone: a Contact Management System.
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.
Essential links
| ย | ย |
|---|---|
| ๐งญ 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