
#include<iostream>
#include<math.h>
using namespace std;
double Fx,R,Q;
double x,a,n,B,P,i;
double r,xl,xc,I,V;
double p,v,pi=3.1415,m,d;
double PARABOLA(int a);
double RAIZ (int x,int y);
double CORRIENTE(int x,int y ,int z,int q);
double POTENCIA(int A,int b,int c);
int opcion;
int main ()
{
cout<<"+++MENU+++\n";
cout<<"1.-FUNCION(PARABOLA):\n";
cout<<"2.-FUNCION(PARABOLA) c/BUCLE :\n";
cout<<"3.-RAIZ:\n";
cout<<"4.-CORRIENTE:\n";
cout<<"5.-CORRIENTE BUCLE UNO:\n";
cout<<"6.-POTENCIA:\n";
cout<<"7.-POTENCIA BUCLE:\n";
cout<<"ingrese una eleccion: ";
cin>> opcion;
switch(opcion)
{
case 1:
{
cout<<"PARABOLA\n";
Q= PARABOLA(x);
cout <<"para x: "<<x<<" el valor de f(x)= "<< r <<endl;
};break;
case 2:
{
for(x=-6;x<=6;x++)
{
R= PARABOLA(x);
cout <<"para x: "<<x<<" el valor de f(x)= "<< x <<endl;
}
};break;
case 3:
{
cout<<"RAIZ\n";
a=2;
cin>>n;
cin>>B;
do
{
R=RAIZ(a,B);
cout<<R<<endl;
a=a++;
} while(a<=n);
};break;
case 4:
{
cout<<"CORRIENTE\n";
cout<<"Ingrese el Voltaje: "; cin>>V;
cout<<"Ingrese r:"; cin>>r;
cout<<"Ingrese xl:"; cin>>xl;
cout<<"Ingrese xc:"; cin>>xc;
I=CORRIENTE(V,r,xl,xc);
cout<<I<<endl;
};break;
case 5:
{
cout<<"Ingrese xl:"; cin>>xl;
cout<<"Ingrese xc:"; cin>>xc;
for(V=10; V<=20; V=V+10)
for(r=7; r<=14; r=r++)
{
I=CORRIENTE(V,r,xl,xc);
cout<<I<<endl;
}
};break;
case 6:
{
cout<<"POTENCIA\n";
cout<<"Ingrese el angulo:";cin>>m;
cout<<"Ingrese voltaje:";cin>>v;
cout<<"Ingrese intensidad:";cin>>i;
P=POTENCIA(v,i,m);
cout<<P<<endl;
};break;
case 7:
{
cout<<"Ingrese el angulo: ";cin>>m;
for(v=4; v<=20; v=v++)
for(i=6; i<=60; i=i+6)
{
P=POTENCIA(v,i,m);
cout<<P<<endl;
}
};break;
}
}
double PARABOLA(int a)
{
Q=(2/pow(a,3))+4;
return Q ;
}
double RAIZ (int x,int y)
{
Q=pow(x,2/y);
return Q;
}
double CORRIENTE(int x,int y ,int z,int q)
{
I=x/(sqrt(pow(y,4)+(z+q,4)));
return I;
}
double POTENCIA(int A,int b,int c)
{
d=(2*pi*c/360);
P=A*b*(cos(d));
return P;
}