Skip to content
This repository was archived by the owner on Nov 3, 2026. It is now read-only.

About

C++ programming fundamentals and object-oriented programming exercises from my first two semesters at UBIT, University of Karachi.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

C++ logo C++ Learning Archive

Weekly PF assignments and OOP textbook practice from my first year at UBIT.

I'm sharing the code I wrote during my first two semesters of BS Software Engineering at the University of Karachi. It's here for juniors to work through, compare with their own attempts, and practise the same concepts.

PF assignments  ·  OOP exercises  ·  How to practise  ·  Run a program

Programming Fundamentals

An open assignment notebook and pencil

Semester 01 · Weekly assignments and homework

These are my solutions to the questions given by Sir Farhan Ahmed Siddiqui. The work is organized by week, covering input/output, conditions, loops, number problems, arrays, functions, and sorting.

Sir Farhan is the best teacher I've had the chance to study with. I'm grateful to have learned Programming Fundamentals from him, and wanted to keep the work from his course available for the batches after ours.

Browse the PF assignments →  ·  32 C++ files

Object-Oriented Programming

Semester 02 · Robert Lafore's book examples and exercises

Our OOP coursework followed Object-Oriented Programming in C++, 4th Edition by Robert Lafore. This folder contains my implementations of the examples and exercises from chapters 06–11: objects and classes, arrays and strings, operator overloading, inheritance, pointers, and virtual functions.

Each chapter has separate examples/ and exercises/ folders. The additional OOP practice holds 16 more examples, including templates, interfaces, validation, and composition. The original source files are preserved, including question-answer programs and unfinished exercises.

Browse the OOP coursework →  ·  183 C++ files

Jump to a week or chapter

PF weeks: 01 · 02 · 03 · 04 · 05 · 08 · 10 · 12

OOP chapters: 06 · Classes · 07 · Arrays & strings · 08 · Overloading · 09 · Inheritance · 10 · Pointers · 11 · Virtual functions

How to practise

  1. Pick the question you're working on. Open the relevant week or chapter, with your assignment sheet or book beside you.
  2. Try it before reading the solution. Work out the logic and expected output for a small input, then compare your approach with mine.
  3. Run it and change something. Try another input, trace a loop, or add a method to a class. Check what changes and why.

Follow your current teacher's instructions and course outline when deciding what to cover. Use these files as a reference while building your own understanding.

Run a program

MinGW-w64 logo

Use g++ with C++11 support, such as a GCC/MinGW toolchain on Windows. Compile one .cpp file at a time; most have their own main().

Compile and run an example

After downloading or cloning this repository, open PowerShell in its root folder:

cd semester-01-programming-fundamentals/Week-01
g++ -std=c++11 -Wall -Wextra 01-hello-world.cpp -o hello.exe
.\hello.exe

On Linux or macOS, use -o hello and run ./hello. For another exercise, open its folder and replace 01-hello-world.cpp with that file's name.

From my batch to yours

UBIT, Department of Computer Science, University of Karachi emblem

I'm Shaikh Mahad Ud Din, a BSSE student at UBIT. I share my coursework and projects as I learn, alongside the notes and guides in The UBIT Hub Resources.

If this helps you through an assignment or a difficult chapter, pass the folder link to a classmate. If you find a mistake, email me with the filename and what went wrong. I'd be glad to hear how you approached the question, too.

Follow on GitHub mahad.dev — visit my portfolio Email me

Credits and license

The code is shared under the MIT License. The textbook and assignment PDFs are not included; use your class material or an authorized copy of the book for the questions.

The C++ logo is by Jeremy Kratz, licensed by the Standard C++ Foundation. The MinGW-w64 logo is by Dave Gauer under CC BY-SA 4.0, with a white background added here. The notebook illustration and contact artwork are adapted to a C++ blue palette from my resource repository. The UBIT emblem retains its original colors. The GitHub mark is from Primer Octicons, with its copyright notice retained in the SVG.


Maintained by Shaikh Mahad Ud Din · MIT License · Back to top ↑

About

C++ programming fundamentals and object-oriented programming exercises from my first two semesters at UBIT, University of Karachi.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages