Anda di halaman 1dari 7

# #include <iostream>

int main()

int a,e,i;

## cout<< "Mesin Penghitung"<< endl;

cout<< "__________________________________________"<<endl;

## cout<< "pilihan (1/2/3/4/5/6) :";

cin >> a;

if (a==1){

cout<<"_________________________________________"<<endl;

cout<< "Penjumlahan\n"<<endl;

float b,c;

## cout<<"masukan nilai pertama :";cin >>b ;

cout<<"masukan nilai kedua :";cin >>c ;

float d=b+c;

cout<<"Hasil :"<<d;

else if(a==2){

cout<<"_________________________________________"<<endl;

cout<<"Pengurangan\n"<<endl;

float b,c;

float d=b-c;

## cout<< "Hasil : "<<d;

else if(a==3){

cout<<"_________________________________________"<<endl;

cout<<"Perkalian\n"<<endl;

float b,c;

## cout<<"masukan nilai kedua :"; cin >>c;

float d=b*c;

cout<<"Hasil :"<<d;

else if(a==4){

cout<<"_________________________________________"<<endl;

cout<<"Pembagian\n"<<endl;
float b,c;

## cout<<"masukan nilai kedua :"; cin >>c;

float d=b/c;

cout<<"Hasil :"<<d;

else if(a==5){

cout<<"_________________________________________"<<endl;

## cout<<"Menghitung Bangun Datar\n"<<endl;

cout<<"1.Persegi"<<endl;

cout<<"2.Persegi Panjang"<<endl;

cout<<"3.Segitiga"<<endl;

## cout<<"Pilihan (1/2/3/4) :";cin >> e;

if(e==1){

cout<<"_________________________________________"<<endl;

cout<<"Persegi\n"<<endl;

cout<<"1.Keliling Persegi"<<endl;

cout<<"2.Luas Persegi\n"<<endl;

## cout<<"Pilihan (1/2/) :";cin >>i;

if(i==1){

cout<<"_________________________________________"<<endl;

cout<<"Keliling Persegi\n"<<endl;

float s;

float k=4*s;

## cout<<"Keliling :"<<k<<" cm";

else if(i==2){

cout<<"_________________________________________"<<endl;

cout<<"Luas Persegi\n"<<endl;

float s;

float l=s*s;

## cout <<"Luas :"<<l<<" cm2";

if(e==2){

cout<<"_________________________________________"<<endl;

cout<<"Persegi Panjang\n"<<endl;

## cout<<"Pilihan (1/2/) :";cin >>i;

if(i==1){

cout<<"_________________________________________"<<endl;

float p,l;

## cout<<"Masukan nilai lebar :"; cin >>l;

float k=(p+l)*2;
cout<<"Keliling :"<<k<<" cm";

else if(i==2){

cout<<"_________________________________________"<<endl;

float p,l;

float Luas=p*l;

## cout <<"Luas :"<<Luas<<" cm2";

if(e==3){

cout<<"_________________________________________"<<endl;

cout<<"Segitiga\n"<<endl;

cout<<"1.Keliling Segitiga"<<endl;

cout<<"2.Luas Segitiga\n"<<endl;

## cout<<"Pilihan (1/2/) :";cin >>i;

if(i==1){

cout<<"_________________________________________"<<endl;

cout<<"Keliling Segitiga\n"<<endl;

float a,b,c;

float k=a+b+c;

## cout<<"Keliling :"<<k<<" cm";

else if(i==2){

cout<<"_________________________________________"<<endl;

cout<<"Luas Segitiga\n"<<endl;

float a,t;

## cout<<"Masukan nilai tinggi :"; cin >>t;

float Luas=(a*t)/2;

## cout <<"Luas :"<<Luas<<" cm2";

if(e==4){

cout<<"_________________________________________"<<endl;

cout<<"Lingkaran\n"<<endl;

cout<<"1.Keliling Lingkaran"<<endl;

cout<<"2.Luas Lingkaran\n"<<endl;

## cout<<"Pilihan (1/2/) :";cin >>i;

if(i==1){

cout<<"_________________________________________"<<endl;

cout<<"Keliling Lingkaran\n"<<endl;

float r;

## cout<<"Masukan nilai jari-jari :"; cin >>r;

float k=2*3.14*r;
cout<<"Keliling :"<<k<<" cm";

else if(i==2){

cout<<"_________________________________________"<<endl;

cout<<"Luas lingkaran\n"<<endl;

float r;

## cout<<"Masukan nilai jari-jari :"; cin >>r;

float Luas=3.14*r*r;

else if(a==6){

exit(6);

else {

## cout<<"code yang anda masukan salah!";

### Dapatkan aplikasi gratis kami

Hak cipta © 2021 Scribd Inc.