CLASE N°7
grupo A
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
int menu;
do{
cout<<"****************** Menu ****************** \n";
cout<<"1) Tabla de Multiplicar del 1 al 12 \n";
cout<<"2) Suma 2 \n";
cout<<"3) Suma3 \n";
cout<<"4) Suma 4 \n";
cout<<"5) Suma 5 \n";
cout<<"Elije una Opcion: "; cin>>menu;
cout<<endl;
switch (menu)
{
case 1:
int i, j;
for(i=1; i<=12; i++)
{
cout<<"Tabla del "<<(i)<<endl;
for(j=1; j<=12; j++)
{
cout<<(i)<<" * "<<(j)<<" = "<<(i*j)<<endl;
}
cout<<endl;
}
break;
case 2:
int Inicial, Final, A, n, B;
double Suma;
cout<<"Ingrese el Valor Inicial: "; cin>>Inicial;
cout<<"Ingrese el Valor Final: "; cin>>Final;
A=1; Suma=0; //Inicializacion
for(n = Inicial; n <= Final; n++)
{
A = A * n;
B = (2*(n)) - 1;
Suma = Suma + (A / B);
cout<<"Para n = "<<(n)<<" La Suma es: "<<(Suma)<<endl;
}
break;
case 3:
int In, Fi, E, F, g;
double Su;
cout<<"Ingrese el Valor Inicial: "; cin>> In;
cout<<"Ingrese el Valor Final: "; cin>>Fi;
E = 1; Su = 0; //Inicializacion
for(g = In; g <= Fi; g++)
{
E = E * (2 * g);
F = 2 * g;
Su = Su + (E + F);
cout<<"Para g = "<<(g)<<" La Suma es: "<<(Su)<<endl;
}
break;
case 4:
int Ini, Fin, C, D, m;
double Sum;
cout<<"Ingrese el Valor Inicial: "; cin>>Ini;
cout<<"Ingrese el Valor Final: "; cin>>Fin;
C=1; Sum =0; //Inicializacion
for(m = Ini; m <= Fin; m++)
{
C = C*m;
D = 2*(m) - 1;
Sum = Sum + (C + D);
cout<<"Para m = "<<(m)<<" La Suma es: "<<(Sum)<<endl;
}
break;
case 5:
int I_, F_,a;
double S, PI,G, H ,RAD;
PI = 3.141592;
cout<<"Ingrese el Valor Inicial: "; cin>>I_;
cout<<"Ingrese el Valor Final: "; cin>>F_;
G = 1; S = 0; //Inicializacion
for(a = I_; a <= F_; a = a + 5)
{
RAD = (2 * PI * a) / 360;
G = G + sin (RAD + 5);
H = H + pow(cos (2*RAD), 2);
S = S + (G + H);
cout<<"Para a = "<<(a)<<" La Suma es: "<<(S)<<endl;
}
break;
default:
cout<<"Esa Opcion no es Valida ";
}
}
while(menu!=0);
return 0;
} //FIN DEL PROGRAMA