top of page

#include <iostream>
#include <math.h>
using namespace std;
 int main ()
{
    int opcion;
    cout<<"capacitancia\n";
    cout<<"impedancia \n";
    cout<<"inductiva\n";
    cout<<"capacitancia\n";
cout<<"ingrese una opcion";
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+5;
        cout<<I<<endl;
    }
    while(r<=150);
    }
    break;
case 2:{                                       
        double vp,w,c,I,t,pi=3.14;
    cin>>vp;
    cin>>w;
    cin>>t;
    c=90;
    do{
        I=(vp*w*c)*cos(w*t+pi/2);
        c=c+10;
        cout<<I<<endl;
    }
    while(c<=60);
    }
    break;
case 3:{                                        
    double r,z,A,i,w,l,c;
    cin>>r;
    cin>>i;
    cin>>w;
    cin>>c;
    l=18;
    do{
        A=((w*l)-1/w*c);
        cout<<"z="<<r<<"+i" << A <<endl;
        l=l+3;
    }
    while(l<=40);
}
    break;
    case 4:{                          
        double i,l,t,v1,v2,w,pi=3.14;
        cin>>l;
        cin>>t;
        cin>>v1;
        cin>>v2;
        w=7;
        do {
            i=((v2-v1)/w*l)*sin(w*t-pi/2);
            w=w++;
            cout<<i<<endl;
        }
        while(w<=30);
    }
        break;
}
}

bottom of page