Advertisement
Vladislav_Bezruk

Untitled

Dec 1st, 2021
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. int main() {
  2. initwindow(WIDTH, HEIGHT);
  3.  
  4. cout << "###Constructors test###" << endl << endl;
  5.  
  6. PerfectGas x;
  7.  
  8. cout << "Default constructor:" << endl << x;
  9.  
  10. PerfectGas y(8.31696, 400, 1.402, 28.96, 1, 3);
  11.  
  12. y.calcKg();
  13.  
  14. cout << "Init constructor:" << endl << y;
  15.  
  16. PerfectGas z = y;
  17.  
  18. cout << "Copy constructor:" << endl << z;
  19.  
  20. cout << "###Functions test###" << endl << endl;
  21.  
  22. cout << "Set function:" << endl;
  23. x.set();
  24.  
  25. cout << "Get function:" << endl;
  26. x.get();
  27.  
  28. x.calcKg(); x.calc();
  29.  
  30. cout << "Result function:" << endl;
  31. x.getResult();
  32.  
  33. cout << "###Operators test###" << endl << endl;
  34.  
  35. cout << "x object:" << endl;
  36. x.get();
  37.  
  38. cout << "y object:" << endl;
  39. y.get();
  40.  
  41. cout << "Operator == between obj x & y" << endl;
  42. cout << "result = " << boolalpha << (x == y) << endl << endl;
  43.  
  44. cout << "Operator != between obj x & y" << endl;
  45. cout << "result = " << boolalpha << (x != y) << endl << endl;
  46.  
  47. cout << "Operator < between obj x & y" << endl;
  48. cout << "result = " << boolalpha << (x < y) << endl << endl;
  49.  
  50. cout << "Operator <= between obj x & y" << endl;
  51. cout << "result = " << boolalpha << (x <= y) << endl << endl;
  52.  
  53. cout << "Operator > between obj x & y" << endl;
  54. cout << "result = " << boolalpha << (x > y) << endl << endl;
  55.  
  56. cout << "Operator >= between obj x & y" << endl;
  57. cout << "result = " << boolalpha << (x >= y) << endl << endl;
  58.  
  59. cout << "Operator = between obj x & y" << endl;
  60. x = y;
  61.  
  62. cout << "x object:" << endl;
  63. x.get();
  64.  
  65. cout << "y object:" << endl;
  66. y.get();
  67.  
  68. cout << "###Reading from file and calculating value###" << endl << endl;
  69.  
  70. PerfectGas a; ifstream ifs(IN_FILE); ofstream ofs(OUT_FILE);
  71.  
  72. ifs >> a;
  73.  
  74. a.calcKg(); a.calc();
  75.  
  76. cout << a;
  77.  
  78. a.getResult();
  79.  
  80. cout << "###Tabulate func###" << endl << endl;
  81.  
  82. double dp, p0, p1;
  83.  
  84. cout << "Enter dp, p0 & p1: ";
  85. cin >> dp >> p0 >> p1;
  86.  
  87. cout << endl << "Result:" << endl;
  88. ofs << "Result:" << endl;
  89.  
  90. tabulate(a, dp, p0, p1, "p0", "w", "ata", "m/s", ofs);
  91.  
  92. return 0;
  93. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement