top of page
Ley de los gases ideales
# include <iostream>
using namespace std;
int Opcion, n, i, j, c, SUMA, Longitud=20, Mol=1 ; // DECLARACIÓN PÚBLICA
float rho=0.0175, Ci, Si, caida, R=0.082, Vi, Ti, Presion;
int main()
{
do
{
cout << "\n MENU"<< endl;
cout << " ----------------------------"<< endl;
cout << " [1] SUMA DE N NUMEROS"<< endl;
cout << " [2] TABLA DE MULTIPLICAR"<< endl;
cout << " [3] CAIDA TENSION "<< endl;
cout << " [4] LEY DE LOS GASES IDEALES "<< endl;
cout << "\n INGRESE UNA OPCION <> 0 : ";
cin>>Opcion;
switch (Opcion)
{
case 1:
{
cout << "\n SUMA DE N NUMEROS \n";
cout << " ----------------------------"<< endl;
cout <<" Ingrese el e-nesimo termino a sumar: "; cin>>n;
SUMA=0; // INICIALIZANDO
for (c=1; c<=n; c++ )
{
SUMA = SUMA + c;
} // FIN DEL FOR
cout <<" La suma de los "<<n<< " Terminos es: "<< SUMA<<endl;
} break; // FIN DEL CASO 1
case 2:
{
cout << " \n TABLA DE MULTIPLICAR \n";
cout << " ---------------------- \n";
for (i=1; i<=12; i++)
{
cout<<"\n LA TABLA DEL "<< i <<endl;
cout << " ---------------------- \n";
for (j=1; j<=12; j++)
{
cout<<" "<<j<<" * " << i << " = "<<i*j<<endl;
}
}
cout<<endl;
} break;
case 3:
{
cout << " \n CAIDA DE TENSION \n";
cout << "---------------------- \n";
for (Ci=10; Ci<=30; Ci = Ci + 2)
{
cout<<"\n Para una corriente de: "<< Ci <<endl;
cout << " ------------------------------ \n";
for (Si=2.5; Si<=10; Si = Si + 0.5)
{
caida = (rho * Ci * Longitud* 0.85)/Si;
cout<<" La caida de tension para una corriente "<<Ci<<" y de seccion " << Si << " es: "<<caida<<endl;
}
}
} break;
case 4:
{
cout << " \n LEY DE LOS GASES \n";
cout << "---------------------- \n";
for (Vi=10; Vi<=80; Vi = Vi + 10)
{
cout<<"\n Para un volumen de: "<< Vi <<" L" <<endl;
cout << " ------------------------------ \n";
for (Ti=323; Ti<=523; Ti = Ti + 20)
{
Presion = (Mol * R * Ti)/Vi;
cout<<" La presion para un volumen "<<Vi<<" L y a una temperatura " << Ti << " K es: "<<Presion<<endl;
}
}
} break;
}// fin del switch
} while(Opcion !=0);
return 0;
}



bottom of page