top of page

# include <iostream>
#include <math.h>

using namespace std;

int x, opcion, N, y, r, Xl, Xc, V, PI=3.1415;

double Fx, R, I;

double PARABOLA (int a)

double RAIZ (int x, int y) 

double CORRIENTE (int a , int b, int c, int d);

double POTENCIA (int m, int n, int p);
int main()
{

cout<< "Menu de Opciones\n";
cout<<"Funcion 1\n";
cout<<"Funcion 2\n";
cout<<"Potencia 1\n";
cout<<"Potencia2\n";

cout<<"Ejercicio 5\n";

cout<<"Ingresar una opcion";
cin>> opcion;
switch (opcion) 
 {

  case 1:

   {
    cin>>x;
    R=Parabola (x);
    cout<<R<< endl;
   }; break;

  case 2:

   {
    for (x= -5, x<= 5; x++)
      {
       R= Parabola(x);
       cout <<R<<endl;

      }

   }; break
   
case 3:
      { 
      cout <<"Ingrese el enesimo numero"
      cin>> N;
      a=1;
      cin>>b;
      do 
        { 
          R=RAIZ(a,b);
          cout <<R<< endl;
          a++;
        }
      while (a<= N)

    }; break;
   
case 4:

    {

      cin>>V; cin>>R;

      for (Xl=-4; Xl<=4; Xl++)

      for (Xc=-3; Xc<=3; Xl++) 
       {
         I=CORRIENTE(Xl, Xc, V, R);
         cout<<I<<endl;
       }
    };break;
 
 case 5:

   
     cin>> V;
     cin>> I;
     cin>> A;
     P=POTENCIA(V, I, A);

     cout<<P<<endl;
    } 
  }
//fin switch
} //fin programa

// ZONA DE FUNCIONES
- double PARABOLA (int a)

 {

   Q=pow(a, 2)+3;

   return Q;

 }

- double RAIZ (int x, int y)

 {

  Q=pow(x, y)

  return Q;

 }
- double CORRIENTE (int a, int b, int c, int d)

 {

   S=d/(sqrt(pow(c , 2) + pow (a+b, 2))

   return S;

 }

- double POTENCIA (int m, int n, int p)

 {

   R1=(2*PI*p)/360;

   S=m*n*cos(R1)

   return S;

 }

bottom of page