Borland C++, merupkan salah satu
bahasa pemrograman yang ada untuk logika pemrograman komputer. Dari sekian
banyak bahasa pemrograman yang ada di muka bumi ini, tak ada yang mudah. Ada
pepatah yang mengatakan “tak kenal maka tak sayang”, dan itu memang benar
adanya. Jika kita tak pernah mau mencoba belajar dari awal, kita tak akan
pernah bisa.
Nah Sekarang kita coba membuat program menggunakan bahasa C++ yukz...
#include<iostream.h>
#include<conio.h>
#include<math.h>
main()
{
int Pilihan;
double P,np,Tot,etj,aj;
clrscr();
cout<<"Selamat Datang di Resto
Murah Tapi Mantap\n";
cout<<"-----------------------------------------\n";
cout<<"\n";
cout<<"Daftar Menu
Makanan\n";
cout<<"~~~~~~~~~~~~~~~~~~~\n";
cout<<"1.Paket Hemat\n";
cout<<"2.Paket Mantap\n";
cout<<"3.Paket Jumbo\n";
cout<<"4.Double Jumbo\n";
cout<<"5.Paket Family\n";
cout<<"-------------------\n";
cout<<"Masukkan Menu Makanan :
";cin>>Pilihan;
cout<<"-------------------\n";
switch(Pilihan)
{
case
1:
cout<<"Paket
Hemat\n";
cout<<"~~~~~~~~~~~\n";
cout<<"Harga :
Rp5.000,00\n";
cout<<"Porsi :
";cin>>P;
cout<<"--------------\n";
int Tambahan;
cout<<"1.Nasi
Putih\n";
cout<<"2.Es
Teh/Jeruk\n";
cout<<"3.Aneka Jus\n";
cout<<"--------------\n";
cout<<"Tambahan :
";cin>>Tambahan;
switch(Tambahan)
{
case
1:
cout<<"Nasi
Putih\n";
cout<<"--------------\n";
cout<<"Harga :
Rp2.000,00\n";
cout<<"Porsi :
";cin>>np;
break;
case
2:
cout<<"Es
Teh/Jeruk\n";
cout<<"--------------\n";
cout<<"Harga :
Rp2.000,00\n";
cout<<"Porsi :
";cin>>etj;
break;
case 3:
cout<<"Aneka
Jus\n";
cout<<"--------------\n";
cout<<"Harga :
Rp5.000,00\n";
cout<<"Porsi :
";cin>>aj;
}
cout<<"--------------\n";
Tot=(5000*P)+((2000*np)+(2000*etj)+(5000*aj));
cout<<"Total =
Rp"<<Tot<<",00\n";
cout<<"\n";
cout<<"Terima Kasih Telah
Mengunjungi Rumah Makan Kami\n";
cout<<"_______________________________________________\n";
break;
case 2:
cout<<"Paket
Mantap\n";
cout<<"~~~~~~~~~~~~\n";
cout<<"Harga : Rp10.000,00\n";
cout<<"Porsi :
";cin>>P;
cout<<"--------------\n";
cout<<"1.Nasi
Putih\n";
cout<<"2.Es
Teh/Jeruk\n";
cout<<"3.Aneka Jus\n";
cout<<"--------------\n";
cout<<"Tambahan :
";cin>>Tambahan;
switch(Tambahan)
{
case 1:
cout<<"Nasi
Putih\n";
cout<<"--------------\n";
cout<<"Harga :
Rp2.000,00\n";
cout<<"Porsi :
";cin>>np;
break;
case
2:
cout<<"Es
Teh/Jeruk\n";
cout<<"--------------\n";
cout<<"Harga :
Rp2.000,00\n";
cout<<"Porsi :
";cin>>etj;
break;
case
3:
cout<<"Aneka
Jus\n";
cout<<"--------------\n";
cout<<"Harga :
Rp5.000,00\n";
cout<<"Porsi :
";cin>>aj;
}
cout<<"--------------\n";
Tot=(10000*P)+((2000*np)+(2000*etj)+(5000*aj));
cout<<"Total =
Rp"<<Tot<<",00\n";
cout<<"\n";
cout<<"Terima Kasih Telah
Mengunjungi Rumah Makan Kami\n";
cout<<"_______________________________________________\n";
break;
case 3:
cout<<"Paket
Jumbo\n";
cout<<"~~~~~~~~~~~~\n";
cout<<"Harga :
Rp15.000,00\n";
cout<<"Porsi :
";cin>>P;
cout<<"--------------\n";
cout<<"1.Nasi
Putih\n";
cout<<"2.Es
Teh/Jeruk\n";
cout<<"3.Aneka Jus\n";
cout<<"--------------\n";
cout<<"Tambahan :
";cin>>Tambahan;
switch(Tambahan)
{
case
1:
cout<<"Nasi
Putih\n";
cout<<"--------------\n";
cout<<"Harga :
Rp2.000,00\n";
cout<<"Porsi :
";cin>>np;
break;
case 2:
cout<<"Es
Teh/Jeruk\n";
cout<<"--------------\n";
cout<<"Harga :
Rp2.000,00\n";
cout<<"Porsi :
";cin>>etj;
break;
case 3:
cout<<"Aneka
Jus\n";
cout<<"--------------\n";
cout<<"Harga :
Rp5.000,00\n";
cout<<"Porsi :
";cin>>aj;
}
cout<<"--------------\n";
Tot=(15000*P)+((2000*np)+(2000*etj)+(5000*aj));
cout<<"Total =
Rp"<<Tot<<",00\n";
cout<<"\n";
cout<<"Terima Kasih Telah
Mengunjungi Rumah Makan Kami\n";
cout<<"_______________________________________________\n";
break;
case 4:
cout<<"Double
Jumbo\n";
cout<<"~~~~~~~~~~~~\n";
cout<<"Harga : Rp20.000,00\n";
cout<<"Porsi :
";cin>>P;
cout<<"--------------\n";
cout<<"1.Nasi
Putih\n";
cout<<"2.Es
Teh/Jeruk\n";
cout<<"3.Aneka Jus\n";
cout<<"--------------\n";
cout<<"Tambahan :
";cin>>Tambahan;
switch(Tambahan)
{
case
1:
cout<<"Nasi
Putih\n";
cout<<"--------------\n";
cout<<"Harga :
Rp2.000,00\n";
cout<<"Porsi :
";cin>>np;
break;
case 2:
cout<<"Es
Teh/Jeruk\n";
cout<<"--------------\n";
cout<<"Harga :
Rp2.000,00\n";
cout<<"Porsi :
";cin>>etj;
break;
case
3:
cout<<"Aneka
Jus\n";
cout<<"--------------\n";
cout<<"Harga :
Rp5.000,00\n";
cout<<"Porsi :
";cin>>aj;
}
cout<<"--------------\n";
Tot=(20000*P)+((2000*np)+(2000*etj)+(5000*aj));
cout<<"Total =
Rp"<<Tot<<",00\n";
cout<<"\n";
cout<<"Terima Kasih Telah
Mengunjungi Rumah Makan Kami\n";
cout<<"_______________________________________________\n";
break;
case 5:
cout<<"Paket
Family\n";
cout<<"~~~~~~~~~~~~\n";
cout<<"Harga :
Rp45.000,00\n";
cout<<"Porsi :
";cin>>P;
cout<<"--------------\n";
cout<<"1.Nasi
Putih\n";
cout<<"2.Es
Teh/Jeruk\n";
cout<<"3.Aneka Jus\n";
cout<<"--------------\n";
cout<<"Tambahan :
";cin>>Tambahan;
switch(Tambahan)
{
case
1:
cout<<"Nasi
Putih\n";
cout<<"--------------\n";
cout<<"Harga :
Rp2.000,00\n";
cout<<"Porsi :
";cin>>np;
break;
case 2:
cout<<"Es
Teh/Jeruk\n";
cout<<"--------------\n";
cout<<"Harga :
Rp2.000,00\n";
cout<<"Porsi :
";cin>>etj;
break;
case 3:
cout<<"Aneka
Jus\n";
cout<<"--------------\n";
cout<<"Harga :
Rp5.000,00";
cout<<"Porsi :
";cin>>aj;
}
cout<<"--------------\n";
Tot=(45000*P)+((2000*np)+(2000*etj)+(5000*aj));
cout<<"Total = Rp"<<Tot<<",00\n";
cout<<"\n";
cout<<"Terima Kasih Telah
Mengunjungi Rumah Makan Kami\n";
cout<<"_______________________________________________\n";
break;
default :
cout<<"Anda
Hanya Bisa Memilih Paket Yang Sudah Tersedia. (Pilih 1-5)!!!\n";
break;
}
getch();
}