Programming Fundamentals Using C++

Laboratory Manual

16 graded 2-hour laboratory sessions, one per week, aligned module-for- module with the 16 modules and 32 lectures (Lab n ↔ Module n ↔ lectures 2n−1, 2n; see ../COURSE_SCHEDULE.md). Labs are the graded practice layer between case studies and assignments: every session moves from guided work → independent programming → debugging, ending with check-points and a submission.

Labs are worth 10 % of the course grade (checkpoint-based; see COURSE_OVERVIEW.md § 4). TAs follow the "guidance, not solutions" rules in TEACHING_GUIDE.md § 5.

Lab plan

#LabModule / LecturesWeekGuided focus → Independent focus
1First C++ ProgramM1 · L01–L021Toolchain → edit-compile-run cycle
2Variables and CalculationsM2 · L03–L042Types & formatted I/O → a unit-price calculator
3OperatorsM3 · L05–L063Precedence & conversion → expression workbench
4Decision-MakingM4 · L07–L084if/else & switch → a validated tariff program
5LoopsM5 · L09–L105Loop patterns → accumulation & validation loops
6Algorithm DesignM6 · L11–L126IPO + trace tables → test-case design sprint
7FunctionsM7 · L13–L147Decomposition → tested function library
8Recursion and ReferencesM8 · L15–L168Passing modes → recursive function set
9One-Dimensional ArraysM9 · L17–L189Array loops → statistics toolkit
10Two-Dimensional ArraysM10 · L19–L2010Grid traversal → matrix operations program
11StringsM11 · L21–L2211char/string processing → text-analysis tool
12Searching and SortingM12 · L23–L2412Traced sorts → benchmarking search cost
13PointersM13 · L25–L2613Pointer mechanics → safe-pointer toolkit
14Structures and Dynamic MemoryM14 · L27–L2814new/delete & structs → records program
15File Handling and ExceptionsM15 · L29–L3015Streams → robust file pipeline
16OOP Mini-ProjectM16 · L31–L3216Class design → graded mini-project demo

Outcomes for each lab cite the module's PF-m.n codes — see LEARNING_OUTCOMES.md.

Layout

labs/
├── README.md                     ← this file
├── lab_manuals/
│   ├── lab_01/                   ← manual (student-facing)
│   │   ├── manual.md             ← the 13-section lab document
│   │   ├── starter_code/         ← compilable skeletons (contract applies)
│   │   └── instructor_notes/     ← TA checklist (restricted)
│   ├── … lab_16
│   └── README.md                 ← folder guide
└── resources/                    ← shared lab resources
    ├── submission_template.md    ← report skeleton for every lab
    └── debug_log_template.md     ← five-step debug log (Lab 4 onward)

Manual template (13-section authoring contract)

Every manual.md contains, in order:

  1. Header (number, title, week, duration, lecture links)
  2. Learning objectives
  3. Required software and compiler (per-OS contract)
  4. Relevant theory (condensed, linked to lecture notes)
  5. Pre-lab questions
  6. Instructor demonstration
  7. Guided coding tasks (with check-points)
  8. Independent programming exercises
  9. Debugging task
  10. Test cases
  11. Expected learning outcomes
  12. Submission requirements
  13. Assessment rubric

Progression model

Safety notes (memory management)

Labs 13–14 teach pointers and new/delete with explicit hazard explanations: every manual that touches dynamic memory names the hazards (leak, use-after-delete, double-delete), demonstrates the guard pattern (null-out after delete), and shows the course-preferred RAII alternative (std::vector) side-by-side. No unexplained unsafe practice appears in any manual or starter file.

Status

✅ All 16 manuals, starter code, and TA notes authored; starter programs compile warning-free and were executed (evidence: ../docs/LAB_AUDIT.md).

The sixteen labs

  1. Lab 1 · First C++ Program
  2. Lab 2 · Variables and Calculations
  3. Lab 3 · Operators
  4. Lab 4 · Decision-Making
  5. Lab 5 · Loops
  6. Lab 6 · Algorithm Design
  7. Lab 7 · Functions
  8. Lab 8 · Recursion and References
  9. Lab 9 · One-Dimensional Arrays
  10. Lab 10 · Two-Dimensional Arrays
  11. Lab 11 · Strings
  12. Lab 12 · Searching and Sorting
  13. Lab 13 · Pointers
  14. Lab 14 · Structures and Dynamic Memory
  15. Lab 15 · File Handling and Exceptions
  16. Lab 16 · OOP Mini-Project
Programming Fundamentals Using C++ · C++17 · 16 weeksBack to top ↑