top of page

#include <iostream>

#include <math.h>

using namespace std;

 int main ()

{

    int opcion;

    cout<<"hallar la capacidad\n";

    cout<<"hallar resistencia\n";

    cout<<"hallar conrriente racional\n";

    cout<<"hallar capacidad\n";

cout<<"ingrese una eleccion";

cin>>opcion;

switch ( opcion )

{

case 1:

  {                                             

    double v1,v2,I,r,xl,xc;

        cin>>v1;

        cin>>v2;

        cin>>xl;

        cin>>xc;

        r=60;

    do{

        I=v2-v1/sqrt(pow(r,2)+pow(xl+xc,2));

        r=r+20;

        cout<<I<<endl;

    }

    while(r<=200);

    }

    break;

case 2:

   {                   

    double vp,w,c,I,t,pi=3.14;

    cout<<"Voltaje: ";    cin>>vp;

    cout<<"ingrese w: ";cin>>w;

    cout<<"tiempo: ";    cin>>t;

    c=30;

    do{

        I=(vp*w*c)*cos(w*t+pi/2);

        c=c+6;

        cout<<I<<endl;

    }

    while(c<=60);

    }

    break;

case 3:

   {                                      

    double r,z,A,i,w,l,c;

    cout<<"resistencia: ";cin>>r;

    cout<<"ingrese i: "; cin>>i;

    cout<<"ingrese w: "; cin>>w;

    cout<<"capacidad: "; cin>>c;

    l=20;

    do{

        A=((w*l)-1/w*c);

        cout<<"z="<<r<<" + i" << A <<endl;

        l=l+7;

    }

    while(l<=90);

}

    break;

    case 4:

      {                         

        double i,l,t,v1,v2,w,pi=3.1415;

        cout<<"ingrese l ";    cin>>l;

        cout<<"tiempo ";cin>>t;

        cout<<"voltaje 1 ";cin>>v1;

        cout<<"voltaje 2 ";cin>>v2;

        w=5;

        do {

            i=((v2-v1)/w*l)*sin(w*t-pi/2);

            w=w+20;

            cout<<i<<endl;

        }

        while(w<=100);

    }

        break;

}

}

bottom of page