#include<iostream>
#include<conio.h>
#include<iomanip>
#include <cstdlib>
using namespace std;
int main ()
{system ("color b");
int pilihan;
float i,v,r,w,s,f;
char nama [40];
char alamat [40];
char ulang;
cout<<"Silahkan masukan nama anda : "; cin.getline(nama,40);
cout<<"Silahkan masukan alamat anda (contoh : banjar(jawa barat)) : ";
cin.getline (alamat,40);
do
{
utama:
cout<<"Selamat Datang "<<nama<<"\n"<<"dengan alamat "<<alamat<<"\n"<<"dalam program penghitungan DAYA saya \n\n\n";
cout<<"========================================================================="<<endl;
cout<<"|\t\t\t\tMENGHITUNG DAYA\t\t\t\t|"<<endl;
cout<<"|=======================================================================|"<<endl;
cout<<"|\tMenghitung Daya Jika yang Diketahui nilainya adalah : \t\t|"<<endl;
cout<<"|\t1. Kuat Arus (I) dan Tegangan (V)\t\t\t\t|"<<endl;
cout<<"|\t2. Kuat Arus (I) dan Resonansi (R)\t\t\t\t|"<<endl;
cout<<"|\t3. Usaha (W) dan Waktu (s)\t\t\t\t\t|"<<endl;
cout<<"|\t4. Gaya (F) dan Tegangan Listrik (V)\t\t\t\t|"<<endl;
cout<<"|\t5. Rumus-rumus Daya\t\t\t\t\t\t|"<<endl;
cout<<"|\t0. Tidak Menemui Pilihan\t\t\t\t\t|"<<endl;
cout<<"========================================================================="<<endl;
cout<<"\n";
cout<<"\tTentukan pilihan = ";
cin>>pilihan;
if(pilihan==1)
{
cout<<"\t\t Menghitung Daya Jika Yang Diketahui"<<endl;
cout<<"\t\t\tKuat Arus dan Tegangan"<<endl;
cout<<"====================================================================="<<endl;
cout<<"\n\tMasukan nilai Kuat Arus = ";
cin>>i;
cout<<"\tMasukan nilai Tegangan = ";
cin>>v;
cout<<"\n====================================================================="<<endl;
cout<<"\n\t\tDaya = Tegangan x Kuat Arus"<<endl;
cout<<"\t\tP =\t V\tx\tI"<<endl;
cout<<"\t\tP =\t "<<v<<"\tx\t"<<i<<endl;
cout<<"\t\tP =\t"<<v*i<<" Watt\n";
cout<<"\n====================================================================="<<endl;
}
else if(pilihan==2)
{
cout<<"\t\t Menghitung Daya Jika Yang Diketahui"<<endl;
cout<<"\t\t\tKuat Arus dan Resonansi"<<endl;
cout<<"====================================================================="<<endl;
cout<<"\n\tMasukan nilai Kuat Arus = ";
cin>>i;
cout<<"\tMasukan nilai Resonansi = ";
cin>>r;
cout<<"\n====================================================================="<<endl;
cout<<"\n\t\tDaya = Kuat Arus x Kuat Arus x Resonansi"<<endl;
cout<<"\t\tP =\t I x I x\t R"<<endl;
cout<<"\t\tP =\t "<<i<<" x "<<i<<" x "<<r<<endl;
cout<<"\t\tP =\t "<<i*i*r<<" Watt"<<endl;
cout<<"\n====================================================================="<<endl;
}
else if(pilihan==3)
{
cout<<"\t\t Menghitung Daya Jika Yang Diketahui"<<endl;
cout<<"\t\t\tUsaha dan Waktu"<<endl;
cout<<"====================================================================="<<endl;
cout<<"\n\tMasukan nilai Usaha = ";
cin>>w;
cout<<"\tMasukan nilai Waktu = ";
cin>>s;
cout<<"\n====================================================================="<<endl;
cout<<"\n\t\tDaya = Usaha : Waktu"<<endl;
cout<<"\t\tP =\t W :\tt"<<endl;
cout<<"\t\tP =\t "<<w<<" :\t"<<s<<endl;
cout<<"\t\tP =\t "<<w/s<<" Watt"<<endl;
cout<<"\n====================================================================="<<endl;
}
else if(pilihan==4)
{
cout<<"\t\t Menghitung Daya Jika Yang Diketahui"<<endl;
cout<<"\t\t\tGaya dan Tegangan Listrik"<<endl;
cout<<"====================================================================="<<endl;
cout<<"\n\tMasukan nilai Gaya = ";
cin>>f;
cout<<"\tMasukan nilai Tegangan = ";
cin>>v;
cout<<"\n====================================================================="<<endl;
cout<<"\n\t\tDaya = Gaya x Tegangan"<<endl;
cout<<"\t\tP =\t F x\tV"<<endl;
cout<<"\t\tP =\t "<<f<<" x\t"<<v<<endl;
cout<<"\t\tP =\t "<<f*v<<" Watt"<<endl;
cout<<"\n====================================================================="<<endl;
}
else if(pilihan==5)
{
cout<<"\t\t\t\tRUMUS-RUMUS"<<endl;
cout<<"\t\t\t\t DAYA"<<endl;
cout<<"====================================================================="<<endl;
cout<<" Daya ada dalam berbagai aplikasi."<<endl;
cout<<" Daya listrik, \n\tP = VxI = I^2xR"<<endl;
cout<<" Daya poros yang berputar, \n\tP = TxO = FxV"<<endl;
cout<<" Daya aliran Fluida, \n\tP = FxV = mdot*V*V = mdotxV^2 = AVpxV^2 = ApV^3\n"<<endl;
cout<<"====================================================================="<<endl;
cout<<"====================================================================="<<endl;
cout<<" Penjelasan :"<<endl;
cout<<" mdot = laju aliran massa (kg/s)"<<endl;
cout<<" A = luas penampang aliran"<<endl;
cout<<" V = kecepatan (m/s)"<<endl;
cout<<" p = massa jenis (kg/m^3)"<<endl;
cout<<" O = kecepatan sudut (rad/s)"<<endl;
cout<<" I = Arus listrik (A)"<<endl;
cout<<" R = hambatan listrik (Ohm)"<<endl;
cout<<" V = tegangan listrik (Volt)"<<endl;
cout<<" F = gaya (N)"<<endl;
cout<<" Dan berbagai jenis lainnya. Selama ada perubahan energi terhadap waktu,"<<endl;
cout<<" maka hal tersebut bisa dipandang sebagai daya untuk sistem tersebut"<<endl;
cout<<" dE/dt = P"<<endl;
cout<<"\n====================================================================="<<endl;
}
else if(pilihan==0)
{
cout<<"\n\n\n\n\n\n\n==========================================================================="<<endl;
cout<<"\n\t\t\t\tMOHON MAAF!"<<endl;
cout<<"\t\tSISTEM KAMI BELUM DAPAT MENEMUI KEINGINAN ANDA"<<endl;
cout<<"\n==========================================================================="<<endl;
}
else
{
cout<<"Maaf, keyword yang anda masukan salah!\nSilahkan ulangi lagi!\n\nSilahkan tekan enter!"<<endl;
getch();
}
cout<<"Apakah anda ingin mencoba program ini lagi? [y/t] ";
cin>>ulang;
}
while (ulang=='y'||ulang=='Y');
cout<<"TERIMA KASIH TELAH MENGGUNAKAN PROGRAM SAYA ^-^"<<endl;
}
Hasil Compile
Rabu, 15 Januari 2014
Program Menghitung Daya Listrik
Semoga Bermanfaat :)
Share this
Related Articles :
Langganan:
Posting Komentar (Atom)
Paling Dilihat
-
Program Mengurutkan Angka Kecil Ke Besar (Dev C++) #include<iostream> #include<conio.h> using namespace std; int main() ...
-
Program Perkalian Matrik Ordo 2x2 ( Dev C++ ) #include <iostream> #include <conio.h> using namespace std; int main(voi...
-
Program Menghitung Luas segitiga ( Dev C++ ) #include <iostream> using namespace std; int main(int argc, char *argv[]) { int a,...
-
Program Penjumlahan dan Pengurangan Matrik Ordo 3x3 (Dev C++) #include<stdio.h> #include<conio.h> using namespace std; i...
-
Kali Ini admin mau share ni cara membuat kalkulator sederhana menggunakan bahasa C tepatnya menggunakan aplikasi pemrograman Borland C++ ,...
-
Program Menghitung Bangun Ruang dan Bangun Datar (Dev C++) #include<iostream> #include<math.h> using namespace std; main...
Diberdayakan oleh Blogger.
0 komentar
Posting Komentar