-
Notifications
You must be signed in to change notification settings - Fork 80
Expand file tree
/
Copy pathDemo.cpp
More file actions
37 lines (29 loc) · 821 Bytes
/
Demo.cpp
File metadata and controls
37 lines (29 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/**
* Demo file for the exercise on binary tree
*
* @author Evgeny Hershkovitch Neiterman
* @since 2023-03
*/
#include <iostream>
#include <fstream>
#include <sstream>
#include <stdexcept>
using namespace std;
#include "sources/Fraction.hpp"
using namespace ariel;
int main() {
Fraction a(5,3), b(14,21);
cout << "a: " << a << "b: " << b << endl;
cout << "a+b" << a+b << endl;
cout << "a-b" << a-b << endl;
cout << "a/b" << a/b << endl;
cout << "a*b" << a*b << endl;
cout << "2.3*b" << 2.3*b << endl;
cout << "a+2.421" << a+2.421 << endl;
Fraction c = a+b-1;
cout << c++ << endl;
cout << --c << endl;
cout << "c >=b ? : " << (c >= b) << endl;
if (a > 1.1) cout << " a is bigger than 1.1" << endl;
else cout << " a is smaller than 1.1" << endl;
}