Skip to content

A collection of my C++ programming assignments, demonstrating fundamental concepts and problem-solving skills.

Notifications You must be signed in to change notification settings

itsok2023/cpp_language

Repository files navigation

🎯 C++ Assignments Repository

Welcome to my C++ Programs Repository!
This repository contains all the assignments and practice programs I’ve completed as part of my learning journey in Computer Engineering.

📘 Each assignment is organized and documented with a short description and a direct link to the source code.
This is meant to serve as a reference for students, beginners, and anyone learning C++ programming.


📂 Assignments

📝 Assignment 1: Object Oriented Programming

Implementation of a person class to demonstrate classes, objects, default constructors, and parameterized constructors.

View Code


📝 Assignment 2: Classes and Member Functions

A program demonstrating an alternative way to initialize object data using a public member function (ScanData) instead of a constructor.

View Code


📝 Assignment 3: Constructors in C++

Implementation of a person class to demonstrate classes, objects, default constructors, and parameterized constructors.

View Code


📝 Assignment 4: Encapsulation with Getters and Setters

Demonstrates the OOP principle of encapsulation using a Person class with public getter and setter methods to access and modify private data.

View Code


📝 Assignment 5: Data Validation in Classes

Enhances the Person class by adding input validation logic within constructors and setter methods to ensure data integrity.

View Code


📝 Assignment 6: Dynamic Memory and Destructors

A program demonstrating how to manage dynamic memory within a class using new in constructors and delete/delete[] in a destructor to prevent memory leaks.

View Code


📝 Assignment 7: Dynamic Memory with Getters and Setters

An Employee class that uses getters and setters for dynamically allocated data, showing how to correctly deallocate and reallocate memory in a setter to prevent memory leaks.

View Code


📝 Assignment 8: Shallow Copy vs. Deep Copy

Illustrates the critical difference between a default shallow copy and a manual deep copy. This is crucial when a class contains pointers to dynamically allocated memory to prevent runtime errors like dangling pointers and double-free exceptions.

View Code


📝 Assignment 9: Types of Inheritance

A comprehensive example demonstrating single, multilevel, and hierarchical inheritance. It builds a class hierarchy from Person to Developer and its subtypes, also showing the use of protected members and constructor chaining.

View Code


About

A collection of my C++ programming assignments, demonstrating fundamental concepts and problem-solving skills.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages