Problema 3

Solucion:



Codificación Dev C++

#include <iostream>
#include <stdlib.h>
#include <math.h>
using namespace std;
int main( )
{
 // (1)     DECLARACION
double A,Q, W, V;
int opcion;

// (2) ASIGNACION
cout<<"CALCULO DE LA IMPEDANCIA Y DE CIRCUITOS ELECTRICOS \n\n\n";
cout<<"Ingrese Tension: \n\n";
cout<<"La amplitud(A): "; cin>>A;
cout<<"El angulo de face(Q)(rad): "; cin>>Q;
cout<<endl<<"Funcion:"<<endl;
cout<<"1.sen"<<endl;
cout<<"2.cos"<<endl;
cout<<endl<<"Elija una opcion"<<endl;
cin>>opcion;
cout<<endl;
switch(opcion)
{
// (3) PROCESO
case 1: W=Q-22/14;
V=A;
break;
case 2: W=Q;
V=A;
break;          
}
// (4) RESULTADO
cout<<"La primera funcion establecida es: V(t)=" and cout<<A and cout<<"cos(wt+" and cout<<W and cout<<")\n";
cout<<"Entonces la expresion polar o fasorial es: "; cout<<V and cout<<"v" and cout<<W and cout<<"rad";
cout<<endl;


// (5) DECLARACION(2)
double  B, X, Y, U;
int ALTERNATIVA;
// (6) ASIGNACION(2)
cout<<endl;
cout<<endl;
cout<<"Ingrese la Corriente \n\n";
cout<<"La amplitud(B): "; cin>>B;
cout<<"El angulo de desface(X)(rad): "; cin>>X;
cout<<endl<<"Funcion:"<<endl;
cout<<"1.sen"<<endl;
cout<<"2.cos"<<endl;
cout<<endl<<"Elija una opcion"<<endl;
cin>>ALTERNATIVA;
cout<<endl;
switch(ALTERNATIVA)
{
// (7) PROCESO(2)
case 1: U=X-22/14;
Y=B;
break;
case 2: U=X;
Y=B;
break;         
}
// (8) RESULTADO(2)
cout<<"La segunda funcion establecida es: I(t)=" and cout<<B and cout<<"cos(wt+" and cout<<U and cout<<")\n";
cout<<"Entonces la expresion polar o fasorial es: "; cout<<B and cout<<"v" and cout<<U and cout<<"rad";
cout<<endl;


// (9) DECLARACION(3)
double R, M;
// (10) ASIGNACION(3)
cout<<endl;
cout<<endl;
// (11) PROCESO(3)

R=A/B;
M=W-U;
cout<<"Se efectua la siguiente division para obtener la impedancia: " and cout<<A and cout<<"cos(wt+" and cout<<W and cout<<") / "  and cout<<B and cout<<"cos(wt+" and cout<<U and cout<<")";
cout<<" o " and cout<<V and cout<<"v" and cout<<W and cout<<"rad " and cout<<"/ " and cout<<B and cout<<"v" and cout<<U and cout<<"rad";
cout<<endl;

// (11) RESULTADO(3)
cout<<endl;
cout<<"La impedancia esta dada por : "; cout<<R and cout<<"v" and cout<<M and cout<<"rad";
cout<<endl;
cout<<endl;
cout<<endl;
cout<<"Gracias por la Utilidad......................De: GARCIA GARCIA GERSON";
cout<<endl;
// (12) FINAL DEL ALGORITMO
system("pause");
return 0;
}

No hay comentarios:

Publicar un comentario