#include<iostream>
#include<math.h>
#include<conio.h>
#include<string>
using namespace std;
int main()
{
int pil;
char ulang;
awal:
cout<<"\n...:::: MENU
LUAS BANGUN DATAR ::::..."<<endl;
cout<<"========================================"<<endl;
cout<<"|1. Luas
Segitiga
|"<<endl;
cout<<"|2. Luas
Persegi Panjang
|"<<endl;
cout<<"|3. Luas
Lingkaran
|"<<endl;
cout<<"|4. Nama
Kelompok
|"<<endl;
cout<<"|5. Exit |"<<endl;
cout<<"========================================"<<endl;
cout<<"Masukkan
Pilihan Anda [1..5] : ";cin>>pil;
cout<<"\n";
switch(pil)
{
case 1 :
{
float a,t,L;
cout << "****** Luas
Segitiga ******" << endl;
cout << "\nAlas : ";
cin >> a;
cout << "\nTinggi : ";
cin >> t;
L=(a*t)/2;
cout << "Luas : " << L;
}
goto tengah;
case 2 :
{
int p,l;
float L;
cout << "\n" ;
cout << " "
<< "-----------------------------------" << endl;
cout << " "
<< " Menghitung Luas Persegi Panjang " << " "
<< endl;
cout << " "
<< "-----------------------------------";
cout <<
"\nPanjang : ";
cin >> p;
cout << "\nLebar : ";
cin >> l;
L = p*l;
cout << "\nLuas : " << L;
}
goto tengah;
case 3 :
{
float r, L;
float phi = 3.14;
cout << " "
<< " Menghitung Luas Lingkaran " << endl;
cout << " \nJari-jari
: ";
cin >> r;
L = phi*r*r;
cout << "Luas : " << L;
}
goto tengah;
case 4 :
{
cout <<
">>>>>>>>>>> NAma Kelompok
>>>>>>>>>>>" << endl;
cout << "\n~ Asriel
Albert Pangloli : 11110182 ";
cout << "\n~ Lira
Elvani : 14110044 ";
cout << "\n~ Deni Robi
Hartarto : 11110789 ";
cout << "\n~ Indra
Kurniawan Effendi : 13110520 ";
cout << "\n~ Reza
Maulana : 15110806 ";
cout << "\n~ Wira
Andhika Wasisto : 18110543 "
<< endl;
cout <<
"\n>>>>>>>>>>> Kelas : 2ka17
>>>>>>>>>>>";
}
goto tengah;
case 5 : goto akhir;
default : cout<<"Maaf
Input yang Anda Masukkan Salah !";
tengah:
cout<<"\n";
cout<<"\nKembali ke
Menu [Y/N] ? : ";cin>>ulang;
while(ulang=='Y'||ulang=='y')
goto awal;
goto akhir;
}
getch();
akhir:
return 0;
}
outputnya :
by : lira elvani
Tidak ada komentar:
Posting Komentar