Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #include "pch.h"
  2. #include <iostream>
  3. #include <math.h>;
  4. using namespace std;
  5.  
  6.  
  7. class my_Fun
  8. {
  9. double x, y, z, v;
  10. public:
  11. void set(double X, double Y, double Z);
  12. void Run(void);
  13. void print(void);
  14. };
  15. void my_Fun::set(double X, double Y, double Z) {
  16. x = X;
  17. y = Y;
  18. z = Z;
  19. }
  20.  
  21. void my_Fun::Run(void) {
  22. v = (pow(x, abs(y))*(1 + sin(x + y)*sin(x + y))) / (abs(x - ((2 * y) / (1 + x * x*y*y)))) + cos(atan(1 / z))*cos(atan(1 / z));
  23. }
  24. void my_Fun::print(void) {
  25. cout << v << endl;
  26. }
  27. int main()
  28. {
  29. my_Fun fun1;
  30. fun1.set(0.0374, -0.825, 16);
  31. fun1.Run();
  32. fun1.print();
  33.  
  34. my_Fun *fun2 = &fun1;
  35. fun2->set(0.0374, -0.825, 16);
  36. fun2->print();
  37.  
  38. my_Fun *fun3 = new my_Fun;
  39. fun3->set(0.0374, -0.825, 16);
  40. fun3->Run();
  41. fun3->print();
  42. delete fun3;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement