LAB 3

Laboratorio 3

#include<iostream>
#include<math.h>
using namespace std ;
int opcion,ab,bc,cd,df,fg,gh,hi,ij,lm,kl,x,y,a,b,e,f,j,vi,h,w;
double jk,v,PI=3.14,A,G,B,H,C,I,N,D,J,K,E,F,L,RAD;
double PARABOLA(int ab);
double FUNCION(int bc);
double POTENCIA(int cd,int df);
double EXPONENTE(int fg,int gh);
double VELOCIDAD(int hi,int ij,int lm);
double ENERGIA(double jk,int kl);
int main()
{
      cout<<"MENU\n" ;
      cout<<"1.Parabola\n" ;
      cout<<"2.Funcion\n" ;
      cout<<"3.Potencia\n" ;
      cout<<"4.Exponente\n" ;
      cout<<"5.Velocidad\n" ;
      cout<<"6.Energia\n" ;
      cout<<"Ingrese la opcion:" ;cin>>opcion ;
      switch(opcion)
       {
             case 1:
               {
                    for(x=-5;x<=5;x=x+1)
                    A=PARABOLA(x);
                    cout<<x<<endl;
               };break;
             case 2:
                {
                    for(y=-2;y<=16;y=y+2)
                    {
                       B=FUNCION(y);
                       cout<<B<<endl;
                    }
                };break;
             case 3:
                {
                    cout<<"Ingrese: ";cin>>a;
                    cout<<"Ingrese: ";cin>>b;
                    C=POTENCIA(a,b);
                    cout<<C<<endl;
                };break;
             case 4:
                {
                    cout<<"Ingrese el enesimo numero: ";cin>>N;
                    cout<<"Ingrese : ";cin>>e;
                    f=1;
                    while(f<=N)
                    {
                      D=EXPONENTE(f,e);
                      cout<<D<<endl;
                      f++;
                    }
                };break;
             case 5:
               {
                 cout<<"ingrese : ";cin>>h;
                 cout<<"ingrese : ";cin>>j;
                 for(vi=3;vi<=10;vi=vi+2)
                    {
                       E=VELOCIDAD(vi,h,j);
                       cout<<E<<endl;
                    }
                };break;
             case 6:
               {
                 for(v=2.40;v<=15.30;v++)
                    {
                    cout<<"para el voltaje v: "<<v<<endl;
                    cout<<endl;
                     for(w=5;w<=30;w=w+5)
                     {
                       F=ENERGIA(v,w);
                       cout<<" la energia es F: "<<F<<endl;
                     }
                    }
               };break;
       }
      system ("pause") ;
      return 0;
}
double PARABOLA(int ab)
{
      G=pow(ab,2)+5;
      return G;
}

double FUNCION(int bc)
{
      H=pow(bc,2)-8;
      return H;
}

double POTENCIA(int cd,int df)
{
      I=pow(cd,df);
      return I;
}

double EXPONENTE(int fg,int gh)
{
      J=pow(fg,gh);
      return J;
}

double VELOCIDAD(int hi,int ij,int lm)
{
      K=hi+ij*lm;
      return K;
}

double ENERGIA(double jk,int kl)
{
      RAD=(2*PI*kl)/360;
      L=jk*sin(RAD);
      return L;
}   

No hay comentarios:

Publicar un comentario