Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<conio.h>
- #include<stdlib.h>
- #include<iomanip>
- using namespace std;
- class operacion
- {
- private: float w,x,y,z,res;
- public:
- void multi();
- void mostrar();
- operacion(float num1=0.0, float num2=0.0, float num3=8.2, float num4=6.2);
- ~operacion(){};
- }op1;
- operacion::operacion(float num1, float num2, float num3, float num4)
- {
- w=num1; x=num2; y=num3; z=num4;
- }
- void operacion::multi()
- {
- cout<<"\n\nIntroduce valores con decimales";
- cout<<"\n\nIngresa el valor de w: ";
- cin>>w;
- cout<<"\nIngresa el valor de x: ";
- cin>>x;
- res=(w*x*y*z);
- cout<<"\n\n----------------------------------------------";
- cout<<"\nEl resultado de la multiplicacion es: "<<res;
- cout<<"\n----------------------------------------------";
- }
- void operacion::mostrar()
- {
- cout<<"\n\n Valores Inicializados";
- cout<<"\n\n w="<<w;
- cout<<"\n x="<<x;
- cout<<"\n y="<<y;
- cout<<"\n z="<<z;
- }
- main()
- {
- system("color 1f");
- op1.mostrar();
- op1.multi();
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement