Berikut ada sedikit program yang mungkin saudara butuhkan yaitu program Capacitor .
berikut source codenya:
#include<iostream.h>
#include<conio.h>
#define phi 3.14
float capacitive_reactance(float capacitance, float frequency);
float inductive_reactance(float inductance, float frequency);
main()
{
int capacitor, inductor, frequency;
float hasil_kapasitor, hasil_induktor;
cout<<"Masukkan Nilai Capacitor dalam farads = "; cin>>capacitor;
cout<<"Masukkan Nilai Inductor dalam henrys = "; cin>>inductor;
cout<<"Masukkan Nilai Frekuensi dalam hertz = "; cin>>frequency; cout<<endl;
hasil_kapasitor=capacitive_reactance(capacitor, frequency);
cout<<"Reaktance dari sebuah capacitor "<<capacitor<<" farads"<<endl;
cout<<"Pada frequency "<<frequency<<" hertz = "<<hasil_kapasitor<<endl<<endl;
hasil_induktor=inductive_reactance(inductor, frequency);
cout<<"Reaktance dari sebuah inductor "<<inductor<<" henrys"<<endl;
cout<<"Pada frequency "<<frequency<<" hertz = "<<hasil_induktor<<endl<<endl;
getch();
}
float capacitive_reactance(float capacitance, float frequency)
{
float reactance;
reactance= 1/(2*phi*frequency*capacitance);
return(reactance);
}
float inductive_reactance(float inductance, float frequency)
{
float reactance;
reactance=2*phi*frequency*inductance;
return(reactance);
}
kalau ada yang ngerti silahkan tanya kesaya melalui komen. . ckckckckckck
0 komentar:
Posting Komentar