FUNCIONES - Palomino Posso

FUNCIONES

CODIFICACION
//PALOMINO POSSO KEVIN DAVID
#include<iostream>
#include<math.h>
using namespace std;
double   B , t , Poten , Velo , x , y , z , a , Ro=0.0173 , Teta=0.85 , N , b , X , e , Z , W , l , i  , s , R , P , S ,xi,xf,r1,h;
double Caida(int x , int y , int z , int a);
double Constante (int x , int y , int z);
double Func (int x );
double func(int xi);
double Potencia (int x , int y);
int main()
{
int opcion;
do
{
cout<< "  Menu Opciones : \n " ;
cout<< "  1.- Formula de Constante de Gases : \n " ;
cout<< "  2.- Tension : \n  " ;
cout<< "  3.- Parabola : \n " ;
cout<< "  4.- Parabola con Bucle : \n  " ;
cout<< "  5.- Potencias : \n " ;
cout<<" Opciones : " ; cin >> opcion;
switch (opcion)
{
case 1:
{
cout<< " La longitud  : " ; cin>>l;
cout<< " La Corriente  : " ; cin>>i;
cout<< " El Conductor : " ; cin>>s;
for ( P=3; P<=16 ; P=P+4 )
{
  R = Caida( l , P , i , s);
cout<< " Cuado la Pototencia es " <<P<< " :  La Caida es : "<<R<<endl;
}
};break ;

case 2:
{
cout<< " Ingrese el Valor de la Temperatura : " ; cin>>t;
for (Poten = 10 ; Poten <= 20 ; Poten=Poten+4)
{
cout<< " Cuando la Presion es : " <<Poten<< " : La Constante de Gases es igual a  "<<R<<endl;
for ( Velo = 6 ; Velo <= 20 ; Velo=Velo+4 )
{
R = Constante(Poten,Velo,t);
cout<< " Cuando el Volumen es : " <<Velo<< " : La Constante es "<<R<<endl;
}
}
};break ;

case 3:
{
cout<< " Ingrese X : " ; cin>>X;

R = Func(X);
cout<< " La funcion es : "<<R<<endl;
};break;

case 4:
{
cout<<"ingrese rango\n";
cout<<"desde:";cin>>xi;
cout<<"hasta:";cin>>xf;
for(xi;xi<=xf;xi++)
{
r1=func(xi);
cout<<"cuando X toma el valor de "<<xi<<" la funcion = "<<r1<<endl;
}//FIN for
};break;
case 5:
{
cout<< " Ingrese el Valor del Termino N : " ; cin>>N;
cout<< " Ingrese el Valor de la Potencia: " ; cin>>e;
for ( b =1 ; b <=20 ; b++)
{
R = Potencia(b,e);
cout<< " La base es " <<b<< " El exponente es  "<<e<< " : La Potencia es igual  "<<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)
{
S = ( Ro * sqrt (3) * x * y * z * Teta ) / a ;
return S ;
}
double Constante (int x , int y , int z)
{
B = ( x * y ) / z;
return B ;
}
double Func (int x )
{
Z = pow(x,2)+5 ;
return Z ;
}
double func(int xi)
{
h=pow(xi,2)+5;
return h;
}
double Potencia (int x , int y)
{
W = pow(x,y) ;
return W ;
}

No hay comentarios.:

Publicar un comentario