Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "pch.h"
- #include <iostream>
- #include <math.h>;
- using namespace std;
- class my_Fun
- {
- double x, y, z, v;
- public:
- void set(double X, double Y, double Z);
- void Run(void);
- void print(void);
- };
- void my_Fun::set(double X, double Y, double Z) {
- x = X;
- y = Y;
- z = Z;
- }
- void my_Fun::Run(void) {
- 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));
- }
- void my_Fun::print(void) {
- cout << v << endl;
- }
- int main()
- {
- my_Fun fun1;
- fun1.set(0.0374, -0.825, 16);
- fun1.Run();
- fun1.print();
- my_Fun *fun2 = &fun1;
- fun2->set(0.0374, -0.825, 16);
- fun2->print();
- my_Fun *fun3 = new my_Fun;
- fun3->set(0.0374, -0.825, 16);
- fun3->Run();
- fun3->print();
- delete fun3;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement