diff options
Reworked yesterdays oop practice folder structure
6 files changed, 0 insertions, 123 deletions
diff --git a/Year 1/Object-oriented Programming/05-Practice-29.03.2022/ex1-Entity.cpp b/Year 1/Object-oriented Programming/05-Practice-29.03.2022/ex1-Entity.cpp deleted file mode 100644 index 0252a13..0000000 --- a/Year 1/Object-oriented Programming/05-Practice-29.03.2022/ex1-Entity.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "ex1-Entity.h" -#include <iostream> - -Entity::Entity() { - x = 0; - std::cout << "Entity created!"; -} -Entity::Entity(int xVal) { - x = xVal; -} - -Entity::~Entity() { - std::cout << "Entity destroyed"; -} diff --git a/Year 1/Object-oriented Programming/05-Practice-29.03.2022/ex1-Entity.h b/Year 1/Object-oriented Programming/05-Practice-29.03.2022/ex1-Entity.h deleted file mode 100644 index 89c8d3f..0000000 --- a/Year 1/Object-oriented Programming/05-Practice-29.03.2022/ex1-Entity.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef ENTITY_HEADER -#define ENTITY_HEADER - -class Entity { -private: - int x; -public: - Entity(); - Entity(int xVal); - ~Entity(); -}; - -#endif // !ENTITY_HEADER diff --git a/Year 1/Object-oriented Programming/05-Practice-29.03.2022/ex1-Source.cpp b/Year 1/Object-oriented Programming/05-Practice-29.03.2022/ex1-Source.cpp deleted file mode 100644 index fbf5934..0000000 --- a/Year 1/Object-oriented Programming/05-Practice-29.03.2022/ex1-Source.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "ex1-Entity.h" - -int main() { - Entity f; - Entity s(10); - Entity* t = new Entity; - Entity x(); -} diff --git a/Year 1/Object-oriented Programming/05-Practice-29.03.2022/ex2-Rational.cpp b/Year 1/Object-oriented Programming/05-Practice-29.03.2022/ex2-Rational.cpp deleted file mode 100644 index 05794b5..0000000 --- a/Year 1/Object-oriented Programming/05-Practice-29.03.2022/ex2-Rational.cpp +++ /dev/null @@ -1,47 +0,0 @@ -#include "ex2-Rational.h" - -Rational::Rational(int numerator, int denumerator) { - set_numerator(numerator); - set_denumerator(denumerator); -} - -int Rational::get_numerator() const { - return numerator; -} -void Rational::set_numerator(int numerator) { - this->numerator = numerator; -} - -int Rational::get_denumerator() const { - return denumerator; -} -void Rational::set_denumerator(int denumerator) { - this->denumerator = denumerator; -} - -void canonize() { - -} - -Rational Rational::operator+(const Rational& other) { - return Rational(numerator * other.denumerator + other.numerator * denumerator, denumerator * other.denumerator); -} - -//x a = x*b + y*a -//y b y*b - -Rational Rational::operator-(const Rational& other) { - return Rational(numerator * other.denumerator - other.numerator * denumerator, denumerator * other.denumerator); -} - -Rational Rational::operator*(const Rational& other) { - return Rational(numerator * other.numerator, denumerator * other.denumerator); -} - -Rational Rational::operator/(const Rational& other) { - return Rational(numerator / other.numerator, denumerator / other.denumerator); -} - -int Rational::numcmp(const Rational& arg) const { - -} diff --git a/Year 1/Object-oriented Programming/05-Practice-29.03.2022/ex2-Rational.h b/Year 1/Object-oriented Programming/05-Practice-29.03.2022/ex2-Rational.h deleted file mode 100644 index f95e520..0000000 --- a/Year 1/Object-oriented Programming/05-Practice-29.03.2022/ex2-Rational.h +++ /dev/null @@ -1,24 +0,0 @@ -class Rational { - int numerator; - int denumerator; - -public: - Rational(int numerator, int denumerator); - - int get_numerator() const; - void set_numerator(int numerator); - - int get_denumerator() const; - void set_denumerator(int denumerator); - - void canonize(); - - Rational operator+(const Rational& other); - Rational operator-(const Rational& other); - Rational operator*(const Rational& other); - Rational operator/(const Rational& other); - - int numcmp(const Rational& arg) const; - - void print() const; -}; diff --git a/Year 1/Object-oriented Programming/05-Practice-29.03.2022/ex2-Source.cpp b/Year 1/Object-oriented Programming/05-Practice-29.03.2022/ex2-Source.cpp deleted file mode 100644 index 906ce83..0000000 --- a/Year 1/Object-oriented Programming/05-Practice-29.03.2022/ex2-Source.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include "ex2-Rational.h" - -int main() { - -} -/* - -5 - 1 = 4 -5 / 1 = 5 - -5 - 9 = -4 -5 / 9 = 0... - -5 - 5 = 0 -5 / 5 = 1 - -*/ |
