top of page

LABORATORIO 2

  • Foto del escritor: wilber huamani loa
    wilber huamani loa
  • 19 jun 2018
  • 1 Min. de lectura

FIME

#include <iostream>

#include <math.h>

using namespace std;

int z,a,base,exponente,v;

double r,p,theta,pi=3.141592;

double HIPERBOLA(int a);

double RAIZ(int x,int y);

double CAPACITANCIA(int x,int y);

double INDUCTANCIA(int x, int y);

int main ()

{

int opcion;

do

{

cout<<"MENU DE OPCIONES\n";

cout<<"1.- HIPERBOLA\n";

cout<<"2.- RADICAL\n";

cout<<"3.- CAPACITANCIA\n";

cout<<"4.- INDUCTANCIA\n";

cout<<"INGRESE UNA OPCION: "; cin>>opcion;

switch (opcion)

{

case 1:

{

cout<<"ingrese una variable: "; cin>>z;

r=hiperbola(z);

cout<<"la hiperbole es: "<<r<<endl;

};break;

case 2:

{

cout<<"ingrese un valor para la base: "; cin>>base;

cout<<"ingrese un valor para el exponente: "; cin>>exponente;

r=raiz(base,exponente);

cout<<"la raiz de dos variables definidas es: "<<r<<endl;

};break;

case 3:

{

cout<<"ingrese un voltaje: "; cin>>v;

cout<<"ingrese un angulo: "; cin>>theta;

r=capacitancia(v,theta);

cout<<"la potencia capacitiva es: "<<r<<endl;

};break;

case 4:

{

cout<<"ingrese un voltaje: "; cin>>v;

cout<<"ingrese un angulo: "; cin>>theta;

r=inductancia(v,theta);

cout<<"la potencia inductiva es: "<<r<<endl;

};break;

}//fin switch

}while (opcion=!0);

}//fin programa

double HIPERBOLA(int a)

{

r=(1/pow(a,2))+4;

return r;

}

double RAIZ(int x,int y)

{

r=pow(x,(1/y));

return r;

}

double CAPACITANCIA(int x,int y)

{

p=2*pi+y/360;

r=x*sin(p);

return r;

}

double INDUCTANCIA(int x, int y)

{

p=2*pi+y/360;

r=x*cos(p);

return r;

}


 
 
 

Comments


2018 "Año del Diálogo y la Reconciliación Nacional"

bottom of page