Advertisement
Guest User

Untitled

a guest
Oct 18th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #include "stdafx.h"
  2.  
  3. #include "iostream"
  4.  
  5. #include "math.h"
  6.  
  7.  
  8.  
  9. class number
  10.  
  11. {
  12.  
  13. public:
  14.  
  15. number();
  16.  
  17. ~number();
  18.  
  19. double func()
  20.  
  21. {
  22.  
  23. return
  24.  
  25. 5*atan(x1)+(acos(x1)*((x1+3*fabs(x1-y1)+pow(x1,2))/(fabs(x1-y1)*z1+pow(x1,2)))/(-4));
  26. }
  27.  
  28. void setxyz(double x, double y, double z)
  29.  
  30. {
  31.  
  32. x1 = x;
  33.  
  34. y1 = y;
  35.  
  36. z1 = z;
  37.  
  38. }
  39.  
  40. private:
  41.  
  42. double x1, y1, z1;
  43.  
  44. };
  45.  
  46.  
  47.  
  48. number::number()
  49.  
  50. {
  51.  
  52. }
  53.  
  54.  
  55.  
  56. number::~number()
  57.  
  58. {
  59.  
  60. }
  61.  
  62.  
  63.  
  64. int main()
  65.  
  66. {
  67.  
  68. number a;
  69.  
  70. using namespace std;
  71.  
  72. double x = 0.1722, y = 6.33, z = 3.25e-4;
  73.  
  74. a.setxyz(x, y, z);
  75.  
  76. cout << "Answer = " << a.func() << endl;
  77.  
  78. system("pause");
  79.  
  80. return 0;
  81.  
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement