Summary Files Commits Branches @commit @diff @stats
path: root / Year 1 / Object-oriented Programming / 05-Practice-29.03.2022 / ex2-Rational.cpp
diff options
context:
space:
mode:
Commit793100813b3c50a1f304904440366a7137ae0992 (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-03-30 08:41:52 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-03-30 08:41:52 +0300
Files439f4bdbc12de1fe990bd9f061c6dca213e8e1b6 /Year 1/Object-oriented Programming/05-Practice-29.03.2022/ex2-Rational.cpp
uni-projects-793100813b3c50a1f304904440366a7137ae0992.tar
uni-projects-793100813b3c50a1f304904440366a7137ae0992.tar.gz
uni-projects-793100813b3c50a1f304904440366a7137ae0992.zip
Parentc105f7db9b10861dd0bdeedb3ed4d1ebe2054b87 (diff)
Reworked yesterdays oop practice folder structure
1 files changed, 0 insertions, 47 deletions
-rw-r--r--Year 1/Object-oriented Programming/05-Practice-29.03.2022/ex2-Rational.cpp47
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 {
-
-}