Skip to main content
Advanced Search
Search Terms
Content Type

Exact Matches
Tag Searches
Date Options
Updated after
Updated before
Created after
Created before

Search Results

69 total results found

6. SOLID Principles

Alprog - Elektro KKI Module 8 : OOP (SOLID, Encapsulation, A...

6.1 Introduction to SOLID SOLID is an acronym for five design principles that make software designs more understandable, flexible, and maintainable. Letter Principle Core Idea S Single Responsibility A class should have one reason to change O Open/Clo...

7. Constructors and Destructors

Alprog - Elektro KKI Module 8 : OOP (SOLID, Encapsulation, A...

7.1 Constructors Purpose: Special member function that initializes an object when it's created. Types of Constructors: #include <iostream> #include <string> using namespace std; class Student { private: string name; int id; float gpa; public:...

1. Basic Concepts of Inheritance

Alprog - Elektro KKI Modul 9: OOP - Inheritance

1.1 What is Inheritance? Inheritance is a mechanism where a class (derived/child class) can inherit properties and methods from another class (base/parent class). Real-World Analogy: Think of inheritance like family traits: A child inherits characteristics fr...

2. Types of Inheritance and Method Overriding

Alprog - Elektro KKI Modul 9: OOP - Inheritance

2.1 Single Inheritance Definition: One derived class inherits from one base class. #include <iostream> #include <string> using namespace std; class Person { protected: string name; int age; public: Person(string n, int a) : name(n), age(a) {}...

3. Practical Applications and Best Practices

Alprog - Elektro KKI Modul 9: OOP - Inheritance

3.1 Complete Example: University Management System #include <iostream> #include <vector> #include <string> using namespace std; // Base class class Person { protected: string name; int id; int age; public: Person(string n, int i, int a) :...

1. Basic Concepts of Polymorphism

Alprog - Elektro KKI Module 10 : OOP - Polymorphism

1.1 What is Polymorphism? Polymorphism means "many forms" - the ability of objects to take on multiple forms or behave differently based on their type. Real-World Analogy: Think of a smartphone's "share" button: Share a photo → Opens image sharing options Sha...

2. Compile-Time Polymorphism

Alprog - Elektro KKI Module 10 : OOP - Polymorphism

2.1 Function Overloading Definition: Multiple functions with the same name but different parameters. #include <iostream> #include <string> using namespace std; class Printer { public: // Overloaded print functions void print(int value) { cout ...

3. Runtime Polymorphism

Alprog - Elektro KKI Module 10 : OOP - Polymorphism

3.1 Virtual Functions Definition: Functions that can be overridden in derived classes and are resolved at runtime. #include <iostream> #include <string> using namespace std; class Animal { protected: string name; public: Animal(string n) : name(n...

4. Practical Applications

Alprog - Elektro KKI Module 10 : OOP - Polymorphism

4.1 Complete Example: Drawing Application #include <iostream> #include <vector> #include <string> #include <cmath> using namespace std; // Abstract base class class Shape { protected: string color; double x, y; // Position public: Shape(stri...