top of page
Océano

SEMANA 9
SENTENCIA FOR

29 / 01 / 2024

  • Facebook
  • Twitter
  • LinkedIn
  • Instagram

10. MENDOZA ANTIZANA JOSE FERNANDO

# include <iostream>
using namespace std;
int Opcion, n, i, j, c, SUMA, Li=35, mol = 1; // DECLARACIÓN PÚBLICA
float corriente=15, rho = 0.0175, Si, caida, ra = 0.082, vi, ti, pre;

int main()
{
do
{
cout << "menu"<< endl;
cout << "1. OPCION 1"<< endl;
cout << "2. OPCION 2"<< endl;
cout << "3. CAIDA TENSION"<< endl;
cout << "4. GASES IDEALES" << endl;
 
cout << "INGRESE UNA OPCION <> 0  ";
cin>>Opcion;
switch (Opcion)
{
case 1:
    {
    cout << " SUMA DE N NUMEROS \n";
    cout<<"Ingrese el e-nesimo término 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";
         
      cout<<"\n Para una longitud de:  "<< Li <<endl;
      cout << "------------------------------ \n";
     for (Si=10; Si<=30; Si = Si + 2)
       {
           caida = (rho * corriente * Li* 0.85)/Si;
           cout<<"La caida de tensión para una long. "<<Li<<" y seccion de: " << 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)
      {
          pre = (mol * ra * ti)/vi;
          cout<<"  La presion para un volumen "<<vi<<" L y a una temperatura " << ti << " K es: "<<pre<<endl;
      }
    }   
   } break;    
}// fin del switch

 
cout<<endl;
} while(Opcion !=0);
return 0;

}

image.png
image.png
image.png
image.png
bottom of page