Вы находитесь на странице: 1из 3

#include <iostream>

#include <cstdlib>
#include <math.h>
using namespace std;
int menu();
void operacion1(int a,int b,int c,int d);
float operacion2(int a,int b,int c,int d);
void operacion3(int a,int b,int c,int d);
void estudiante();

main()
{
int opc=0;
int a,b,c,d;
estudiante();
cout<<"Ingrese Valorres:"<<endl;
cout<<"Valor A=>";
cin>>a;
cout<<"Valor B=>";
cin>>b;
cout<<"Valor C=>";
cin>>c;
cout<<"Valor D=>";
cin>>d;
do{
opc=menu();
switch(opc)
{
case 1:{

cout<< "\tOPERACION 1.\n"<<endl;


operacion1(a,b,c,d);
system("pause");
break;
}
case 2:{
cout << "\tOPERACION 2.\n"<<endl;
cout<<"el resultado de la operacion 2
es"<<operacion2(a,b,c,d)<<endl;
system("pause");
break;
}
case 3:{
cout << "\tOPERACION 3\n";
operacion3(a,b,c,d);
system("pause");
break;
}
case 4:{
cout << "SALIR\n";
system("pause");
break;
}
default:{
cout << "No es opcion.\nVolviendo al menu.......";
system("pause");
break;
break;
}
}
}while(opc!=4);
cin.get();
}
//las funciones a utilizar
void operacion1(int a,int b,int c,int d)
{
float res;int sum=a+d;

res=(a*sqrt(sum))/(c/d);
cout <<"resultado de la operacion 1 es "<<res<<"\n"<<endl;
}
float operacion2(int a,int b,int c,int d)
{
float res;
res=(d*d+(d*a))/(d/(b+c));
return res;
}
void operacion3(int a,int b,int c,int d)
{
float res;
res=(sqrt(c+b*b))/(b*c*a*d);
cout <<"resultado de la operacion 3 es "<<res<<"\n"<<endl;
}
void estudiante()
{
cout <<"Nombre: Ruiton Tanta, Edilberto"<<endl;
}
int menu()
{
system("slp");

cout <<"\tMenu de opciones" << endl;


cout << "\t-----------" << endl ;
cout << "\t[1] Operacion 1" << endl;
cout << "\t[2] Operacion 2" << endl;
cout << "\t[3] Operacion 3" << endl;
cout << "\t[4] Salir" << endl << endl;
cout << "Elije una opcion=> ";
int opc;
cin >>opc;
return opc;
system("pause");
}

Вам также может понравиться