top of page

LENGUAJE DE PROGRAMACIÓN
alumno: tenorio diaz ney eduardo

PRACTICA EN CLASE
# include <iostream>
# include <math.h>
using namespace std;
int Opcion, i, j, Vo, n, c, SUMA;
double R, L, C, w, Io, A, B, D, E, F, G, H;
float RAD1, RAD2, Phi, wo, t, xt, pi=3.141592;
void TABLA();
void LINEAS();
void CORRIENTE();
void IMPEDANCIA();
void RESONANCIA();
int main(){
do{
cout << "\n MENU DE FUNCIONES "<< endl;
cout << " ----------------------------"<< endl;
cout << " [1] TABLA DE MULTIPLICAR"<< endl;
cout << " [2] DIBUJO DE LINEAS"<< endl;
cout << " [3] CORRIENTE DE RESONANCIA L-R-C "<< endl;
cout << " [4] IMPERANCIA"<< endl;
cout << " [5] RESONACIA FRECUENCIA INICIAL"<< endl;
cout << "\n INGRESE UNA OPCION: ";
cin>>Opcion;
switch (Opcion){
case 1:{
cout << " [1] TABLA DE MULTIPLICAR"<< endl;
cout << " ----------------------------"<< endl;
TABLA();
cout<<endl;
break;
}
case 2:{
cout << " [2] DIBUJO DE LINEAS"<< endl;
cout << " ----------------------------"<< endl;
LINEAS();
cout<<endl;
break;
}
case 3:{
cout << " [3] CORRIENTE DE RESONANCIA L-R-C "<< endl;
cout << " ----------------------------"<< endl;
CORRIENTE();
cout<<endl;
break;
}
case 4:{
cout << " [4] IMPEDANCIA"<< endl;
cout << " ----------------------------"<< endl;
IMPEDANCIA();
break;
}
case 5:{
cout << " [5] RESONACIA FRECUENCIA INICIAL"<< endl;
cout << " ----------------------------"<< endl;
RESONANCIA();
break;
}
}
}while (Opcion!=0);
}
void TABLA(){
for(i=1; i<=12; i++){
cout<<"TABLA DEL "<<i<<endl;
cout << " -------------"<< endl;
for(j=1; j<=12; j++)
cout<<i<<" * "<<j<<" = "<<i*j<<endl;
}
}
void LINEAS(){
cout<<endl<<endl<<endl;
for(i=1; i<120; i++){
cout<<"-";
}
for(i=1; i<80; i++){
cout<<"*"<<endl;
}
cout<<endl;
}
void CORRIENTE(){
cout<<"Ingrese la Resistencia = "; cin>>R;
cout<<"Ingrese la Veloc. radial = "; cin>>w;
cout<<"Ingrese la Inductancia = "; cin>>L;
cout<<"Ingrese la Capacitancia = "; cin>>C;
for(Vo=10; Vo<=120; Vo=Vo+10){
A = pow(R,2);
E = w*L;
D = 1/w*C;
B = pow((E/D),2);
Io = Vo/(A + B);
cout<<"Para el voltaje = "<<Vo<<"la corriente I("<<Vo<<")= "<<Io<<endl;
}
}
void IMPEDANCIA(){
cout<<"Ingrese la Resistencia = "; cin>>R;
cout<<"Ingrese la Veloc. radial = "; cin>>w;
for(L=10; L<=20; L=L+0.5){
for(C=5; C<=10; C=C+1){
E = w*L;
D = 1/w*C;
A = pow(R,2);
B = pow(A+(E/D),2);
cout<<"La impedancia es: "<<B<<endl;
}
}
}
void RESONANCIA(){
for(L=1; L<=25; L=L+0.8){
for(C=10; C<=100; C=C+20){
F = 2*pi;
G = pow(L*C,2);
H = 1/F*G;
cout<<"La resonancia es: "<<H<<endl;
}
}
}









bottom of page