├── Ders_Notlari ├── readme.md ├── Hafta_1-export.pdf ├── Hafta_10-export.pdf ├── Hafta_11-export.pdf ├── Hafta_12-export.pdf ├── Hafta_2-export.pdf ├── Hafta_3-export.pdf ├── Hafta_4-export.pdf ├── Hafta_5-export.pdf ├── Hafta_6-export.pdf ├── Hafta_7-export.pdf ├── Hafta_7_1-export.pdf ├── Hafta_8-export.pdf └── Hafta_9-export.pdf ├── README.md ├── Lab_Calismalari ├── README.md ├── 1_Kutuphane_1 │ ├── CMakeLists.txt │ ├── main.cpp │ └── Ilk_Baslik.h └── Baslik_Ornek │ ├── sensor.h │ ├── sensor.cpp │ └── main.cpp ├── Ders ├── 16_Inline │ ├── CMakeLists.txt │ └── main.cpp ├── 5_Class_1 │ ├── CMakeLists.txt │ └── main.cpp ├── 18_Pointer │ ├── CMakeLists.txt │ └── main.cpp ├── 3_Referans │ ├── CMakeLists.txt │ └── main.cpp ├── 1_Fonksiyona_Parametre_Gecme │ ├── CMakeLists.txt │ └── main.cpp ├── 14_Local_Class │ ├── CMakeLists.txt │ └── main.cpp ├── 19_statik_uye │ ├── CMakeLists.txt │ └── main.cpp ├── 29_Namespace_1 │ ├── CMakeLists.txt │ └── main.cpp ├── 30_Template_1 │ ├── CMakeLists.txt │ └── main.cpp ├── 31_Template_2 │ ├── CMakeLists.txt │ └── main.cpp ├── 33_Template_4 │ ├── CMakeLists.txt │ └── main.cpp ├── 4_Pointer_Dizi │ ├── CMakeLists.txt │ └── main.cpp ├── 6_Class_Public │ ├── CMakeLists.txt │ └── main.cpp ├── 17_This_Pointer │ ├── CMakeLists.txt │ └── main.cpp ├── 27_Kapsulleme_1 │ ├── CMakeLists.txt │ └── main.cpp ├── 32_Template_3 │ ├── CMakeLists.txt │ ├── main.cpp │ └── Dizi.h ├── 7_Class_Private │ ├── CMakeLists.txt │ └── main.cpp ├── 12_Friend_Class_1 │ ├── CMakeLists.txt │ └── main.cpp ├── 13_Friend_Class_2 │ ├── CMakeLists.txt │ └── main.cpp ├── 23_Polymorphism_1 │ ├── CMakeLists.txt │ └── main.cpp ├── 24_Polymorphism_2 │ ├── CMakeLists.txt │ └── main.cpp ├── 25_Polymorphism_3 │ ├── CMakeLists.txt │ └── main.cpp ├── 8_Class_Protected │ ├── CMakeLists.txt │ └── main.cpp ├── 15_Ic_Ice_Siniflar │ ├── CMakeLists.txt │ ├── main2.cpp │ ├── main3.cpp │ └── main.cpp ├── 26_Veri_Soyutlama_1 │ ├── CMakeLists.txt │ └── main.cpp ├── 28_Veri_Soyutlama_2 │ ├── CMakeLists.txt │ └── main.cpp ├── 2_Inline_Fonksiyon │ ├── CMakeLists.txt │ └── main.cpp ├── 35_Dosya_Islemleri │ ├── CMakeLists.txt │ └── main.cpp ├── 20_Miras_Inheritance │ ├── CMakeLists.txt │ └── main.cpp ├── 36_Dosya_Islemleri_2 │ ├── CMakeLists.txt │ └── main.cpp ├── 9_Class_Constructor_1 │ ├── CMakeLists.txt │ └── main.cpp ├── 10_Class_Constructor_2 │ ├── CMakeLists.txt │ └── main.cpp ├── 11_Class_Constructor_3 │ ├── CMakeLists.txt │ └── main.cpp ├── 21_Miras_Inheritance_2 │ ├── CMakeLists.txt │ ├── main.cpp │ └── readme.md ├── 34_Template_Buble_Sort_5 │ ├── CMakeLists.txt │ └── main.cpp ├── 22_Overloading_Asiri_Yukleme_1 │ ├── CMakeLists.txt │ └── main.cpp ├── 22_Overloading_Asiri_Yukleme_2 │ ├── CMakeLists.txt │ └── main.cpp ├── 22_Overloading_Asiri_Yukleme_3 │ ├── CMakeLists.txt │ └── main.cpp ├── 22_Overloading_Asiri_Yukleme_4 │ ├── CMakeLists.txt │ └── main.cpp ├── 17_This_Pointer_2 │ └── main.cpp ├── 21_Function_Overriding │ ├── main2.cpp │ └── main.cpp ├── 19_Static_uye_1 │ └── main.cpp ├── 21_Virtual_Function │ ├── main.cpp │ └── main2.cpp ├── 13_Friend_Fonksiyon_1 │ ├── main2.cpp │ ├── main3.cpp │ └── main.cpp ├── 15_Ic_Ice_Siniflar_1 │ └── main.cpp ├── 17_This_Pointer_3 │ └── main.cpp ├── 17_This_Pointer_4 │ └── main.cpp ├── 35_1_Dosya_Islemleri │ └── main.cpp ├── 4_Bellek_Yonetimi │ └── main.cpp ├── 33_Template_5 │ └── main.cpp ├── 21_Miras_Inheritance_4 │ └── main.cpp ├── 22_Overloading_Asiri_Yukleme_5 │ └── main.cpp ├── 5_Class_2 │ └── main.cpp ├── 22_Overloading_Asiri_Yukleme_6 │ └── main.cpp ├── 5_Class_3 │ └── main.cpp ├── 13_Friend_Class_3 │ └── main.cpp ├── 33_Template_7 │ └── main.cpp ├── 22_Overloading_Asiri_Yukleme_7 │ └── main.cpp ├── 4_Bellek_Yonetimi_2 │ └── main.cpp ├── 11_Class_Constructor_4 │ └── main.cpp ├── 35_2_Dosya_Islemleri │ └── main.cpp ├── 25_Polymorphism_4 │ └── main.cpp ├── 33_Template_6 │ └── main.cpp ├── 37_Dosya_Islemleri │ └── main.cpp ├── 11_Class_Constructor_5 │ └── main.cpp ├── 21_Miras_Inheritance_3 │ ├── readme.md │ └── main.cpp ├── 5_Class_4 │ └── main.cpp ├── 22_Overloading │ └── main3.cpp └── 28_Veri_Soyutlama_3 │ ├── msin2.cpp │ └── main.cpp ├── .gitignore └── LICENSE /Ders_Notlari/readme.md: -------------------------------------------------------------------------------- 1 | # Ders Sunum Notlari 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MRM3049 2 | MRM3049 - Nesne Yönelimli Programlama Ders Notları 3 | -------------------------------------------------------------------------------- /Lab_Calismalari/README.md: -------------------------------------------------------------------------------- 1 | # MRM3049 2 | MRM3049 - Nesne Yönelimli Programlama Labortuvar Çalışmaları 3 | -------------------------------------------------------------------------------- /Ders_Notlari/Hafta_1-export.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marmara-mekatronik/MRM3049/HEAD/Ders_Notlari/Hafta_1-export.pdf -------------------------------------------------------------------------------- /Ders_Notlari/Hafta_10-export.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marmara-mekatronik/MRM3049/HEAD/Ders_Notlari/Hafta_10-export.pdf -------------------------------------------------------------------------------- /Ders_Notlari/Hafta_11-export.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marmara-mekatronik/MRM3049/HEAD/Ders_Notlari/Hafta_11-export.pdf -------------------------------------------------------------------------------- /Ders_Notlari/Hafta_12-export.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marmara-mekatronik/MRM3049/HEAD/Ders_Notlari/Hafta_12-export.pdf -------------------------------------------------------------------------------- /Ders_Notlari/Hafta_2-export.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marmara-mekatronik/MRM3049/HEAD/Ders_Notlari/Hafta_2-export.pdf -------------------------------------------------------------------------------- /Ders_Notlari/Hafta_3-export.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marmara-mekatronik/MRM3049/HEAD/Ders_Notlari/Hafta_3-export.pdf -------------------------------------------------------------------------------- /Ders_Notlari/Hafta_4-export.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marmara-mekatronik/MRM3049/HEAD/Ders_Notlari/Hafta_4-export.pdf -------------------------------------------------------------------------------- /Ders_Notlari/Hafta_5-export.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marmara-mekatronik/MRM3049/HEAD/Ders_Notlari/Hafta_5-export.pdf -------------------------------------------------------------------------------- /Ders_Notlari/Hafta_6-export.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marmara-mekatronik/MRM3049/HEAD/Ders_Notlari/Hafta_6-export.pdf -------------------------------------------------------------------------------- /Ders_Notlari/Hafta_7-export.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marmara-mekatronik/MRM3049/HEAD/Ders_Notlari/Hafta_7-export.pdf -------------------------------------------------------------------------------- /Ders_Notlari/Hafta_7_1-export.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marmara-mekatronik/MRM3049/HEAD/Ders_Notlari/Hafta_7_1-export.pdf -------------------------------------------------------------------------------- /Ders_Notlari/Hafta_8-export.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marmara-mekatronik/MRM3049/HEAD/Ders_Notlari/Hafta_8-export.pdf -------------------------------------------------------------------------------- /Ders_Notlari/Hafta_9-export.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marmara-mekatronik/MRM3049/HEAD/Ders_Notlari/Hafta_9-export.pdf -------------------------------------------------------------------------------- /Ders/16_Inline/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(16_Inline) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(16_Inline main.cpp) -------------------------------------------------------------------------------- /Ders/5_Class_1/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.18) 2 | project(5_Class_1) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(5_Class_1 main.cpp) -------------------------------------------------------------------------------- /Ders/18_Pointer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(18_Pointer) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(18_Pointer main.cpp) -------------------------------------------------------------------------------- /Ders/3_Referans/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.18) 2 | project(3_Referans) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(3_Referans main.cpp) -------------------------------------------------------------------------------- /Ders/1_Fonksiyona_Parametre_Gecme/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | project(CPP3) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(CPP3 main.cpp) -------------------------------------------------------------------------------- /Ders/14_Local_Class/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.18) 2 | project(14_Local_Class) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(14_Local_Class main.cpp) -------------------------------------------------------------------------------- /Ders/19_statik_uye/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(19_statik_uye) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(19_statik_uye main.cpp) -------------------------------------------------------------------------------- /Ders/29_Namespace_1/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(29_Namespace_1) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(29_Namespace_1 main.cpp) -------------------------------------------------------------------------------- /Ders/30_Template_1/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(30_Template_1) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(30_Template_1 main.cpp) -------------------------------------------------------------------------------- /Ders/31_Template_2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(31_Template_2) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(31_Template_2 main.cpp) -------------------------------------------------------------------------------- /Ders/33_Template_4/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(33_Template_4) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(33_Template_4 main.cpp) -------------------------------------------------------------------------------- /Ders/4_Pointer_Dizi/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.18) 2 | project(4_Pointer_Dizi) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(4_Pointer_Dizi main.cpp) -------------------------------------------------------------------------------- /Ders/6_Class_Public/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.18) 2 | project(6_Class_Public) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(6_Class_Public main.cpp) -------------------------------------------------------------------------------- /Ders/17_This_Pointer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(17_This_Pointer) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(17_This_Pointer main.cpp) -------------------------------------------------------------------------------- /Ders/27_Kapsulleme_1/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(27_Kapsulleme_1) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(27_Kapsulleme_1 main.cpp) -------------------------------------------------------------------------------- /Ders/32_Template_3/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(32_Template_3) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(32_Template_3 main.cpp Dizi.h) -------------------------------------------------------------------------------- /Ders/7_Class_Private/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.18) 2 | project(7_Class_Private) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(7_Class_Private main.cpp) -------------------------------------------------------------------------------- /Ders/12_Friend_Class_1/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.18) 2 | project(12_Friend_Class_1) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(12_Friend_Class_1 main.cpp) -------------------------------------------------------------------------------- /Ders/13_Friend_Class_2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.18) 2 | project(13_Friend_Class_2) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(13_Friend_Class_2 main.cpp) -------------------------------------------------------------------------------- /Ders/23_Polymorphism_1/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(23_Polymorphism_1) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(23_Polymorphism_1 main.cpp) -------------------------------------------------------------------------------- /Ders/24_Polymorphism_2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(24_Polymorphism_2) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(24_Polymorphism_2 main.cpp) -------------------------------------------------------------------------------- /Ders/25_Polymorphism_3/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(25_Polymorphism_3) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(25_Polymorphism_3 main.cpp) -------------------------------------------------------------------------------- /Ders/8_Class_Protected/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.18) 2 | project(8_Class_Protected) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(8_Class_Protected main.cpp) -------------------------------------------------------------------------------- /Ders/15_Ic_Ice_Siniflar/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.18) 2 | project(15_Ic_Ice_Siniflar) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(15_Ic_Ice_Siniflar main.cpp) -------------------------------------------------------------------------------- /Ders/26_Veri_Soyutlama_1/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(26_Veri_Soyutlama_1) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(26_Veri_Soyutlama_1 main.cpp) -------------------------------------------------------------------------------- /Ders/28_Veri_Soyutlama_2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(28_Veri_Soyutlama_2) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(28_Veri_Soyutlama_2 main.cpp) -------------------------------------------------------------------------------- /Ders/2_Inline_Fonksiyon/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.18) 2 | project(2_Inline_Fonksiyon) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(2_Inline_Fonksiyon main.cpp) -------------------------------------------------------------------------------- /Ders/35_Dosya_Islemleri/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(35_Dosya_Islemleri) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(35_Dosya_Islemleri main.cpp) -------------------------------------------------------------------------------- /Ders/20_Miras_Inheritance/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(20_Miras_Inheritance) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(20_Miras_Inheritance main.cpp) -------------------------------------------------------------------------------- /Ders/36_Dosya_Islemleri_2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(36_Dosya_Islemleri_2) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(36_Dosya_Islemleri_2 main.cpp) -------------------------------------------------------------------------------- /Ders/9_Class_Constructor_1/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.18) 2 | project(9_Class_Constructor) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(9_Class_Constructor main.cpp) -------------------------------------------------------------------------------- /Ders/10_Class_Constructor_2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.18) 2 | project(10_Class_Constructor_2) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(10_Class_Constructor_2 main.cpp) -------------------------------------------------------------------------------- /Ders/11_Class_Constructor_3/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.18) 2 | project(11_Class_Constructor_3) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(11_Class_Constructor_3 main.cpp) -------------------------------------------------------------------------------- /Ders/21_Miras_Inheritance_2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(21_Miras_Inheritance_2) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(21_Miras_Inheritance_2 main.cpp) -------------------------------------------------------------------------------- /Lab_Calismalari/1_Kutuphane_1/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(1_Kutuphane_1) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(1_Kutuphane_1 main.cpp Ilk_Baslik.h) -------------------------------------------------------------------------------- /Ders/34_Template_Buble_Sort_5/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(34_Template_Buble_Sort_5) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(34_Template_Buble_Sort_5 main.cpp) -------------------------------------------------------------------------------- /Ders/22_Overloading_Asiri_Yukleme_1/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(22_Overloading_Asiri_Yukleme_1) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(22_Overloading_Asiri_Yukleme_1 main.cpp) -------------------------------------------------------------------------------- /Ders/22_Overloading_Asiri_Yukleme_2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(22_Overloading_Asiri_Yukleme_2) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(22_Overloading_Asiri_Yukleme_2 main.cpp) -------------------------------------------------------------------------------- /Ders/22_Overloading_Asiri_Yukleme_3/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(22_Overloading_Asiri_Yukleme_3) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(22_Overloading_Asiri_Yukleme_3 main.cpp) -------------------------------------------------------------------------------- /Ders/22_Overloading_Asiri_Yukleme_4/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(22_Overloading_Asiri_Yukleme_4) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(22_Overloading_Asiri_Yukleme_4 main.cpp) -------------------------------------------------------------------------------- /Lab_Calismalari/1_Kutuphane_1/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "Ilk_Baslik.h" 3 | 4 | using namespace S; 5 | 6 | int main() { 7 | Sekil sekil1(20,50); 8 | std::cout << "Şekil1'in alanı : " << sekil1.Alan() << std::endl; 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /Ders/27_Kapsulleme_1/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | class Kare{ 3 | public: 4 | void setKenar(int k){ 5 | kenar=k; 6 | } 7 | private: 8 | int kenar; 9 | }; 10 | 11 | int main() { 12 | Kare kare1; 13 | kare1.setKenar(30); 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /Lab_Calismalari/Baslik_Ornek/sensor.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by hyuce on 15.10.2024. 3 | // 4 | #ifndef SENSOR_H 5 | #define SENSOR_H 6 | 7 | // Fonksiyon Prototipleri 8 | double okuSicaklik(); 9 | double okuNem(); 10 | void kontrolEt(double sicaklik, double nem, 11 | bool &alarm, double sicaklikEsik, double nemEsik); 12 | #endif //SENSOR_H 13 | -------------------------------------------------------------------------------- /Ders/3_Referans/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | int x = 10; 7 | int& ref = x; 8 | 9 | int *ptr = &x; 10 | int *ptr2 = &ref; 11 | *ptr = 66; 12 | 13 | ref = 20; 14 | cout << "x = " << x << endl ; 15 | 16 | x = 30; 17 | cout << "ref = " << ref << endl ; 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /Ders/33_Template_4/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | template 5 | class Depo{ 6 | private: 7 | T mali_deger; 8 | public: 9 | Depo(T deger):mali_deger(deger){} 10 | ~Depo(){ 11 | cout << "Deger:" << mali_deger << endl; 12 | } 13 | }; 14 | 15 | 16 | int main() { 17 | // Depo Deger1(5.5); 18 | Depo Deger2(5.5); 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /Ders/17_This_Pointer_2/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | class Test { 6 | private: 7 | int x; 8 | public: 9 | void setX(int x) { 10 | this->x = x; 11 | } 12 | 13 | void yaz() { 14 | cout << "x = " << x << endl; 15 | } 16 | }; 17 | 18 | int main() { 19 | Test nesne; 20 | int x = 20; 21 | nesne.setX(x); 22 | nesne.yaz(); 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /Ders/1_Fonksiyona_Parametre_Gecme/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | using namespace std; 5 | 6 | void show(int = 5, float = 2.3, long = 4); 7 | 8 | int main() { 9 | show(); 10 | show(5); 11 | show(6, 7.8); 12 | show(9, 10.11, 12L); 13 | return 0; 14 | } 15 | 16 | void show(int first, float second, long third) { 17 | cout << "\nfirst = " << first; 18 | cout << ", second = " << second; 19 | cout << ", third = " << third; 20 | } -------------------------------------------------------------------------------- /Ders/36_Dosya_Islemleri_2/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | int main() { 7 | char dizi[100]; 8 | fstream st; 9 | st.open("./dosya.dat",ios::out); 10 | cout << "Yeni Dosya oluşturululdu\n"; 11 | st << "Merhaba Dünya! Nasılsın?"; 12 | st.close(); 13 | st >> dizi ; 14 | st.open("./dosya.dat",ios::out); 15 | st >> dizi; 16 | cout << dizi << endl ; 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /Ders/30_Template_1/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | template 6 | 7 | const T& maksimum(const T& x, const T& y){ 8 | return (x>y) ? x : y; 9 | } 10 | 11 | int main() { 12 | 13 | int i = maksimum(25,36); 14 | cout << i << endl; 15 | 16 | double d = maksimum(25.25,36.36); 17 | cout << d << endl; 18 | 19 | char ch = maksimum('a','6'); 20 | cout << ch << endl; 21 | 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /Ders/21_Function_Overriding/main2.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | class memeli { 6 | public: 7 | void yaz(int x = 10) { 8 | cout << "X'in degeri: " << x << endl; 9 | } 10 | }; 11 | 12 | class yarasa : public memeli { 13 | public: 14 | void yaz(int x) { 15 | memeli::yaz(x); 16 | } 17 | 18 | public: 19 | 20 | }; 21 | 22 | int main() { 23 | yarasa y1; 24 | y1.yaz(50); 25 | y1.memeli::yaz(); 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /Ders/19_Static_uye_1/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | class SinifA { 5 | public: 6 | SinifA() { cout << " A Kurucu Fonksiyonu Çağrılıyor...." << endl; } 7 | }; 8 | 9 | class SinifB { 10 | static SinifA a; 11 | public: 12 | SinifB() { cout << " B Kurucu Fonksiyonu Çağrılıyor...." << endl; } 13 | static SinifA getA(){ return a;} 14 | }; 15 | 16 | SinifA SinifB::a; 17 | int main() { 18 | 19 | SinifA a = SinifB::getA(); 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /Ders/21_Function_Overriding/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | class memeli { 6 | public: 7 | void ucur() { 8 | cout << " bazi memeliler ucar" << endl; 9 | } 10 | }; 11 | 12 | class yarasa : public memeli{ 13 | 14 | public: 15 | void ucur() { 16 | cout << "yarasalar hem memeli hemde kanatlı olup ucarlar" << endl; 17 | } 18 | }; 19 | 20 | int main() { 21 | yarasa y1; 22 | y1.ucur(); 23 | y1.memeli::ucur(); 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /Ders/21_Virtual_Function/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | class Temel { 6 | public: 7 | virtual void yaz() { 8 | cout << "Temel Fonksiyon" << endl; 9 | } 10 | }; 11 | 12 | class Turetilmis : public Temel { 13 | public: 14 | void yaz() { 15 | cout << "Turetilmis Fonksiyon" << endl; 16 | } 17 | 18 | public: 19 | 20 | }; 21 | 22 | int main() { 23 | Turetilmis T1; 24 | Temel* ptr = &T1; 25 | ptr->yaz(); 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /Ders/29_Namespace_1/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | namespace Angarali{ 6 | void Ahmet(){ 7 | cout<< "Ben Angaralı Ahmet" << endl; 8 | } 9 | } 10 | 11 | namespace Gayserili{ 12 | void Ahmet(){ 13 | cout<< "Ben Gayserili Ahmet" << endl; 14 | } 15 | } 16 | 17 | int main() { 18 | 19 | // Aşağıda Agarali Ahmet çağrılıyor 20 | Angarali::Ahmet(); 21 | // Aşağıda Gayserili Ahmet çağrılıyor 22 | Gayserili::Ahmet(); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /Ders/32_Template_3/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "Dizi.h" 3 | 4 | using namespace std; 5 | int main() { 6 | Dizi intDizi(12); 7 | Dizi doubleDizi(12); 8 | 9 | for (int sayac = 0; sayac < intDizi.getUzunluk(); ++sayac) { 10 | intDizi[sayac] = sayac; 11 | doubleDizi[sayac] = sayac + 0.5; 12 | } 13 | 14 | for (int sayac = intDizi.getUzunluk()-1; sayac >=0 ; --sayac) { 15 | cout << intDizi[sayac] << "\t" << doubleDizi[sayac] << endl; 16 | } 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /Ders/4_Pointer_Dizi/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | const int MAX = 3; 5 | 6 | int main() { 7 | int dizi[MAX] = {10,100,1000}; 8 | int *ptr_dizi; 9 | 10 | ptr_dizi = dizi; //ptr_dizi = &dizi[0]; 11 | 12 | for (int i = 0; i < MAX; ++i) { 13 | cout << "Dizi Pointer Adresi [ " << i << " ] = "; 14 | cout << ptr_dizi << endl; 15 | 16 | cout << "Dizi Degeri [ " << i << " ] = "; 17 | cout << *ptr_dizi << endl; 18 | 19 | ptr_dizi++; 20 | } 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /Ders/14_Local_Class/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | void setAyar(int setSicaklik); 4 | 5 | void setAyar(int setSicaklik) { 6 | class Klima { 7 | public: 8 | int sicaklik; 9 | }; 10 | Klima klimalar[10]; 11 | for (int i = 0; i < sizeof(klimalar)/sizeof(Klima); i++) { 12 | klimalar[i].sicaklik = setSicaklik; 13 | cout<< "Klima "<< i+1<< ":" << 14 | klimalar[i].sicaklik << " dereceye ayarlandı" << endl; 15 | } 16 | } 17 | int main() { 18 | setAyar(24); 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /Ders/28_Veri_Soyutlama_2/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | class Ekle{ 5 | public: 6 | Ekle(int i=0){ 7 | toplam = i; 8 | } 9 | void EkleSayi(int sayi){ 10 | toplam+=sayi; 11 | } 12 | int getSayi(){ 13 | return toplam; 14 | }; 15 | 16 | private: 17 | int toplam; 18 | 19 | }; 20 | int main() { 21 | Ekle a; 22 | a.EkleSayi(10); 23 | a.EkleSayi(20); 24 | a.EkleSayi(30); 25 | 26 | std::cout << "Toplam girilen sayı: " << a.getSayi() << std::endl; 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /Ders/12_Friend_Class_1/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | class Sinif_B; 4 | class Sinif_A { 5 | private: 6 | int a; 7 | public: 8 | Sinif_A():a(10){}; 9 | friend class Sinif_B; 10 | }; 11 | class Sinif_B { 12 | private: 13 | int b; 14 | public: 15 | void getDeger(Sinif_A &sinif_a); 16 | 17 | }; 18 | void Sinif_B::getDeger(Sinif_A &sinif_a) { 19 | cout<<"Sinif_A::a= "< 2 | 3 | using namespace std; 4 | 5 | #define MAX(A, B) ((A)>(B) ? (A) : (B)) 6 | 7 | inline int max(int a, int b) { 8 | if (a > b) { 9 | return a; 10 | } else { 11 | return b; 12 | } 13 | } 14 | 15 | int main() { 16 | 17 | int i, x, y; 18 | x = 30; 19 | y = 40; 20 | i = MAX(x++, y++); 21 | cout << "x = " << x << " y = " << y << "\n"; 22 | 23 | x = 10; 24 | y = 20; 25 | i = max(x++, y++); 26 | cout << "x = " << x << " y = " << y << "\n"; 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /Ders/22_Overloading_Asiri_Yukleme_1/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | class veriYaz { 6 | public: 7 | void yaz(int i) { 8 | cout << "Yazılan Tam Sayı : " << i << endl; 9 | } 10 | 11 | void yaz(double f) { 12 | cout << "Yazılan kesirli Sayı : " << f << endl; 13 | } 14 | 15 | void yaz(char *c) { 16 | cout << "Yazılan Karakter : " << c << endl; 17 | } 18 | }; 19 | 20 | int main() { 21 | veriYaz yaz1; 22 | yaz1.yaz(55); 23 | yaz1.yaz(55.66); 24 | yaz1.yaz("Merhaba Dünya"); 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /Ders/13_Friend_Fonksiyon_1/main2.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | class Kutu { 5 | private: 6 | double uzunluk; 7 | public: 8 | Kutu() : uzunluk(0) {} 9 | ~Kutu(){} 10 | 11 | // Friend fonksiyon bildirimi 12 | friend void uzunlukAyarla(Kutu& k, double l); 13 | }; 14 | // Friend fonksiyon tanımı 15 | void uzunlukAyarla(Kutu& k, double l) { 16 | k.uzunluk = l; // Private üyeye erişim 17 | cout << "Uzunluk: " << k.uzunluk << endl; 18 | } 19 | 20 | int main() { 21 | Kutu kutu1; 22 | uzunlukAyarla(kutu1, 10.5); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /Ders/15_Ic_Ice_Siniflar_1/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | class DisSinif{ 4 | private: 5 | int ozelUye; 6 | public: 7 | DisSinif(int deger):ozelUye(deger){} 8 | class IcSinif{ 9 | public: 10 | void GosterDisSinif(DisSinif& disSinif){ 11 | cout<< "IcSinif, Dissinifa'a erisim:" << disSinif.ozelUye << endl; 12 | } 13 | }; 14 | void GosterIcSinif(){ 15 | IcSinif icSinif; 16 | icSinif.GosterDisSinif(*this); 17 | } 18 | }; 19 | 20 | int main() { 21 | DisSinif disNesne(55); 22 | disNesne.GosterIcSinif(); 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /Ders/7_Class_Private/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class Kutu { 4 | public: 5 | double uzunluk; 6 | void setGenislik(double gDeger); 7 | double getGenislik(void); 8 | private: 9 | double genislik; 10 | }; 11 | 12 | void Kutu::setGenislik(double gDeger) { 13 | std::cout << "Set edilen Genislik degeri :"<< gDeger << std::endl; 14 | genislik = gDeger; 15 | } 16 | double Kutu::getGenislik() { 17 | return genislik; 18 | } 19 | 20 | int main() { 21 | Kutu kutu_1; 22 | kutu_1.setGenislik(12.5); 23 | std::cout << "Okunan Genislik degeri:" << kutu_1.getGenislik(); 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /Ders/17_This_Pointer_3/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | class Demo { 6 | private: 7 | int sayi; 8 | char karekter; 9 | public: 10 | Demo &setSayi(int sayi) { 11 | this->sayi = sayi; 12 | return *this; 13 | } 14 | 15 | Demo &setKarekter(char karekter) { 16 | this->karekter = karekter; 17 | return *this; 18 | } 19 | 20 | void yaz() { 21 | cout << sayi << endl; 22 | cout << karekter << endl; 23 | } 24 | }; 25 | 26 | int main() { 27 | Demo nesne; 28 | nesne.setSayi(200).setKarekter('M'); 29 | nesne.yaz(); 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /Ders/17_This_Pointer_4/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | class Kisi { 4 | private: 5 | string isim; 6 | int yas; 7 | public: 8 | // Zincirleme çağrılar için `this` kullanımı 9 | Kisi& setIsim(string isim) { 10 | this->isim = isim; 11 | return *this; 12 | } 13 | 14 | Kisi& setYas(int yas) { 15 | this->yas = yas; 16 | return *this; 17 | } 18 | 19 | void yazdir() { 20 | cout << "İsim: " << isim << ", Yaş: " << yas << endl; 21 | } 22 | }; 23 | int main() { 24 | Kisi kisi; 25 | kisi.setIsim("Ayşe").setYas(25).yazdir(); 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /Ders/35_1_Dosya_Islemleri/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | int main() { 7 | ofstream Dosya; 8 | 9 | string satir; 10 | 11 | Dosya.open("deneme.txt"); 12 | 13 | while (Dosya){ 14 | getline(cin, satir); 15 | if(satir == "-1") 16 | break; 17 | Dosya << satir << endl; 18 | } 19 | Dosya.close(); 20 | 21 | ifstream okuDosya; 22 | okuDosya.open("deneme.txt"); 23 | 24 | while (okuDosya){ 25 | getline(okuDosya,satir); 26 | cout << satir < 2 | #include 3 | 4 | using namespace std; 5 | 6 | int main() { 7 | // stack memory 8 | int dizi_stack[5] = {11, 22, 33, 44, 55}; 9 | 10 | for (int i = 0; i < 5; ++i) { 11 | cout << dizi_stack[i] << endl; 12 | } 13 | 14 | cout << "____________________" << endl; 15 | 16 | // heap memory 17 | 18 | int *dizi_heap = (int *) malloc(sizeof(int) * 5); 19 | 20 | for (int i = 0; i < 5; ++i) { 21 | *(dizi_heap + i) = i + 11; 22 | } 23 | 24 | for (int i = 0; i < 5; ++i) { 25 | cout << dizi_heap[i] << endl; 26 | } 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /Ders/33_Template_5/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | template 6 | class Toplama{ 7 | private: 8 | deger a, b; 9 | public: 10 | Toplama(deger x, deger y){ 11 | a=x; 12 | b=y; 13 | } 14 | void goster(){ 15 | cout< T1(8,6); 26 | Toplama T2(8.2,6.3); 27 | Toplama T3('A','8'); 28 | T1.goster(); 29 | T2.goster(); 30 | T3.goster(); 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | 34 | 35 | .idea/ 36 | cmake-build-debug/ 37 | CMakeLists.txt.user 38 | CMakeCache.txt 39 | CMakeFiles 40 | CMakeScripts 41 | Testing 42 | Makefile 43 | cmake_install.cmake 44 | install_manifest.txt 45 | compile_commands.json 46 | CTestTestfile.cmake 47 | _deps 48 | -------------------------------------------------------------------------------- /Ders/21_Miras_Inheritance_4/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | class memeli { 6 | public: 7 | void ucur() { 8 | cout << " bazi memeliler ucar" << endl; 9 | } 10 | }; 11 | 12 | class kanatli { 13 | public: 14 | void ucur() { 15 | cout << "bazi kantlilar ucar" << endl; 16 | } 17 | }; 18 | 19 | class yarasa : public memeli, public kanatli { 20 | 21 | public: 22 | yarasa() { 23 | cout << "yarasalar hem memeli hemde kanatlı olup ucarlar" << endl; 24 | } 25 | }; 26 | 27 | int main() { 28 | yarasa y1; 29 | // y1.ucur(); 30 | y1.memeli::ucur(); 31 | y1.kanatli::ucur(); 32 | 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /Ders/13_Friend_Fonksiyon_1/main3.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | class Kisi { 5 | private: 6 | string isim; 7 | int yas; 8 | 9 | public: 10 | Kisi(string isim, int yas) : isim(isim), yas(yas) {} 11 | 12 | // Friend sınıf bildirimi 13 | friend class Doktor; 14 | }; 15 | 16 | class Doktor { 17 | public: 18 | void bilgileriGoster(const Kisi& kisi) { 19 | // Kisi sınıfının private üyelerine erişim 20 | cout << "İsim: " << kisi.isim << ", Yaş: " << kisi.yas << endl; 21 | } 22 | }; 23 | 24 | int main() { 25 | Kisi kisi("Ahmet", 30); 26 | Doktor doktor; 27 | doktor.bilgileriGoster(kisi); 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /Ders/15_Ic_Ice_Siniflar/main2.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | class DisSinif { 5 | private: 6 | int veri; 7 | 8 | public: 9 | DisSinif(int deger) : veri(deger) {} 10 | 11 | // İç sınıf 12 | class IcSinif { 13 | public: 14 | void yazdir(const DisSinif& disObj) { 15 | // Dış sınıfın private verisine erişim 16 | cout << "Dış sınıf verisi: " << disObj.veri << endl; 17 | } }; 18 | }; 19 | int main() { 20 | DisSinif disObj(42); // Dış sınıf nesnesi 21 | DisSinif::IcSinif icObj; // İç sınıf nesnesi 22 | icObj.yazdir(disObj); // İç sınıf üzerinden veri erişimi 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /Ders/22_Overloading_Asiri_Yukleme_5/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | class ogrenci{ 5 | private: 6 | int Puan; 7 | string ad, soyad; 8 | public: 9 | ogrenci(string ismi, string soyismi, int Notu){ 10 | ad=ismi; 11 | soyad=soyismi; 12 | Puan=Notu; 13 | } 14 | void getVeri(){ 15 | cout << "Adi :" << ad << endl; 16 | cout << "Soyadi :" << soyad << endl; 17 | cout << "Notu :" << Puan << endl; 18 | } 19 | void operator ++(){ 20 | Puan=Puan+5; 21 | } 22 | 23 | }; 24 | 25 | int main() { 26 | ogrenci ogr1("Ahmet","Soylu",90); 27 | ogr1.getVeri(); 28 | ++ogr1; 29 | ogr1.getVeri(); 30 | 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /Ders/5_Class_2/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | class insan { 6 | private: 7 | string adi; 8 | int yas; 9 | public: 10 | insan(string adi_, int yas_) { 11 | adi = adi_; 12 | yas = yas_; 13 | } 14 | ~insan() { 15 | cout <<"Nesne Kaldırıldı"<get_insan(); 29 | ahmet->set_yas(57); 30 | ahmet->get_insan(); 31 | delete ahmet; 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /Lab_Calismalari/1_Kutuphane_1/Ilk_Baslik.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by hyuce on 7.01.2021. 3 | // 4 | 5 | #ifndef INC_1_KUTUPHANE_1_ILK_BASLIK_H 6 | #define INC_1_KUTUPHANE_1_ILK_BASLIK_H 7 | 8 | namespace S{ 9 | class Sekil{ 10 | public: 11 | Sekil(int g=0, int y=0); 12 | void setBoyut(int g=0, int y=0); 13 | int Alan(); 14 | 15 | private: 16 | int genislik, yukseklik; 17 | }; 18 | Sekil::Sekil(int g, int y) { 19 | genislik=g; 20 | yukseklik=y; 21 | } 22 | int Sekil::Alan() { 23 | return genislik*yukseklik; 24 | } 25 | void Sekil::setBoyut(int g, int y) { 26 | genislik=g; 27 | yukseklik=y; 28 | } 29 | } 30 | 31 | 32 | #endif //INC_1_KUTUPHANE_1_ILK_BASLIK_H 33 | -------------------------------------------------------------------------------- /Ders/8_Class_Protected/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | class Kutu{ 6 | protected: 7 | double genislik; 8 | }; 9 | 10 | class KucukKutu:Kutu{ 11 | public: 12 | void setKucukGenislik(double kGenislik); 13 | double getKucukGenislik(void); 14 | }; 15 | 16 | void KucukKutu::setKucukGenislik(double kGenislik) { 17 | genislik= kGenislik; 18 | } 19 | 20 | double KucukKutu::getKucukGenislik() { 21 | return genislik; 22 | } 23 | 24 | 25 | int main() { 26 | 27 | Kutu kutucuk; // <------ Erisilir degil. 28 | 29 | KucukKutu kucuk_kutucuk; 30 | kucuk_kutucuk.setKucukGenislik(44.44); 31 | cout<< "Kucuk Kutucugun Genisligi :" << kucuk_kutucuk.getKucukGenislik(); 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /Ders/26_Veri_Soyutlama_1/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | class Zaman{ 6 | public: 7 | Zaman(); 8 | void setZaman(int san, int dak, int Sa ); 9 | void getZaman(); 10 | 11 | private: 12 | int saniye; 13 | int dakika; 14 | int saat; 15 | }; 16 | 17 | Zaman::Zaman() { 18 | saniye=0; 19 | dakika=0; 20 | saat=0; 21 | } 22 | 23 | void Zaman::setZaman(int san, int dak, int Sa) { 24 | saniye=san; 25 | dakika=dak; 26 | saat=Sa; 27 | } 28 | 29 | void Zaman::getZaman() { 30 | cout << saat << ":"; 31 | cout << dakika << ":"; 32 | cout << saniye ; 33 | } 34 | 35 | 36 | int main() { 37 | Zaman zaman1; 38 | zaman1.setZaman(58,30,12); 39 | zaman1.getZaman(); 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /Ders/35_Dosya_Islemleri/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | int main() { 7 | char data[100]; 8 | ofstream cikti_dosya; 9 | cikti_dosya.open("dosya.dat"); 10 | 11 | cout << " Dosya Oluşturuluyor..." << endl; 12 | cout << "Adınız : " ; 13 | cin.getline(data,100); 14 | 15 | cikti_dosya << data << "\t \t"; 16 | 17 | cout << "Yaşınızı Giriniz : " ; 18 | cin >> data; 19 | cin.ignore(); 20 | 21 | cikti_dosya << data << endl; 22 | 23 | cikti_dosya.close(); 24 | 25 | ifstream giris_dosya; 26 | giris_dosya.open("dosya.dat"); 27 | cout << " Dosya Okunuyor..." << endl; 28 | 29 | giris_dosya >> data; 30 | cout << data << endl; 31 | giris_dosya >> data; 32 | cout << data ; 33 | 34 | giris_dosya.close(); 35 | 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /Ders/22_Overloading_Asiri_Yukleme_6/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | // Vektor sınıfı tanımlanıyor 5 | class Vektor { 6 | public: 7 | int x, y; 8 | 9 | // + operatörü aşırı yükleniyor 10 | Vektor operator+(const Vektor& other) const { 11 | Vektor sonuc; 12 | sonuc.x = x + other.x; 13 | sonuc.y = y + other.y; 14 | return sonuc; 15 | } 16 | }; 17 | 18 | int main() { 19 | // İki vektör oluşturuluyor 20 | 21 | Vektor v1 = {2, 3}; 22 | Vektor v2 = {4, 5}; 23 | 24 | // + operatörü kullanılarak vektörler toplanıyor 25 | Vektor toplam = v1 + v2; 26 | 27 | // Sonuç ekrana yazdırılıyor 28 | cout << "Toplam: (" << toplam.x << ", " << toplam.y << ")" << endl; 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /Ders/31_Template_2/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | class Para{ 5 | int m_para; 6 | public: 7 | Para(int para):m_para(para){} 8 | int getPara(){return m_para;} 9 | bool operator>(const Para& p2){ 10 | return (this->m_para>p2.m_para); 11 | } 12 | }; 13 | template 14 | const T& maksimum(const T& x, const T& y){ 15 | return (x > y) ? x : y; 16 | } 17 | 18 | int main() { 19 | Para para1(5); 20 | Para para2(10); 21 | Para buyuk= maksimum(para1.getPara(),para2.getPara()); 22 | cout << "Buyuk Para :" << buyuk.getPara()<para2){ 24 | cout << "Buyuk Para: " << para1.getPara()< 2 | #include 3 | 4 | using namespace std; 5 | 6 | class tarih { 7 | private: 8 | int Gun; 9 | int Ay; 10 | int Yil; 11 | public: 12 | tarih(int _gun,int _ay, int _yil) { 13 | Gun=_gun; Ay=_ay; Yil=_yil; 14 | } 15 | void goster() { 16 | cout << Gun<<"/"<goster(); 26 | bayram->ayarla(27,9,2025); 27 | bayram->goster(); 28 | delete bayram; 29 | 30 | tarih yilbasi(31,12,2024); 31 | yilbasi.goster(); 32 | yilbasi.ayarla(01,01,2025); 33 | yilbasi.goster(); 34 | 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /Ders/15_Ic_Ice_Siniflar/main3.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | class Araba { 4 | private: 5 | string marka; 6 | public: 7 | Araba(string m) : marka(m) {} 8 | // İç sınıf 9 | class Motor { 10 | public: 11 | void calistir() { 12 | cout << "Motor çalışıyor." << endl; 13 | } 14 | void arabaMarkasi(const Araba& araba) { 15 | // Dış sınıfın private üyesine erişim 16 | cout << "Arabanın markası: " << araba.marka << endl; 17 | } 18 | }; 19 | }; 20 | int main() { 21 | Araba araba("Toyota"); // Dış sınıf nesnesi 22 | Araba::Motor motor; // İç sınıf nesnesi 23 | motor.calistir(); // Motor çalıştırma 24 | motor.arabaMarkasi(araba); // Araba markasına erişim 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /Ders/11_Class_Constructor_3/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | class Otomobil{ //sınıf 6 | public: // Erişim Belirleyici 7 | string marka; //Özellik 8 | string model; //özellik 9 | int yil; //özellik 10 | Otomobil(string x, string y, int z); //yapıcı deklarasyonu 11 | ~Otomobil(); // yokedici 12 | }; 13 | 14 | Otomobil::Otomobil(string x, string y, int z) { 15 | marka = x; 16 | model = y ; 17 | yil = z ; 18 | } 19 | Otomobil::~Otomobil() { 20 | 21 | } 22 | 23 | int main() { 24 | Otomobil araba1("BMW", "X6", 2021); 25 | Otomobil araba2("Mercedes", "E320", 2023); 26 | 27 | cout << araba1.marka << " " << araba1.model << " " << araba1.yil << endl; 28 | cout << araba2.marka << " " << araba2.model << " " << araba2.yil << endl; 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /Ders/15_Ic_Ice_Siniflar/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | class Disarisi { 6 | private: 7 | int x; 8 | public: 9 | Disarisi(); 10 | int getVeri_D(); 11 | 12 | class Icerisi { 13 | private: 14 | int y; 15 | public: 16 | Icerisi(); 17 | int getVeri_I(); 18 | }; 19 | }; 20 | 21 | Disarisi::Disarisi() { 22 | x = 5; 23 | } 24 | 25 | Disarisi::Icerisi::Icerisi() { 26 | y = 10; 27 | } 28 | 29 | int Disarisi::getVeri_D() { 30 | return x; 31 | } 32 | int Disarisi::Icerisi::getVeri_I() { 33 | return y; 34 | } 35 | 36 | 37 | int main() { 38 | Disarisi distaraf; 39 | Disarisi::Icerisi ictaraf; 40 | 41 | cout << "Disarisi :" << distaraf.getVeri_D() << endl; 42 | cout << "Icerisi :" << ictaraf.getVeri_I()< 2 | using namespace std; 3 | class Kutu { 4 | private: 5 | double genislik, derinlik, yukseklik; 6 | public: 7 | static int nesneSayisi; 8 | Kutu(double g=2.0, double d=2.0, double y=2.0); 9 | double getHacim(); 10 | }; 11 | Kutu::Kutu(double g, double d, double y) { 12 | genislik = g; 13 | derinlik = d; 14 | yukseklik = y; 15 | nesneSayisi++; 16 | } 17 | double Kutu::getHacim() { 18 | return genislik * derinlik * yukseklik; 19 | } 20 | int Kutu::nesneSayisi = 0; 21 | int main() { 22 | Kutu Kutu1(3.3,4.4,5.5); 23 | Kutu Kutu2(6.3,8.4,10.5); 24 | 25 | cout << "Oluşturulan Toplam Nesne Sayısı :" << Kutu::nesneSayisi << endl; 26 | cout << "Kutu 1 hacmi : " << Kutu1.getHacim() << endl; 27 | cout << "Kutu 2 hacim : " << Kutu2.getHacim() << endl; 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /Ders/13_Friend_Class_3/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | class Dikdortgen; 4 | class Kare{ 5 | public: 6 | Kare(int kenar):kenarUzunlugu(kenar){} 7 | void setKenar(int kenar); 8 | int getKenar(); 9 | friend class Dikdortgen; 10 | private: 11 | int kenarUzunlugu; 12 | }; 13 | void Kare::setKenar(int kenar) { 14 | kenarUzunlugu=kenar; 15 | } 16 | int Kare::getKenar(){ 17 | return kenarUzunlugu; 18 | } 19 | class Dikdortgen{ 20 | public: 21 | int Alan(Kare &K){ 22 | return K.kenarUzunlugu * K.kenarUzunlugu ; 23 | } 24 | }; 25 | int main() { 26 | Kare K1(15); 27 | Dikdortgen D1; 28 | cout << &K1 << endl; 29 | cout << "ilk deger:" << K1.getKenar() << endl; 30 | K1.setKenar(50); 31 | cout << "son deger:" << K1.getKenar() << endl; 32 | cout << "Karenin Alani:" << D1.Alan(K1) << endl; 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /Ders/18_Pointer/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | class Kutu { 6 | public: 7 | Kutu(double g = 2.0, double d = 2.0, double y = 2.0); 8 | 9 | double hacim(); 10 | 11 | private: 12 | double genislik; 13 | double derinlik; 14 | double yukseklik; 15 | }; 16 | 17 | Kutu::Kutu(double g, double d, double y) { 18 | cout << "Yapıcı Fanksiyon Çağrılıyor......" << endl; 19 | genislik = g; 20 | derinlik = d; 21 | yukseklik = y; 22 | } 23 | 24 | double Kutu::hacim() { 25 | return genislik * derinlik * yukseklik; 26 | } 27 | 28 | int main() { 29 | Kutu Kutu1(10.1, 10.2, 10.3); 30 | cout << "Kutu Nesnensinin Hacmi :" << Kutu1.hacim() << endl; 31 | Kutu Kutu2(5.2, 5.3, 5.4); 32 | Kutu *ptrKutu; 33 | 34 | ptrKutu = &Kutu2; 35 | cout << "Kutu Nesnensinin Hacmi :" << ptrKutu->hacim() << endl; 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /Ders/25_Polymorphism_3/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | class Hayvan{ 5 | public: 6 | virtual string konusma(){ 7 | return "Konusamiyor"; 8 | } 9 | }; 10 | class Kedi: public Hayvan{ 11 | public: 12 | string konusma() override{ 13 | return "Miyav Miyav"; 14 | } 15 | }; 16 | 17 | class Kopek: public Hayvan{ 18 | public: 19 | string konusma() override{ 20 | return "Hav Hav"; 21 | } 22 | }; 23 | 24 | class Kurt: public Hayvan{ 25 | public: 26 | string konusma()override{ 27 | return "Ouu Ouu"; 28 | } 29 | }; 30 | int main() { 31 | 32 | Hayvan *ptrDiziHayvan[3]; 33 | ptrDiziHayvan[0]=new Kedi(); 34 | ptrDiziHayvan[1]=new Kopek(); 35 | ptrDiziHayvan[2]=new Kurt(); 36 | 37 | for (int i = 0; i < 3; ++i) { 38 | cout<< ptrDiziHayvan[i]->konusma() << endl; 39 | } 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /Lab_Calismalari/Baslik_Ornek/sensor.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by hyuce on 15.10.2024. 3 | // 4 | #include 5 | #include "sensor.h" 6 | 7 | using namespace std; 8 | 9 | // Sıcaklık sensöründen veri okuma fonksiyonu (Simülasyon) 10 | double okuSicaklik() { 11 | // Gerçek uygulamada burada sensör verisi okunur 12 | // Bu örnekte rastgele bir sıcaklık değeri döndürülmektedir 13 | return 25.0 + rand() % 10; // 25.0 ile 34.0 arasında bir değer 14 | } 15 | double okuNem() { 16 | // Gerçek uygulamada burada sensör verisi okunur 17 | // Bu örnekte rastgele bir nem değeri döndürülmektedir 18 | return 40.0 + rand() % 20; // 40.0 ile 59.0 arasında bir değer 19 | } 20 | 21 | // Alarm kontrol fonksiyonu 22 | void kontrolEt(double sicaklik, double nem, bool &alarm, double sicaklikEsik, double nemEsik) { 23 | if (sicaklik > sicaklikEsik || nem > nemEsik) { 24 | alarm = true; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Ders/23_Polymorphism_1/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | class Insan{ 4 | public: 5 | virtual string konusma (){ 6 | return "Kanusamiyor"; 7 | } 8 | }; 9 | 10 | class Turk:Insan{ 11 | public: 12 | string konusma () override{ 13 | return "Merhaba"; 14 | } 15 | }; 16 | 17 | class Ingiliz:Insan{ 18 | public: 19 | string konusma () override{ 20 | return "Hello"; 21 | } 22 | }; 23 | 24 | class Alman:Insan{ 25 | public: 26 | string konusma () override{ 27 | return "Hallo"; 28 | } 29 | }; 30 | 31 | int main() { 32 | Insan insan1; 33 | Turk turk1; 34 | Ingiliz ingiliz1; 35 | Alman alman1; 36 | cout << "Insan :" << insan1.konusma()<< endl; 37 | cout << "Turk :" << turk1.konusma()<< endl; 38 | cout << "Ingiliz :" << ingiliz1.konusma()<< endl; 39 | cout << "Alman :" << alman1.konusma()<< endl; 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /Ders/33_Template_7/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; // std isim alanını kullan 5 | 6 | template 7 | bool karsilastir(T a, T b) { 8 | cout << "Genel karsilastir kullaniliyor\n"; 9 | return a == b; 10 | } 11 | 12 | template <> 13 | bool karsilastir(const char* a, const char* b) { 14 | cout << "const char* karsilastirmasi kullaniliyor\n"; 15 | return strcmp(a, b) == 0; 16 | } 17 | 18 | int main() { 19 | int x = 5, y = 10; 20 | cout << karsilastir(x, y) << endl; 21 | 22 | double pi = 3.14, e = 2.71; 23 | cout << karsilastir(pi, e) << endl; 24 | 25 | const char* str1 = "elma"; 26 | const char* str2 = "armut"; 27 | cout << karsilastir(str1, str2) << endl; 28 | 29 | const char* str3 = "elma"; 30 | const char* str4 = "elma"; 31 | cout << karsilastir(str3, str4) << endl; 32 | 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /Ders/9_Class_Constructor_1/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | //Class Constructor 3 | 4 | using namespace std; 5 | 6 | class Cizgi{ 7 | public: 8 | void setUzunluk(double CizgiUzunluk); 9 | double getUzunluk(void); 10 | Cizgi(); 11 | ~Cizgi(); 12 | private: 13 | double uzunluk; 14 | }; 15 | 16 | Cizgi::Cizgi() { 17 | cout << "Su anda nesne olusturuluyor" << endl; 18 | uzunluk = 10; 19 | } 20 | Cizgi::~Cizgi() { 21 | cout << "\n Su anda nesne kaldiriliyor" << endl; 22 | } 23 | 24 | void Cizgi::setUzunluk(double CizgiUzunluk) { 25 | uzunluk=CizgiUzunluk; 26 | } 27 | 28 | double Cizgi::getUzunluk() { 29 | return uzunluk; 30 | } 31 | 32 | int main() { 33 | Cizgi cizgi_1; 34 | cout << "Cizginin Olusturulurken Uzunlugu : " << cizgi_1.getUzunluk(); 35 | cizgi_1.setUzunluk(55.55); 36 | cout << "\nCizginin Degeri Degistikden Sonraki Uzunlugu : " << cizgi_1.getUzunluk(); 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /Ders/34_Template_Buble_Sort_5/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | template 5 | void KabarcikSiralamasi(T a[], int n){ 6 | for (int i = 0; i < n; i++) { 7 | for (int j = n-1; i (a,n); 21 | 22 | cout << "integer Sıralanmış Dizi :\n" ; 23 | for (int i = 0; i < n; i++) { 24 | cout << a[i] << "\t" << endl; 25 | } 26 | 27 | double b[5]={1.1,5.5,3.3,4.4,2.2}; 28 | int m = sizeof (b) / sizeof (b[0]); 29 | 30 | KabarcikSiralamasi(b,n); 31 | 32 | cout << "double Sıralanmış Dizi :\n" ; 33 | for (int i = 0; i < n; i++) { 34 | cout << b[i] << "\t" << endl; 35 | } 36 | 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /Ders/22_Overloading_Asiri_Yukleme_7/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class Kutu { 4 | private: 5 | double uzunluk, genislik, yukseklik, hacim; 6 | 7 | public: 8 | double getHacim() const; 9 | Kutu(double u, double g, double y) : uzunluk(u), 10 | genislik(g), yukseklik(y), hacim(u * g * y) {} 11 | 12 | Kutu &operator+=(const Kutu &x) { 13 | hacim += x.getHacim(); 14 | return *this; 15 | } 16 | }; 17 | 18 | double Kutu::getHacim() const { 19 | return hacim; 20 | } 21 | 22 | int main() { 23 | Kutu kutu[2] = {{10, 20, 30}, {10, 20, 40}}; 24 | Kutu ToplamKutu(0, 0, 0); 25 | 26 | std::cout << "Kutu 1 Hacmi: " << kutu[0].getHacim() << std::endl; 27 | std::cout << "Kutu 2 Hacmi: " << kutu[1].getHacim() << std::endl; 28 | 29 | for (int i = 0; i < 2; ++i) { 30 | ToplamKutu += kutu[i]; 31 | } 32 | 33 | std::cout << "Toplam Kutu Hacmi: " << ToplamKutu.getHacim() << std::endl; 34 | 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /Ders/4_Bellek_Yonetimi_2/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | int main() { 7 | // stack memory 8 | int dizi_stack[5] = {11, 22, 33, 44, 55}; 9 | for (int i = 0; i < 5; ++i) { 10 | cout << dizi_stack[i] << endl; 11 | } 12 | 13 | cout << "____________________" << endl; 14 | 15 | // heap memory 16 | int *dizi_heap = (int *) malloc(sizeof(int) * 5); 17 | for (int i = 0; i < 5; ++i) { 18 | *(dizi_heap + i) = i + 11; 19 | } 20 | for (int i = 0; i < 5; ++i) { 21 | cout << dizi_heap[i] << endl; 22 | } 23 | free(dizi_heap); 24 | 25 | cout << "____________________" << endl; 26 | 27 | // new ile heap memory 28 | int *dizi_n = new int[5]; 29 | for (int i = 0; i < 5; ++i) { 30 | *(dizi_n + i) = i + 22; 31 | } 32 | for (int i = 0; i < 5; ++i) { 33 | cout << dizi_n[i] << endl; 34 | } 35 | delete[] dizi_n; 36 | 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /Ders/21_Virtual_Function/main2.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | class Memeli { 6 | private: 7 | string tur; 8 | public: 9 | Memeli() : tur("Memeli") {} 10 | 11 | virtual string getTur() { 12 | return tur; 13 | } 14 | }; 15 | 16 | class Kopek : public Memeli { 17 | private: 18 | string tur; 19 | public: 20 | Kopek() : tur("Kopek") {} 21 | 22 | string getTur() { 23 | return tur; 24 | } 25 | 26 | }; 27 | 28 | class Kedi : public Memeli { 29 | private: 30 | string tur; 31 | public: 32 | Kedi() : tur("Kedi") {} 33 | 34 | string getTur() { 35 | return tur; 36 | } 37 | }; 38 | 39 | void yaz(Memeli* memeli){ 40 | cout << "Tur : " << memeli->getTur() << endl; 41 | } 42 | 43 | int main() { 44 | Memeli* memeli1 = new Memeli(); 45 | yaz(memeli1); 46 | Memeli* kopek1 = new Kopek(); 47 | yaz(kopek1); 48 | Memeli* kedi1 = new Kedi(); 49 | yaz(kedi1); 50 | 51 | return 0; 52 | } 53 | -------------------------------------------------------------------------------- /Ders/10_Class_Constructor_2/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | //Class Constructor with param 3 | 4 | using namespace std; 5 | 6 | class Cizgi{ 7 | public: 8 | void setUzunluk(double CizgiUzunluk); 9 | double getUzunluk(void); 10 | Cizgi(double CizgiUzunluk); 11 | ~Cizgi(); 12 | private: 13 | double uzunluk; 14 | }; 15 | 16 | Cizgi::Cizgi(double CizgiUzunluk) { 17 | cout << "Su anda nesne olusturuluyor" << endl; 18 | uzunluk = CizgiUzunluk; 19 | cout << "Cizginin Olusturulurken verilen Uzunluk : " << CizgiUzunluk; 20 | } 21 | Cizgi::~Cizgi() { 22 | cout << "\n Su anda nesne kaldiriliyor" << endl; 23 | } 24 | 25 | void Cizgi::setUzunluk(double CizgiUzunluk) { 26 | uzunluk=CizgiUzunluk; 27 | } 28 | 29 | double Cizgi::getUzunluk() { 30 | return uzunluk; 31 | } 32 | 33 | int main() { 34 | Cizgi cizgi_1(10); 35 | cizgi_1.setUzunluk(55.55); 36 | cout << "\nCizginin Degeri Degistikden Sonraki Uzunlugu : " << cizgi_1.getUzunluk(); 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /Ders/11_Class_Constructor_4/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Otomobil { 7 | public: 8 | string marka; 9 | string model; 10 | int yil; 11 | 12 | Otomobil(string x, string y, int z); 13 | Otomobil(){}; 14 | ~Otomobil(); 15 | 16 | }; 17 | 18 | Otomobil::Otomobil(string x, string y, int z) { 19 | marka = x; 20 | model = y; 21 | yil = z; 22 | } 23 | 24 | Otomobil::~Otomobil() { 25 | cout << "\nŞu anda nesne kaldırılıyor..." << endl; 26 | } 27 | 28 | 29 | int main() { 30 | Otomobil Otomobil1("Mercedes", "C180", 2021); 31 | cout << Otomobil1.marka << endl; 32 | cout << Otomobil1.model << endl; 33 | cout << Otomobil1.yil << endl; 34 | 35 | Otomobil Otomobil2; 36 | Otomobil2.marka="Tofas"; 37 | Otomobil2.model="Egea"; 38 | Otomobil2.yil=2020; 39 | cout << Otomobil2.marka << endl; 40 | cout << Otomobil2.model << endl; 41 | cout << Otomobil2.yil << endl; 42 | 43 | return 0; 44 | } 45 | -------------------------------------------------------------------------------- /Ders/32_Template_3/Dizi.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by hyuce on 14.01.2021. 3 | // 4 | 5 | #ifndef INC_32_TEMPLATE_3_DIZI_H 6 | #define INC_32_TEMPLATE_3_DIZI_H 7 | 8 | #include 9 | 10 | template 11 | class Dizi 12 | { 13 | private: 14 | int m_uzunluk; 15 | T* m_veri; 16 | public: 17 | Dizi(){ 18 | m_uzunluk=0; 19 | m_veri= nullptr; 20 | } 21 | Dizi(int uzunluk){ 22 | assert(uzunluk>0); 23 | m_veri = new T[uzunluk]; 24 | m_uzunluk=uzunluk; 25 | } 26 | ~Dizi(){ 27 | delete[] m_veri; 28 | } 29 | void Sil(){ 30 | delete[] m_veri; 31 | m_veri= nullptr; 32 | m_uzunluk = 0; 33 | } 34 | T& operator[](int index){ 35 | assert(index >=0 && index < m_uzunluk); 36 | return m_veri[index]; 37 | } 38 | 39 | int getUzunluk(); 40 | }; 41 | 42 | template 43 | int Dizi::getUzunluk() { 44 | return m_uzunluk; 45 | } 46 | 47 | #endif //INC_32_TEMPLATE_3_DIZI_H 48 | -------------------------------------------------------------------------------- /Ders/20_Miras_Inheritance/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | class Sekil { 5 | protected: 6 | int genislik, yukseklik; 7 | public: 8 | Sekil(int gen, int yuk):genislik(gen),yukseklik(yuk) {} 9 | void setYaz(int gen, int yuk){ 10 | genislik=gen; 11 | yukseklik=yuk; 12 | } 13 | void getOku() { 14 | cout << "Nesnenin Genisligi : " << genislik << endl; 15 | cout << "Nesnenin Yuksekligi : " << yukseklik << endl; 16 | } 17 | }; 18 | class Dikdortgen : public Sekil { 19 | public: 20 | Dikdortgen(int gen, int yuk) : Sekil(gen, yuk) {} 21 | int getAlan() { 22 | return genislik * yukseklik; 23 | } 24 | }; 25 | int main() 26 | { 27 | Dikdortgen *D1=new Dikdortgen(3,4); 28 | D1->getOku(); 29 | cout << "Diktortgenin Alani: " << D1->getAlan() << endl; 30 | D1->setYaz(10,20); 31 | D1->getOku(); 32 | cout << "Diktortgenin Alani: " << D1->getAlan() << endl; 33 | delete D1; 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /Ders/22_Overloading_Asiri_Yukleme_2/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | class sayi{ 5 | public: 6 | int deger; 7 | sayi(){} 8 | sayi(int s1){ 9 | deger = s1; 10 | } 11 | // toplama operatörüne aşırı yükleme 12 | sayi operator+(sayi s2) { 13 | sayi toplam; 14 | toplam.deger = deger + s2.deger; 15 | //deger, sayi1 ile aldığımız değer olur 16 | // yani metod sayi1 değerini doğrudan 17 | //sayi2 değerini ise parametre olarak alır. 18 | return (toplam); 19 | } 20 | }; 21 | 22 | int main() { 23 | sayi sayi1(10); 24 | sayi sayi2(33); 25 | sayi sayi3; 26 | 27 | int sayi4; 28 | 29 | sayi3 = sayi1 + sayi2; 30 | sayi4 = 25 + 85; 31 | 32 | cout << "\nSayi 1 degeri : " << sayi1.deger << endl; 33 | cout << "\nSayi 2 degeri : " << sayi2.deger << endl; 34 | cout << "\nSayi 3 degeri : " << sayi3.deger << endl; 35 | cout << "\nSayi 4 degeri : " << sayi4 << endl; 36 | 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /Lab_Calismalari/Baslik_Ornek/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include // rand() fonksiyonu için 3 | #include // srand() fonksiyonu için 4 | #include "sensor.h" 5 | using namespace std; 6 | int main() { 7 | // Rastgele sayı üretimi için tohumlama 8 | srand(time(0)); 9 | 10 | // Eşik Değerler 11 | double sicaklikEsik = 30.0; // 30°C 12 | double nemEsik = 50.0; // %50 13 | 14 | // Alarm Durumu 15 | bool alarm = false; 16 | 17 | // Sensör Verilerini Oku 18 | double sicaklik = okuSicaklik(); 19 | double nem = okuNem(); 20 | // Verileri Ekrana Yazdır 21 | cout << "Sıcaklık: " << sicaklik << "°C" << endl; 22 | cout << "Nem: " << nem << "%" << endl; 23 | 24 | // Alarm Kontrolü 25 | kontrolEt(sicaklik, nem, alarm, sicaklikEsik, nemEsik); 26 | 27 | if (alarm) { 28 | cout << "ALARM: Eşik değerler aşıldı!" << endl; 29 | } else { 30 | cout << "Sistem normal çalışıyor." << endl; 31 | } 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /Ders/35_2_Dosya_Islemleri/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | int main() { 7 | 8 | fstream Dosya; 9 | Dosya.open("deneme.txt", fstream::trunc | fstream::in | fstream::out); 10 | if (Dosya.is_open()) { 11 | cout << "Dosya Açıldı" << endl; 12 | string satir; 13 | 14 | // YAZMA 15 | 16 | while (Dosya) { 17 | getline(cin, satir); 18 | if (satir == "-Q") 19 | break; 20 | Dosya << satir << endl; 21 | } 22 | 23 | // OKUMA 24 | int pozisyon = Dosya.tellg(); 25 | cout << "dosyanin bulunduğu pozisyon : " << pozisyon << endl; 26 | Dosya.seekg(pozisyon - 10, fstream::beg); 27 | while (Dosya) { 28 | getline(Dosya, satir); 29 | cout << satir << endl; 30 | } 31 | 32 | } else { 33 | cout << "Dosya Açılırken hata oluştu" << endl; 34 | } 35 | 36 | Dosya.close(); 37 | 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /Ders/13_Friend_Class_2/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | class Kare { 6 | friend class Dikdortgen; 7 | 8 | public: 9 | Kare(int a); 10 | 11 | private: 12 | int kenar; 13 | }; 14 | 15 | class Dikdortgen { 16 | int genislik, yukseklik; 17 | public: 18 | void setKenarlar(int gen, int yuk); 19 | 20 | int alan(); 21 | 22 | void cevir(Kare &a); 23 | }; 24 | 25 | void Dikdortgen::setKenarlar(int gen, int yuk) { 26 | genislik = gen; 27 | yukseklik = yuk; 28 | } 29 | 30 | int Dikdortgen::alan() { 31 | return genislik * yukseklik; 32 | } 33 | 34 | void Dikdortgen::cevir(Kare &a) { 35 | genislik = a.kenar; 36 | yukseklik = a.kenar; 37 | } 38 | 39 | Kare::Kare(int a) { 40 | kenar = a; 41 | } 42 | 43 | 44 | 45 | int main() { 46 | Dikdortgen diktorgen1; 47 | diktorgen1.setKenarlar(15,20); 48 | cout << diktorgen1.alan() << endl; 49 | 50 | Kare kare1(50); 51 | diktorgen1.cevir(kare1); 52 | cout << diktorgen1.alan() << endl; 53 | 54 | return 0; 55 | } 56 | -------------------------------------------------------------------------------- /Ders/17_This_Pointer/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | class Kutu{ 5 | public: 6 | Kutu(double g=2.0, double d=2.0, double y=2.0); 7 | double hacim(); 8 | int karsilastir(Kutu kutu); 9 | private: 10 | double genislik, derinlik, yukseklik; 11 | }; 12 | Kutu::Kutu(double g, double d, double y) { 13 | cout<< "Kurucu fonksiyon yukleniyor..." << endl; 14 | this->genislik=g; derinlik=d; yukseklik=y; 15 | } 16 | double Kutu::hacim() { 17 | return genislik*derinlik*yukseklik; 18 | } 19 | int Kutu::karsilastir(Kutu kutu) { 20 | return this->hacim() > kutu.hacim(); 21 | } 22 | int main() { 23 | Kutu birinciKutu; 24 | Kutu ikinciKutu(0.3,0.4,0.5); 25 | cout << "1. Kutu Hacimi :" << birinciKutu.hacim() << endl; 26 | cout << "2. Kutu Hacimi :" << ikinciKutu.hacim() << endl; 27 | if(birinciKutu.karsilastir(ikinciKutu)){ 28 | cout<< "Kutu 2 kutu 1'den daha kucuktur" < 2 | 3 | using namespace std; 4 | 5 | class Kutu { 6 | public: 7 | double derinlik; 8 | double genislik; 9 | double yukseklik; 10 | double HacimHesapla(){ 11 | return derinlik * genislik *yukseklik; 12 | } 13 | }; 14 | 15 | int main() { 16 | Kutu kutu_1; 17 | kutu_1.derinlik=11.5; 18 | kutu_1.genislik=22.5; 19 | kutu_1.yukseklik=10.5; 20 | cout << "Kutunun derinligi : " << kutu_1.derinlik; 21 | cout << "\nKutunun genisligi : " << kutu_1.genislik; 22 | cout << "\nKutunun yuksekligi : " << kutu_1.yukseklik; 23 | cout << "\nKutunun Hacmi : " << kutu_1.HacimHesapla(); 24 | cout << "\n"< 2 | 3 | using namespace std; 4 | 5 | class Sensor { 6 | public: 7 | virtual int veri(int deger) = 0; 8 | virtual ~Sensor() {} // Sanal yıkıcı eklenmiştir 9 | }; 10 | 11 | class Sensor1 : public Sensor { 12 | public: 13 | int veri(int deger) override { 14 | return deger; 15 | } 16 | }; 17 | 18 | class Sensor2 : public Sensor { 19 | public: 20 | int veri(int deger) override { 21 | return deger; 22 | } 23 | }; 24 | 25 | class Sensor3 : public Sensor { 26 | public: 27 | int veri(int deger) override { 28 | return deger; 29 | } 30 | }; 31 | 32 | int main() { 33 | Sensor* ptrSensor[3]; 34 | ptrSensor[0] = new Sensor1(); 35 | ptrSensor[1] = new Sensor2(); 36 | ptrSensor[2] = new Sensor3(); 37 | 38 | for (int i = 0; i < 3; ++i) { 39 | cout << ptrSensor[i]->veri((i + 1) * 20) << endl; 40 | } 41 | 42 | // Bellek sızıntısını önlemek için delete kullanılmalı 43 | for (int i = 0; i < 3; ++i) { 44 | delete ptrSensor[i]; 45 | } 46 | 47 | return 0; 48 | } 49 | -------------------------------------------------------------------------------- /Ders/13_Friend_Fonksiyon_1/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class Kare; 4 | 5 | class Dikdortgen { 6 | public: 7 | Dikdortgen(int uzunluk, int genislik) : uzunluk(uzunluk), genislik(genislik) {} 8 | 9 | friend void KareAlanHesapla(const Kare& kare, const Dikdortgen& dikdortgen); 10 | 11 | private: 12 | int uzunluk; 13 | int genislik; 14 | }; 15 | 16 | class Kare { 17 | public: 18 | Kare(int kenar) : kenarUzunlugu(kenar) {} 19 | 20 | friend void KareAlanHesapla(const Kare& kare, const Dikdortgen& dikdortgen); 21 | 22 | private: 23 | int kenarUzunlugu; 24 | }; 25 | 26 | void KareAlanHesapla(const Kare& kare, const Dikdortgen& dikdortgen) { 27 | int kareAlani = kare.kenarUzunlugu * kare.kenarUzunlugu; 28 | int dikdortgenAlani = dikdortgen.uzunluk * dikdortgen.genislik; 29 | 30 | std::cout << "Kare Alanı: " << kareAlani << std::endl; 31 | std::cout << "Dikdörtgen Alanı: " << dikdortgenAlani << std::endl; 32 | } 33 | 34 | int main() { 35 | Kare kare(5); 36 | Dikdortgen dikdortgen(10, 20); 37 | 38 | KareAlanHesapla(kare, dikdortgen); 39 | 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /Ders/33_Template_6/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | template 7 | vector veriyiFiltrele(const vector& veri, T esikDegeri) { 8 | vector filtrelenmisVeri; 9 | for (const T& deger : veri) { 10 | if (abs(deger) > esikDegeri) { // Mutlak değer karşılaştırması 11 | filtrelenmisVeri.push_back(deger); 12 | } 13 | } 14 | return filtrelenmisVeri; 15 | } 16 | 17 | int main() { 18 | vector sicaklikVerisi = {25.3, 26.1, -100.0, 24.8, 25.7}; 19 | vector ivmeVerisi = {10, -20, 5, 30, -50}; 20 | 21 | vector filtrelenmisSicaklik = veriyiFiltrele(sicaklikVerisi, 50.0); 22 | vector filtrelenmisIvme = veriyiFiltrele(ivmeVerisi, 25); 23 | 24 | cout << "Filtrelenmis Sicaklik Verisi: "; 25 | for(double deger: filtrelenmisSicaklik) 26 | cout << deger << " "; 27 | cout << "\n"; 28 | 29 | cout << "Filtrelenmis Ivme Verisi: "; 30 | for(int deger: filtrelenmisIvme) 31 | cout << deger << " "; 32 | cout << "\n"; 33 | 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /Ders/37_Dosya_Islemleri/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | struct Kisi { 7 | char Adi[50]; 8 | int Yasi; 9 | }; 10 | 11 | 12 | int main() { 13 | Kisi ogrenci1 = {"Ali", 15}; 14 | Kisi *ptrOgrenci = &ogrenci1; 15 | 16 | fstream Dosya; 17 | Dosya.open("deneme.bin", fstream::binary | fstream::out); 18 | if (Dosya.is_open()) { 19 | cout << "Dosya başarı ile Açıldı" << endl; 20 | Dosya.write((char *) (ptrOgrenci), sizeof(ogrenci1)); 21 | 22 | Dosya.seekg(0, Dosya.end); 23 | int boyut = Dosya.tellg(); 24 | Dosya.seekg(0, Dosya.beg); 25 | cout << "Dosya Boyutu:" << boyut << endl; 26 | Dosya.close(); 27 | ogrenci1 = {}; 28 | 29 | } else { 30 | cout << "Dosya acilamadi" << endl; 31 | } 32 | 33 | Dosya.open("deneme.bin", fstream::binary | fstream::in); 34 | Dosya.read((char *) (ptrOgrenci), sizeof(ogrenci1)); 35 | cout << "Ogrenci Adi:" << ptrOgrenci->Adi << endl; 36 | cout << "Ogrenci yasi:" << ptrOgrenci->Yasi << endl; 37 | Dosya.close(); 38 | return 0; 39 | } 40 | 41 | -------------------------------------------------------------------------------- /Ders/16_Inline/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | using namespace std; 5 | int fonk(int a, int b); 6 | inline int fonk_inline(int a, int b); 7 | 8 | int fonk(int a, int b){ 9 | return (a+b)*(a+b); 10 | } 11 | 12 | int fonk_inline(int a, int b){ 13 | return (a+b)*(a+b); 14 | } 15 | 16 | #define HESAPLA(x,y) ((x)+(y))*((x)+(y)) 17 | 18 | int main() { 19 | chrono::time_point d_basla, d_son; 20 | d_basla = chrono::system_clock::now(); 21 | for (int i = 0; i < 90000; ++i) { 22 | for (int j = 0; j < 90000; ++j) { 23 | //fonk(i,j); 24 | fonk_inline(i,j); 25 | // HESAPLA(i,j); 26 | } 27 | } 28 | d_son = chrono::system_clock::now(); 29 | 30 | chrono::duration gecen_zaman = d_son - d_basla; 31 | time_t baslangic_zamani = chrono::system_clock::to_time_t(d_basla); 32 | time_t bitis_zamani = chrono::system_clock::to_time_t(d_son); 33 | 34 | cout<< "Baslangic Zamani :" << ctime(&baslangic_zamani) << endl; 35 | cout<< "Bitis Zamani :" << ctime(&bitis_zamani) << endl; 36 | cout<< "Gecen Süre :" << gecen_zaman.count()<<" saniyedir" << endl; 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /Ders/22_Overloading_Asiri_Yukleme_4/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #ifdef _WIN32 4 | #include 5 | #endif 6 | #ifdef __unix__ 7 | #include 8 | #endif 9 | 10 | using namespace std; 11 | 12 | class Zaman { 13 | public: 14 | void gosterZaman(); 15 | 16 | Zaman() { 17 | saat = 0; 18 | dakika = 0; 19 | } 20 | 21 | Zaman(int s, int d) { 22 | saat = s; 23 | dakika = d; 24 | } 25 | 26 | Zaman operator++() { 27 | ++dakika; 28 | if (dakika >= 60) { 29 | ++saat; 30 | dakika -= 60; 31 | } 32 | return Zaman(saat, dakika); 33 | } 34 | 35 | private: 36 | int saat, dakika; 37 | }; 38 | 39 | void Zaman::gosterZaman() { 40 | cout << setw(2) << setfill('0') << saat << " : " << setw(2) 41 | << setfill('0') << dakika << "\r"; 42 | } 43 | 44 | int main() { 45 | Zaman Z1(01, 59); 46 | 47 | for (int i = 0; i < 120; ++i) { 48 | ++Z1; 49 | Z1.gosterZaman(); 50 | #ifdef _WIN32 51 | // Windows özel kodu 52 | Sleep(100); // 1 saniye bekletme 53 | #endif 54 | 55 | #ifdef __unix__ 56 | // UNIX özel kodu 57 | sleep(1); // 1 saniye bekletme 58 | #endif 59 | } 60 | return 0; 61 | } 62 | -------------------------------------------------------------------------------- /Ders/22_Overloading_Asiri_Yukleme_3/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | class Kutu{ 4 | private: 5 | double uzunluk,genislik,yukseklik,hacim; 6 | public: 7 | double getHacim(); 8 | void setOzellikler(double uzn,double gen,double yuk); 9 | 10 | Kutu operator+(Kutu& b){ 11 | Kutu kutu1; 12 | kutu1.hacim= this->getHacim()+b.getHacim(); 13 | return kutu1; 14 | } 15 | }; 16 | 17 | double Kutu::getHacim() { 18 | return hacim; 19 | } 20 | void Kutu::setOzellikler(double uzn,double gen,double yuk) { 21 | uzunluk=uzn; 22 | genislik=gen; 23 | yukseklik=yuk; 24 | hacim=uzn*gen*yuk; 25 | } 26 | 27 | int main(){ 28 | Kutu k1; 29 | Kutu k2; 30 | Kutu k3; 31 | Kutu k4; 32 | double hacim{}; 33 | 34 | k1.setOzellikler(1.00,1.00,1.00); 35 | hacim = k1.getHacim(); 36 | cout << "Kutu 1'in hacmi : " << hacim << endl; 37 | k2.setOzellikler(2.00,2.00,2.00); 38 | hacim = k2.getHacim(); 39 | cout << "Kutu 2'in hacmi : " << hacim << endl; 40 | k3 = k1 + k2; 41 | hacim = k3.getHacim(); 42 | cout << "Kutu 3'in hacmi : " << hacim << endl; 43 | 44 | k4 = k3+k1+k2; 45 | hacim = k4.getHacim(); 46 | cout << "Kutu 4'in hacmi : " << hacim << endl; 47 | return 0; 48 | } 49 | -------------------------------------------------------------------------------- /Ders/24_Polymorphism_2/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | class Sekil{ 6 | protected: 7 | int genislik, yukseklik; 8 | public: 9 | Sekil(int a=0, int b=0); 10 | virtual int alan(); 11 | // int alan(); 12 | }; 13 | Sekil::Sekil(int a, int b) { 14 | genislik=a; 15 | yukseklik=b; 16 | } 17 | int Sekil::alan() { 18 | cout << "Ebeveyn sınıf alanı : " << endl; 19 | return 0; 20 | } 21 | class Dikdortgen: public Sekil{ 22 | public: 23 | Dikdortgen(int a=0, int b=0):Sekil(a, b){} 24 | int alan(){ 25 | cout << "Dikdörtgen alanı : " << endl; 26 | return (genislik*yukseklik); 27 | } 28 | }; 29 | class Ucgen: public Sekil{ 30 | public: 31 | Ucgen(int a=0, int b=0):Sekil(a, b){} 32 | int alan(){ 33 | cout << "Uçgen alanı : " << endl; 34 | return (genislik*yukseklik)/2; 35 | } 36 | }; 37 | 38 | 39 | 40 | int main() { 41 | Sekil *sekil1, *sekil2; 42 | 43 | Sekil sek; 44 | 45 | Dikdortgen dik(10,20); 46 | Ucgen ucg(15,25); 47 | 48 | // cout << sek.alan() << endl; 49 | // cout << dik.alan() << endl; 50 | // cout << ucg.alan() << endl; 51 | 52 | sekil1 = &dik ; 53 | cout << sekil1->alan() << endl; 54 | sekil2 = &ucg ; 55 | cout << sekil2->alan() << endl; 56 | 57 | return 0; 58 | } 59 | -------------------------------------------------------------------------------- /Ders/11_Class_Constructor_5/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | class CepTelefonu { 4 | public: 5 | void setYaz(string, string, int, int); 6 | void getBilgi(); 7 | CepTelefonu(string, string, int, int); 8 | ~CepTelefonu(); 9 | private: 10 | string Marka; 11 | string Model; 12 | int RAM; 13 | int DiskBoyutu; 14 | }; 15 | 16 | void CepTelefonu::setYaz(string xMarka, string xModel, int xRAM, int xDiskBoyutu) { 17 | Marka = xMarka; 18 | Model = xModel; 19 | RAM = xRAM; 20 | DiskBoyutu = xDiskBoyutu; 21 | } 22 | 23 | void CepTelefonu::getBilgi() { 24 | cout << Marka << endl; 25 | cout << Model << endl; 26 | cout << RAM << endl; 27 | cout << DiskBoyutu << endl; 28 | 29 | } 30 | 31 | CepTelefonu::CepTelefonu(string yMarka, string yModel, int yRAM, int yDiskBoyutu) { 32 | Marka = yMarka; 33 | Model = yModel; 34 | RAM = yRAM; 35 | DiskBoyutu = yDiskBoyutu; 36 | cout << "Nesne Olusturuldu..." << endl; 37 | } 38 | 39 | CepTelefonu::~CepTelefonu() { 40 | cout << "\nnesne silindi..." << endl; 41 | } 42 | 43 | int main() { 44 | // CepTelefonu Samsung("Samsung", "S21", 6, 128); 45 | // Samsung.getBilgi(); 46 | CepTelefonu *Xiaomi = new CepTelefonu("Xiaomi", "10T", 6, 128); 47 | Xiaomi->getBilgi(); 48 | delete Xiaomi; 49 | return 0; 50 | } 51 | -------------------------------------------------------------------------------- /Ders/21_Miras_Inheritance_3/readme.md: -------------------------------------------------------------------------------- 1 | 2 | ### 1. **Getter ve Setter Metodları**: 3 | 4 | * `SinifA` sınıfındaki `x`, `y` ve `z` gibi üyelere doğrudan erişim yerine, kontrollü erişim sağlayan getter ve setter metodları ekledim. 5 | * **`getX()`, `setX()`, `getY()`, `setY()`** gibi metodlar sınıf dışından güvenli bir şekilde verilere erişim sağlar. 6 | 7 | ### 2. **Kalıtım ve Erişim Belirleyicileri**: 8 | 9 | * **`public` kalıtım**: `SinifB` sınıfı, `SinifA` sınıfının public üyelerini miras alır, böylece `x` değişkenine dışarıdan erişilebilir. 10 | * **`protected` kalıtım**: `SinifC` sınıfı, `SinifA` sınıfının public üyelerini protected olarak miras alır, böylece sadece `SinifC` ve türetilmiş sınıflar `x` değişkenine erişebilir. 11 | * **`private` kalıtım**: `SinifD` sınıfı, `SinifA` sınıfının tüm üyelerini private olarak miras alır, böylece dışarıdan erişim engellenir. 12 | 13 | ### 3. **Modüler Yapı**: 14 | 15 | * Getter ve setter metodları sayesinde, dışarıdan sınıfın iç yapısına müdahale edilmeden veri yönetimi sağlanır. 16 | * Her sınıfın farklı kalıtım türlerine göre, sınıflar arasındaki veri erişim düzeyleri ve kapsülleme güvenli bir şekilde sağlanır. 17 | 18 | ### 4. **Kapsülleme**: 19 | 20 | * Sınıfların üyeleri `private` ve `protected` olarak tanımlandı, böylece doğrudan erişim kısıtlandı. Bu, kapsülleme ilkesine uygun bir yapıdır ve veri güvenliğini artırır. 21 | -------------------------------------------------------------------------------- /Ders/5_Class_1/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | class Tarih { 6 | private: 7 | int Gun; 8 | int Ay; 9 | int Yil; 10 | public: 11 | int gun() { return Gun; } 12 | int ay() { return Ay; } 13 | int yil() { 14 | return Yil; 15 | } 16 | bool ayarla(int g, int a, int y); 17 | }; 18 | 19 | bool Tarih::ayarla(int g, int a, int y) { 20 | if ((g < 0) || (g > 31)) return false; 21 | if ((a < 0) || (a > 12)) return false; 22 | if ((y < 0) || (y > 9999)) return false; 23 | Gun = g; 24 | Ay = a; 25 | Yil = y; 26 | return true; 27 | } 28 | 29 | int main() { 30 | Tarih bayram; 31 | Tarih tatiller[5]; 32 | Tarih *birgun; 33 | 34 | birgun = &bayram; 35 | 36 | bayram.ayarla(29,10,2020); 37 | cout << "Gun:" << bayram.gun() << endl; 38 | cout << "Ay:" << bayram.ay() << endl; 39 | cout << "Yil:" << bayram.yil() << endl; 40 | 41 | cout << "------------------" << endl; 42 | 43 | birgun->ayarla(23,04,2020); 44 | cout << "Gun:" << birgun->gun()<< endl; 45 | cout << "Ay:" << birgun->ay() << endl; 46 | cout << "Yil:" << birgun->yil() << endl; 47 | 48 | cout << "------------------" << endl; 49 | 50 | tatiller[0].ayarla(29,12,2020); 51 | cout << "Gun:" << tatiller[0].gun() << endl; 52 | cout << "Ay:" << tatiller[0].ay() << endl; 53 | cout << "Yil:" << tatiller[0].yil() << endl; 54 | 55 | return 0; 56 | } 57 | -------------------------------------------------------------------------------- /Ders/5_Class_4/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | class BankaHesabi { 5 | private: 6 | string hesapSahibi; 7 | double bakiye; 8 | 9 | public: 10 | // Yapıcı Fonksiyon (Constructor) 11 | BankaHesabi(string isim, double ilkBakiye) { 12 | hesapSahibi = isim; 13 | bakiye = ilkBakiye; 14 | } 15 | 16 | // Hesap bakiyesini gösteren metot 17 | void bakiyeGoster() { 18 | cout << "Hesap Sahibi: " << hesapSahibi << ", Bakiye: " << bakiye << " TL" << endl; 19 | } 20 | 21 | // Para yatırma metodu 22 | void paraYatir(double miktar) { 23 | bakiye += miktar; 24 | cout << miktar << " TL yatırıldı. Yeni bakiye: " << bakiye << " TL" << endl; 25 | } 26 | 27 | // Para çekme metodu 28 | void paraCek(double miktar){ 29 | if (bakiye >= miktar) { 30 | bakiye -= miktar; 31 | cout << miktar << " TL çekildi. Yeni bakiye: " << bakiye << " TL" << endl; 32 | } else { 33 | cout << "Yetersiz bakiye!" << endl; 34 | } 35 | } 36 | }; 37 | 38 | int main() { 39 | // Banka hesabı nesneleri oluşturma 40 | BankaHesabi hesap1("Ahmet", 1000); 41 | BankaHesabi hesap2("Ayşe", 1500); 42 | 43 | // Nesnelerin metodlarını kullanma 44 | hesap1.bakiyeGoster(); 45 | hesap2.bakiyeGoster(); 46 | 47 | hesap1.paraYatir(500); 48 | hesap2.paraCek(200); 49 | 50 | return 0; 51 | } 52 | -------------------------------------------------------------------------------- /Ders/22_Overloading/main3.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | class Vektor3D { 5 | private: 6 | double x, y, z; 7 | 8 | public: 9 | // Yapıcı Fonksiyon 10 | Vektor3D(double x = 0, double y = 0, double z = 0) : x(x), y(y), z(z) {} 11 | 12 | // + Operatörünün Aşırı Yüklenmesi (İki vektörün toplamını yapar) 13 | Vektor3D operator+(const Vektor3D& other) const { 14 | return Vektor3D(x + other.x, y + other.y, z + other.z); 15 | } 16 | 17 | // - Operatörünün Aşırı Yüklenmesi (İki vektörün farkını alır) 18 | Vektor3D operator-(const Vektor3D& other) const { 19 | return Vektor3D(x - other.x, y - other.y, z - other.z); 20 | } 21 | 22 | // Ekrana Yazdırma (Arkadaş Fonksiyon) 23 | friend ostream& operator<<(ostream& os, const Vektor3D& vektor) { 24 | os << "(" << vektor.x << ", " << vektor.y << ", " << vektor.z << ")"; 25 | return os; 26 | } 27 | }; 28 | 29 | int main() { 30 | // Robot kolunun başlangıç ve hedef pozisyonları 31 | Vektor3D baslangic(10.5, 20.0, 15.3); 32 | Vektor3D hedef(5.5, 10.0, 5.3); 33 | 34 | // Operatör Aşırı Yükleme Kullanımı 35 | Vektor3D hareket = hedef - baslangic; // Hedefe ulaşmak için gereken hareket 36 | Vektor3D yeniPozisyon = baslangic + hareket; // Yeni pozisyon 37 | 38 | cout << "Başlangıç Pozisyonu: " << baslangic << endl; 39 | cout << "Hedef Pozisyonu: " << hedef << endl; 40 | cout << "Hareket Vektörü: " << hareket << endl; 41 | cout << "Yeni Pozisyon: " << yeniPozisyon << endl; 42 | 43 | return 0; 44 | } 45 | -------------------------------------------------------------------------------- /Ders/21_Miras_Inheritance_3/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | // Temel sınıf SinifA 5 | class SinifA { 6 | public: 7 | // Getter ve Setter fonksiyonları 8 | int getX() const { return x; } 9 | void setX(int value) { x = value; } 10 | 11 | int getY() const { return y; } 12 | void setY(int value) { y = value; } 13 | 14 | protected: 15 | int y; // protected üyeye sınıf dışından erişilebilir 16 | 17 | private: 18 | int z; // private üye yalnızca sınıf içinden erişilebilir 19 | void setZ(int value) { z = value; } 20 | }; 21 | 22 | // SinifB: public kalıtım 23 | class SinifB : public SinifA { 24 | public: 25 | SinifB() { 26 | setX(50); // setX kullanarak x değerini değiştiriyoruz 27 | } 28 | // SinifB, SinifA'nın public üyelerine erişebilir 29 | // SinifA'nın private üyeleri hala erişilemez 30 | }; 31 | 32 | // SinifC: protected kalıtım 33 | class SinifC : protected SinifA { 34 | public: 35 | SinifC() { 36 | setX(50); // setX kullanarak x değerini değiştiriyoruz 37 | } 38 | // SinifC, SinifA'nın public üyelerini protected olarak miras alır 39 | }; 40 | 41 | // SinifD: private kalıtım 42 | class SinifD : private SinifA { 43 | public: 44 | SinifD() { 45 | setX(50); // setX kullanarak x değerini değiştiriyoruz 46 | } 47 | // SinifD, SinifA'nın tüm üyelerini private olarak miras alır 48 | }; 49 | 50 | int main() { 51 | SinifA a; 52 | SinifB b; 53 | SinifC c; 54 | SinifD d; 55 | 56 | // SinifB üzerinden x'e erişim 57 | cout << "SinifB'deki x: " << b.getX() << endl; 58 | 59 | // SinifC'deki x erişilemez, çünkü protected kalıtım var 60 | 61 | // SinifD'deki x erişilemez, çünkü private kalıtım var 62 | 63 | return 0; 64 | } 65 | -------------------------------------------------------------------------------- /Ders/28_Veri_Soyutlama_3/msin2.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace std; 4 | 5 | // Soyut sınıf (Abstract class) 6 | class Sensor { 7 | public: 8 | // Saf sanal fonksiyonlar 9 | virtual void readData() = 0; 10 | virtual void calibrate() = 0; 11 | 12 | virtual ~Sensor() {} 13 | }; 14 | 15 | // Türetilmiş sınıf: Sıcaklık Sensörü 16 | class TemperatureSensor : public Sensor { 17 | public: 18 | void readData() override { 19 | cout << "Sıcaklık Sensörü: 25°C okundu." << endl; 20 | } 21 | 22 | void calibrate() override { 23 | cout << "Sıcaklık Sensörü kalibre edildi." << endl; 24 | } 25 | }; 26 | 27 | // Türetilmiş sınıf: Basınç Sensörü 28 | class PressureSensor : public Sensor { 29 | public: 30 | void readData() override { 31 | cout << "Basınç Sensörü: 1013 hPa okundu." << endl; 32 | } 33 | 34 | void calibrate() override { 35 | cout << "Basınç Sensörü kalibre edildi." << endl; 36 | } 37 | }; 38 | 39 | // Türetilmiş sınıf: Ultrasonik Sensör 40 | class UltrasonicSensor : public Sensor { 41 | public: 42 | void readData() override { 43 | cout << "Ultrasonik Sensör: Mesafe 120 cm ölçüldü." << endl; 44 | } 45 | 46 | void calibrate() override { 47 | cout << "Ultrasonik Sensör kalibre edildi." << endl; 48 | } 49 | }; 50 | 51 | int main() { 52 | // Sensör nesnelerini soyut sınıf işaretçileri ile kontrol etme 53 | Sensor* sensors[] = { 54 | new TemperatureSensor(), 55 | new PressureSensor(), 56 | new UltrasonicSensor() 57 | }; 58 | 59 | // Sensörlerin verilerini okuma ve kalibrasyon yapma 60 | for (Sensor* sensor : sensors) { 61 | sensor->readData(); 62 | sensor->calibrate(); 63 | cout << "----------------------" << endl; 64 | delete sensor; // Bellek temizliği 65 | } 66 | 67 | return 0; 68 | } 69 | -------------------------------------------------------------------------------- /Ders/21_Miras_Inheritance_2/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | // Temel sınıf: Sekil 5 | class Sekil { 6 | public: 7 | void setGenislik(int g); 8 | void setYukseklik(int y); 9 | int getGenislik() const; 10 | int getYukseklik() const; 11 | 12 | protected: 13 | int genislik = 0, yukseklik = 0; // Varsayılan başlangıç değeri 14 | }; 15 | 16 | // Sekil sınıfı fonksiyonlarının tanımları 17 | void Sekil::setGenislik(int g) { 18 | genislik = g; 19 | } 20 | void Sekil::setYukseklik(int y) { 21 | yukseklik = y; 22 | } 23 | int Sekil::getGenislik() const { 24 | return genislik; 25 | } 26 | int Sekil::getYukseklik() const { 27 | return yukseklik; 28 | } 29 | 30 | // Ek sınıf: Deger 31 | class Deger { 32 | public: 33 | void setBirimDeger(int deger); 34 | int getBirimDeger() const; 35 | int hesaplaDeger(int alan) const; 36 | 37 | private: 38 | int birimDeger = 100; // Varsayılan birim değeri 39 | }; 40 | 41 | // Deger sınıfı fonksiyonlarının tanımları 42 | void Deger::setBirimDeger(int deger) { 43 | birimDeger = deger; 44 | } 45 | int Deger::getBirimDeger() const { 46 | return birimDeger; 47 | } 48 | int Deger::hesaplaDeger(int alan) const { 49 | return alan * birimDeger; 50 | } 51 | 52 | // Türetilmiş sınıf: Dikdortgen 53 | class Dikdortgen : public Sekil, public Deger { 54 | public: 55 | int getAlan() const; 56 | }; 57 | 58 | // Dikdortgen sınıfı fonksiyonunun tanımı 59 | int Dikdortgen::getAlan() const { 60 | return genislik * yukseklik; 61 | } 62 | 63 | // Ana program (main) 64 | int main() { 65 | Dikdortgen dikdortgen; 66 | 67 | // Değerlerin atanması 68 | dikdortgen.setGenislik(5); 69 | dikdortgen.setYukseklik(15); 70 | dikdortgen.setBirimDeger(200); // Birim değeri güncelleniyor 71 | 72 | // Hesaplamalar 73 | int alan = dikdortgen.getAlan(); 74 | int fiyat = dikdortgen.hesaplaDeger(alan); 75 | 76 | // Sonuçların ekrana yazdırılması 77 | cout << "Dikdörtgenin Genişliği: " << dikdortgen.getGenislik() << endl; 78 | cout << "Dikdörtgenin Yüksekliği: " << dikdodtgen.getYukseklik() << endl; 79 | cout << "Dikdörtgenin Alanı: " << dikdortgen.getAlan() << endl; 80 | 81 | return 0; 82 | } 83 | -------------------------------------------------------------------------------- /Ders/28_Veri_Soyutlama_3/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace std; 4 | 5 | // Soyut sınıf (Abstract class) 6 | class Motor { 7 | public: 8 | virtual void start() = 0; // Saf sanal fonksiyon 9 | virtual void stop() = 0; // Saf sanal fonksiyon 10 | virtual void setSpeed(int speed) = 0; // Saf sanal fonksiyon 11 | 12 | virtual ~Motor() {} 13 | }; 14 | 15 | // Türetilmiş sınıf: DC Motor 16 | class DCMotor : public Motor { 17 | public: 18 | void start() override { 19 | cout << "DC Motor çalıştırılıyor." << endl; 20 | } 21 | 22 | void stop() override { 23 | cout << "DC Motor durduruluyor." << endl; 24 | } 25 | 26 | void setSpeed(int speed) override { 27 | cout << "DC Motor hızı " << speed << " RPM olarak ayarlanıyor." << endl; 28 | } 29 | }; 30 | 31 | // Türetilmiş sınıf: Step Motor 32 | class StepMotor : public Motor { 33 | public: 34 | void start() override { 35 | cout << "Step Motor çalıştırılıyor." << endl; 36 | } 37 | 38 | void stop() override { 39 | cout << "Step Motor durduruluyor." << endl; 40 | } 41 | 42 | void setSpeed(int speed) override { 43 | cout << "Step Motor hızı " << speed << " adım/saniye olarak ayarlanıyor." << endl; 44 | } 45 | }; 46 | 47 | // Türetilmiş sınıf: Servo Motor 48 | class ServoMotor : public Motor { 49 | public: 50 | void start() override { 51 | cout << "Servo Motor çalıştırılıyor." << endl; 52 | } 53 | 54 | void stop() override { 55 | cout << "Servo Motor durduruluyor." << endl; 56 | } 57 | 58 | void setSpeed(int speed) override { 59 | cout << "Servo Motor pozisyonu " << speed << " derece olarak ayarlanıyor." << endl; 60 | } 61 | }; 62 | 63 | int main() { 64 | // Motor nesnelerini soyut sınıf işaretçileri ile kontrol etme 65 | Motor* motor1 = new DCMotor(); 66 | Motor* motor2 = new StepMotor(); 67 | Motor* motor3 = new ServoMotor(); 68 | 69 | // Polimorfizm ile motorları çalıştırma 70 | motor1->start(); 71 | motor1->setSpeed(1500); 72 | motor1->stop(); 73 | 74 | motor2->start(); 75 | motor2->setSpeed(200); 76 | motor2->stop(); 77 | 78 | motor3->start(); 79 | motor3->setSpeed(90); 80 | motor3->stop(); 81 | 82 | // Bellek temizliği 83 | delete motor1; 84 | delete motor2; 85 | delete motor3; 86 | 87 | return 0; 88 | } 89 | -------------------------------------------------------------------------------- /Ders/21_Miras_Inheritance_2/readme.md: -------------------------------------------------------------------------------- 1 | 2 | ```plantuml 3 | @startuml 4 | class Sekil { 5 | -int genislik 6 | -int yukseklik 7 | +Sekil(int g, int y) 8 | +setGenislik(int g) 9 | +setYukseklik(int y) 10 | +getGenislik() : int 11 | +getYukseklik() : int 12 | } 13 | 14 | class Deger { 15 | -int birimDeger 16 | +setBirimDeger(int deger) 17 | +getBirimDeger() : int 18 | +hesaplaDeger(int alan) : int 19 | } 20 | 21 | class Dikdortgen { 22 | +getAlan() : int 23 | } 24 | 25 | Sekil <|-- Dikdortgen 26 | Deger <|-- Dikdortgen 27 | 28 | @enduml 29 | ``` 30 | 31 | ### Kodun Amacı ve Kurgu 32 | 33 | Bu örnekte, **Nesne Yönelimli Programlama (OOP)** prensiplerini kullanarak bir **Dikdörtgen** sınıfı ve onu yöneten yardımcı sınıflar (Sekil ve Deger) oluşturulmuştur. Bu kurgu, OOP'nin temel özelliklerini kullanarak daha modüler, genişletilebilir ve sürdürülebilir bir yapıyı hedefler. 34 | 35 | ### 1. **Sekil Sınıfı** 36 | 37 | * **Temel Özellikler**: `Sekil` sınıfı, her geometrik şeklin ortak özelliklerine sahip bir temel sınıf olarak tasarlanmıştır. Bu sınıf, dikdörtgenin **genişlik** ve **yükseklik** gibi temel özelliklerini tanımlar. 38 | * **Getter ve Setter Kullanımı**: Kullanıcı, `setGenislik` ve `setYukseklik` fonksiyonları aracılığıyla bu değerleri ayarlayabilirken, `getGenislik` ve `getYukseklik` fonksiyonları ile bu değerlere erişebilir. 39 | * **Kapsülleme (Encapsulation)**: `genislik` ve `yukseklik` değişkenleri **private** olarak tanımlanarak doğrudan dışarıdan erişim engellenmiştir. Bu verilere sadece sınıf içindeki belirli fonksiyonlar üzerinden erişilebilir, bu da **veri güvenliği** sağlar. 40 | 41 | ### 2. **Deger Sınıfı** 42 | 43 | * **Birim Değer ve Hesaplama**: `Deger` sınıfı, dikdörtgenin fiyatını hesaplamak için kullanılan bir sınıftır. Her dikdörtgenin birim değeri (`birimDeger`) vardır ve bu birim değer, alan ile çarpılarak fiyat hesaplanır. 44 | * **Modülerlik**: Fiyat hesaplama işlemi, **`getDeger()`** fonksiyonu tarafından yapılır ve bu, dışarıdan müdahale edilmeden sadece gerekli fonksiyonla yapılabilir. Bu modülerlik, **tek bir sorumluluk prensibi (Single Responsibility Principle)** ile uyumludur. 45 | * **Kapsülleme**: `birimDeger` değişkeni **private** olarak tanımlanmıştır, yani dışarıdan doğrudan erişilemez. Değer yalnızca belirli metodlar ile ayarlanabilir ve alınabilir. 46 | 47 | ### 3. **Dikdortgen Sınıfı** 48 | 49 | * **Kalıtım (Inheritance)**: `Dikdortgen` sınıfı, **`Sekil`** ve **`Deger`** sınıflarından kalıtım alır. Bu, **çoklu kalıtım** özelliğini kullanarak dikdörtgenin hem geometrik özelliklerini (genişlik ve yükseklik) hem de fiyat bilgisini aynı sınıf içinde birleştirir. 50 | * **Alan Hesaplama**: `getAlan()` fonksiyonu, **`Sekil`** sınıfından miras alınan `genislik` ve `yukseklik` değişkenlerini kullanarak dikdörtgenin alanını hesaplar. 51 | 52 | ### 4. **Ana Program** 53 | 54 | * **Dikdörtgen Nesnesi**: `Dikdortgen` sınıfından bir nesne (`D1`) oluşturulur ve `setGenislik` ile `setYukseklik` fonksiyonları aracılığıyla genişlik ve yükseklik değerleri atanır. 55 | * **Alan Hesaplama**: `getAlan()` fonksiyonu çağrılarak dikdörtgenin alanı hesaplanır. 56 | * **Fiyat Hesaplama**: `Deger` sınıfındaki `getDeger()` fonksiyonu ile alan ve birim değer kullanılarak dikdörtgenin fiyatı hesaplanır. 57 | * **Veri Ekrana Yazdırma**: Alan ve fiyat, ekrana yazdırılır. 58 | 59 | ### Genel Kurgu ve OOP Prensipleri 60 | 61 | 1. **Kalıtım (Inheritance)**: `Dikdortgen` sınıfı, `Sekil` ve `Deger` sınıflarından miras alarak, her iki sınıfın işlevlerini kullanabilmektedir. 62 | 2. **Kapsülleme (Encapsulation)**: Sınıf üyeleri (`genislik`, `yukseklik`, `birimDeger`) **private** olarak tanımlanmış, dışarıdan erişim kısıtlanmış ve yalnızca belirli fonksiyonlar ile erişim sağlanmıştır. 63 | 3. **Modülerlik**: Her sınıfın kendine özgü sorumluluğu vardır. `Sekil` sınıfı sadece geometrik verileri, `Deger` sınıfı ise fiyat hesaplamayı yapar. Bu modüler yapı, kodun daha yönetilebilir ve sürdürülebilir olmasını sağlar. 64 | 4. **Esneklik ve Genişletilebilirlik**: Bu yapı, farklı şekiller (örneğin, kare, daire) ve daha fazla özellik (örneğin, renk, tip) eklenerek kolayca genişletilebilir. 65 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------