LAB2

LABORATORIO 2

12/07/2018

Paucar Champe Charles.

FUNCIONES





 #include<iostream>
#include<math.h>
using namespace std;
double  N , b , X, E , H , K ,L , I;
double S, R , P , Q , W , t , Po , Ve;
double x , y , z , a , Ro=0.0173 , Angulo=0.85;
double Caida(int x , int y , int z , int a);
double Constante (int x , int y , int z);
double Fun (int x );
double Potencia (int x , int y);
int main()
{
int opcion;
do
{
cout<< "  Menu Opciones : \n " ;
cout<< "   1.- Formula de Gases : \n " ;
cout<< "   2.- Caida de Tension : \n  " ;
cout<< "  3.- Funciones : \n " ;
cout<< "   4.- Funciones Finitas : \n  " ;
cout<< "  5.- Potencias : \n " ;
cout<<" Opciones : " ; cin >> opcion;
switch (opcion)
{
case 1:
{
cout<< "  Valor de la longitud  : " ; cin>>L;
cout<< "   Valor de Corriente  : " ; cin>>I;
cout<< "   Valor de  Area del Conductor : " ; cin>>S;
for ( P=1; P<=10 ; P=P+1 )
{
  R = Caida( L , P , I , S);
  cout<< " Cuado la Pototencia es " <<P<< " :  La Caida de Potencia  : "<<R<<endl;
}
};break ;

case 2:

{
cout<< "  Temperatura : " ; cin>>t;
for (Po = 1 ; Po <= 10 ; Po=Po+3)
{
cout<< " Presion  : " <<Po<< " : Constante de Gases   "<<R<<endl;
for ( Ve = 5 ; Ve <= 15 ; Ve=Ve+3 )
{
R=Constante(Po,Ve,t);
    cout<< " Volumen  : " <<Ve<< " : Constante de Gases  "<<R<<endl;
}
}
};break ;

case 3:

{
 cout<< " Funcion a desarrollar : ( X * X ) + 5 "<<endl;
 cout<< " Ingrese el Valor de X : " ; cin>>X;

 R = Fun(X);
  cout<< " La funcion es igual a "<<R<<endl;
};break;

case 4:

{
X=-10;
while ( X<=10)
{
 R= Fun(X);
 cout<< " La funcion es igual a "<<R<<endl;
 X = X++;
}//FIN While
};break;
case 5:
{
 cout<< "  Termino N : " ; cin>>N;
 cout<< "  Potencia: " ; cin>>E;
 for ( b =1 ; b <=N ; b++)
{
  R = Potencia(b,E);
  cout<< " Cuando la base es " <<b<< " y el exponente es  "<<E<< " : La Potencia es =  "<<R<<endl;

}
};break; 
}//fin switch
}while (opcion=!0);
 //system ("pouse") ;
 return 0;
}
//Zona de Funciones
double Caida (int x , int y , int z , int a)
{
 Q = ( Ro * sqrt (3) * x * y * z * Angulo ) / a ;
  return Q ;
}
double Constante (int x , int y , int z)
{
 W = ( x * y ) / z;
 return W ;
}
double Fun (int x )
{
 H = pow(x,2)+5 ;
  return H ;
}
double Potencia (int x , int y)
{
 K = pow(x,y) ;
 return ;

  // fin del switch;
  
}

No hay comentarios:

Publicar un comentario