miércoles, 20 de junio de 2018
programacion IIME-1
#include<iostream>
#include<math.h>
using namespace std;
double N , b , X , E , G , U , l , i , s , R , P , D , F , t , Pot , Vel , x , y , z , a , Ro=0.0173 , Ang=0.85;
double Caida(int x , int y , int z , int a);
double Constante (int x , int y , int z);
double Funcion (int x );
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 Finita : \n " ;
cout<< " 5.- Potencias : \n " ;
cout<<" Opciones : " ; cin >> opcion;
switch (opcion)
{
case 1:
{
cout<< " Ingrese la longitud : " ; cin>>l;
cout<< " Ingrese la Corriente : " ; cin>>i;
cout<< " Ingrese el Conductor : " ; cin>>s;
for ( P=5; P<=20 ; P=P+2 )
{
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 (Pot = 1 ; Pot <= 10 ; Pot=Pot+3)
{
cout<< " Cuando la Presion es : " <<Pot<< " : La Constante de Gases es igual a "<<R<<endl;
for ( Vel = 5 ; Vel <= 15 ; Vel=Vel+3 )
{
R = Constante(Pot,Vel,t);
cout<< " Cuando el Volumen es : " <<Vel<< " : La Constante es "<<R<<endl;
}
}
};break ;
case 3:
{
cout<< " Ingrese X : " ; cin>>X;
R = Funcion(X);
cout<< " La funcion es : "<<R<<endl;
};break;
case 4:
{
X=-5;
while ( X<=5)
{
R= Funcion(X);
cout<< " La funcion es igual a "<<R<<endl;
X = X++;
}//FIN While
};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 <=N ; 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)
{
D = ( Ro * sqrt (3) * x * y * z * Ang ) / a ;
return D ;
}
double Constante (int x , int y , int z)
{
F = ( x * y ) / z;
return F ;
}
double Funcion (int x )
{
G = pow(x,2)+5 ;
return G ;
}
double Potencia (int x , int y)
{
U = pow(x,y) ;
return U ;
}
Suscribirse a:
Enviar comentarios (Atom)
Repeticiones finitas
#include<iostream> #include<math.h> using namespace std; int main () { int opcion; do { cout<<"MENU MEC...
No hay comentarios:
Publicar un comentario