#include <iostream.h>
#include <conio.h>
#include <iomanip.h>
void main ()
{
int pilih;
int Exit;
float Luas_lingkaran,
Jari_jari;
float Volume_Bola;
float i, R, P, V;
cout << "\a NAMA
\t : PAHRURROZI \n";
cout << " NIM \t :
F1B012075 \n";
cout << "\n";
cout <<
"\t************************************************* \n";
cout << "\n";
cout << "\t\t
\t***MENU SWEETPINK*** \n";
cout << "
\n";
cout <<
"\t************************************************* \n";
cout << "
\n";
cout << "\t\t
*Pilihan yang Harus Dipiih* \n";
cout << "
\n";
cout << " 1. Luas
Lingkaran \n";
cout << " 2.
Volume Bola \n";
cout << " 3. Hukum
Ohm voltage \n";
cout << " 4. Hukum
Ohm Power \n";
cout << " 5. Hukum
Ohm Arus \n";
cout << " 6. EXIT
\n";
cout << "\n
\n";
cout << "Nomor
Berapa yang Dipilih kawand [1-6] ?? \n";
cin >> pilih;
switch (pilih)
{
case 1 :
cout << "Kita akan
menghitung Luas lingkaran \n";
cout << "\n";
cout << "Masukkan
Jari-jari lingkarannya \n";
cin >> Jari_jari;
Luas_lingkaran = 3.14 *
Jari_jari;
cout << setprecision
(10);
cout << "\n";
cout << " Luas
Lingkarannya adalah :"<< Luas_lingkaran << "\a cm
\n";
break ;
case 2 :
cout << "Kita akan
menghitung Volume Bola \n";
cout << "\n";
cout << "Masukkan
Jari jari bola \n";
cin >> Jari_jari;
Volume_Bola = 3.14 *
Jari_jari * Jari_jari * Jari_jari * 4/3;
cout << setprecision
(10);
cout << "\n";
cout << " Jadi,
Volume Bola adalah : " << Volume_Bola << " \a cm
\n";
break;
case 3:
cout << " Sekarang
kita akan menghitung hukum Ohm tentang Voltage... \n";
cout << "\n";
cout << " Masukkan
nilai arus \n";
cin >> i;
cout << " Masukkan
nilai Resistor \n";
cin >> R;
V = i*R;
cout << setprecision
(10);
cout << "\n";
cout << " Jadi
tegangannya adalah :" << V << " V \n";
break ;
case 4:
cout << " Sekarang kita akan menghitung hukum Ohm
tentang Power... \n";
cout << "\n";
cout << " Masukkan
nilai arus \n";
cin >> i;
cout << " Masukkan
nilai Resistor \n";
cin >> R;
P= i*i * R;
cout << setprecision
(10);
cout << "\n";
cout << " jadi
Powernya adalah :" << P << " \n";
break ;
case 5:
cout << " Sekarang kita akan menghitung hukum Ohm
tentang Arus... \n";
cout << "\n";
cout << " Masukkan
nilai tegangan \n";
cin >> V;
cout << " Masukkan
nilai Resistor \n";
cin >> R;
i = V/R;
cout << setprecision
(10);
cout << "\n";
cout << " jadi
besar arusnya adalah :" << i << " \n";
break ;
case 6:
clrscr ();
cout << "Apakah
anda yakin ingin keluar ?? \n";
cin >> Exit;
if ( Exit == 0)
{
cout << " Anda
keluar .... \n";
}
else
{
cout << " Anda
tidak jadi keluar \n";
}
cout << "\n";
cout << " \t \t
\t Alhamdulillah.... \n";
cout << " \t
********************************************** \n";
cout << "\n
";
cout <<
"\t\t\t***Ozzy Sweetpink*** \n ";
cout << "\t
*********************************************** \n";
}
getche ();
}
|