
ESTRUCTURA REPETITIVA FINITA
# include <iostream>
using namespace std;
int Opcion, n, i, j, c, SUMA, Li=35; // DECLARACIÓN PÚBLICA
float corriente=15, rho=0.0175, Si, caida;
int main()
{
do
{
cout << "menu"<< endl;
cout << "1. OPCION 1"<< endl;
cout << "2. OPCION 2"<< endl;
cout << "3. CAIDA TENSION "<< 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;
}// fin del switch
cout<<endl;
} while(Opcion !=0);
cout << " CAMBIO DE LINEA";
return 0;
}
Contacto
Siempre estoy en búsqueda de nuevas oportunidades. Vamos a conectarnos.
914-123-456