Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main() {
- initwindow(WIDTH, HEIGHT);
- cout << "###Constructors test###" << endl << endl;
- PerfectGas x;
- cout << "Default constructor:" << endl << x;
- PerfectGas y(8.31696, 400, 1.402, 28.96, 1, 3);
- y.calcKg();
- cout << "Init constructor:" << endl << y;
- PerfectGas z = y;
- cout << "Copy constructor:" << endl << z;
- cout << "###Functions test###" << endl << endl;
- cout << "Set function:" << endl;
- x.set();
- cout << "Get function:" << endl;
- x.get();
- x.calcKg(); x.calc();
- cout << "Result function:" << endl;
- x.getResult();
- cout << "###Operators test###" << endl << endl;
- cout << "x object:" << endl;
- x.get();
- cout << "y object:" << endl;
- y.get();
- cout << "Operator == between obj x & y" << endl;
- cout << "result = " << boolalpha << (x == y) << endl << endl;
- cout << "Operator != between obj x & y" << endl;
- cout << "result = " << boolalpha << (x != y) << endl << endl;
- cout << "Operator < between obj x & y" << endl;
- cout << "result = " << boolalpha << (x < y) << endl << endl;
- cout << "Operator <= between obj x & y" << endl;
- cout << "result = " << boolalpha << (x <= y) << endl << endl;
- cout << "Operator > between obj x & y" << endl;
- cout << "result = " << boolalpha << (x > y) << endl << endl;
- cout << "Operator >= between obj x & y" << endl;
- cout << "result = " << boolalpha << (x >= y) << endl << endl;
- cout << "Operator = between obj x & y" << endl;
- x = y;
- cout << "x object:" << endl;
- x.get();
- cout << "y object:" << endl;
- y.get();
- cout << "###Reading from file and calculating value###" << endl << endl;
- PerfectGas a; ifstream ifs(IN_FILE); ofstream ofs(OUT_FILE);
- ifs >> a;
- a.calcKg(); a.calc();
- cout << a;
- a.getResult();
- cout << "###Tabulate func###" << endl << endl;
- double dp, p0, p1;
- cout << "Enter dp, p0 & p1: ";
- cin >> dp >> p0 >> p1;
- cout << endl << "Result:" << endl;
- ofs << "Result:" << endl;
- tabulate(a, dp, p0, p1, "p0", "w", "ata", "m/s", ofs);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement