From 0b700974cc11a5922242346b46fb9fb008726b34 Mon Sep 17 00:00:00 2001 From: HuseynAghazada08 Date: Fri, 18 Sep 2026 02:59:39 +0400 Subject: [PATCH 1/4] 1: homework 01 - library management system --- .../homework-01-library-management-system.cpp | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/1-CLASSES-OBJECTS-AND-DATA-STRUCTURES/homework/homework-01-library-management-system.cpp b/1-CLASSES-OBJECTS-AND-DATA-STRUCTURES/homework/homework-01-library-management-system.cpp index 4a06271..b90923a 100644 --- a/1-CLASSES-OBJECTS-AND-DATA-STRUCTURES/homework/homework-01-library-management-system.cpp +++ b/1-CLASSES-OBJECTS-AND-DATA-STRUCTURES/homework/homework-01-library-management-system.cpp @@ -36,6 +36,26 @@ using namespace std; /* Solution */ +class Book{ + private: + string title = ""; + string author = ""; + int year = 0; + string ISBN = ""; + public: + void setBookDetails(string titleP, string authorP, int yearP, string ISBNP){ + title = titleP; + author = authorP; + year = yearP; + ISBN = ISBNP; + } + void displayBookDetails(){ + cout << "title: " << title << endl; + cout << "author: " << author << endl; + cout << "year: " << year << endl; + cout << "ISBN: " << ISBN << endl; + } +}; From d9f8a680e7ee69b6d997f665cc05d1d560aaee8b Mon Sep 17 00:00:00 2001 From: HuseynAghazada08 Date: Fri, 18 Sep 2026 03:10:46 +0400 Subject: [PATCH 2/4] 1: homework 02 - employee management system --- ...homework-02-employee-management-system.cpp | 40 ++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/1-CLASSES-OBJECTS-AND-DATA-STRUCTURES/homework/homework-02-employee-management-system.cpp b/1-CLASSES-OBJECTS-AND-DATA-STRUCTURES/homework/homework-02-employee-management-system.cpp index 5899341..43d28a8 100644 --- a/1-CLASSES-OBJECTS-AND-DATA-STRUCTURES/homework/homework-02-employee-management-system.cpp +++ b/1-CLASSES-OBJECTS-AND-DATA-STRUCTURES/homework/homework-02-employee-management-system.cpp @@ -38,7 +38,45 @@ using namespace std; /* Solution */ - +class Employee{ + private: + int Id; + string name; + string designation; + double salary; + public: + Employee(){ + Id = 0; + name = ""; + designation = ""; + salary = 0.0; + } + Employee(int IdP, string nameP, string designationP, double salaryP){ + Id = IdP; + name = nameP; + designation = designationP; + salary = salaryP; + } + void setID(int idp){ + Id = idp; + } + void setName(string nameparam){ + name = nameparam; + } + void setDesignation(string deparam){ + designation = deparam; + } + void setSalary(double salaryparam){ + salary = salaryparam; + } + void displayDetails(){ + cout << "Id number: " << Id << endl; + cout << "name: " << name << endl; + cout << "designation: " << designation << endl; + cout << "salary: " << salary << endl; + } + +}; int main() { From e46b7604612d309ad6e1ad41f0f922a0931d8812 Mon Sep 17 00:00:00 2001 From: HuseynAghazada08 Date: Sat, 19 Sep 2026 03:19:02 +0400 Subject: [PATCH 3/4] 1: homework 03 - bank account encapsulation --- ...homework-03-bank-account-encapsulation.cpp | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/1-CLASSES-OBJECTS-AND-DATA-STRUCTURES/homework/homework-03-bank-account-encapsulation.cpp b/1-CLASSES-OBJECTS-AND-DATA-STRUCTURES/homework/homework-03-bank-account-encapsulation.cpp index b6f503a..3eb555a 100644 --- a/1-CLASSES-OBJECTS-AND-DATA-STRUCTURES/homework/homework-03-bank-account-encapsulation.cpp +++ b/1-CLASSES-OBJECTS-AND-DATA-STRUCTURES/homework/homework-03-bank-account-encapsulation.cpp @@ -29,10 +29,25 @@ class BankAccount { // Constructor BankAccount(int accountNumber, const string &holderName, double initialBalance) { // TODO: Initialize member variables + this->accountNumber = accountNumber; + this->holderName = holderName; + balance = initialBalance; } - + // Member functions + // TODO: Implement member functions for deposit, withdraw, and check balance + void deposit(double amount1){ + + balance = balance + amount1; + } + void withdraw(double amount2){ + balance = balance - amount2; + } + void checkBalance() const{ + cout << "Balance is: " << balance << endl; + } + }; @@ -55,6 +70,11 @@ int main() { This exercise will help you practice encapsulation and understand how to hide implementation details while exposing a controlled interface to the users of your class! */ + BankAccount account1(1, "Huseyn Aghazada", 550.5); + account1.checkBalance(); + account1.deposit(12.5); + account1.withdraw(26.7); + account1.checkBalance(); return 0; } From e08eacfdbe55110647b72b70264c4f2511f4e58b Mon Sep 17 00:00:00 2001 From: HuseynAghazada08 Date: Sat, 19 Sep 2026 03:24:34 +0400 Subject: [PATCH 4/4] 1: homework 04 - employee setters and getters --- ...mework-04-employee-setters-and-getters.cpp | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/1-CLASSES-OBJECTS-AND-DATA-STRUCTURES/homework/homework-04-employee-setters-and-getters.cpp b/1-CLASSES-OBJECTS-AND-DATA-STRUCTURES/homework/homework-04-employee-setters-and-getters.cpp index 8e4975f..6bbc316 100644 --- a/1-CLASSES-OBJECTS-AND-DATA-STRUCTURES/homework/homework-04-employee-setters-and-getters.cpp +++ b/1-CLASSES-OBJECTS-AND-DATA-STRUCTURES/homework/homework-04-employee-setters-and-getters.cpp @@ -44,6 +44,30 @@ class Employee { public: // TODO: Implement setters and getters + void setname(const string& name){ + this->name = name; + } + void setage(int age){ + this->age = age; + } + void setPosition(const string& position){ + this->position = position; + } + void setSalary(double salary){ + this->salary = salary; + } + string getname() const{ + return name; + } + int getage() const{ + return age; + } + string getPosition() const{ + return position; + } + double getSalary() const{ + return salary; + } }; @@ -51,7 +75,15 @@ class Employee { int main() { // TODO: Test the Employee class by creating an object, setting attributes, and getting attribute values - + Employee employee1; + employee1.setage(26); + employee1.setname("Huseyn"); + employee1.setPosition("Ceo"); + employee1.setSalary(3625); + cout << "employee's name: " << employee1.getname() << endl; + cout << "employee's age: " << employee1.getage() << endl; + cout << "employee's position: " << employee1.getPosition() << endl; + cout << "employee's salary: " << employee1.getSalary() << endl; return 0; }