Sunday, April 15, 2012

Harga Menu Makanan Restoran (。◕‿◕。)


            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();
}

 Selamat Mencoba !!

5 comments:

Unknown said...

gan bisa minta penjelasan progranya donk ??

Unknown said...

mantap bgt programnya..

Unknown said...

penjelasan dong gan

Anonymous said...

The History of the Casino - One of the Most Popular Casinos
A relative newcomer https://febcasino.com/review/merit-casino/ to 출장마사지 the world of online gambling, Wynn Las Vegas opened its doors to 토토사이트 a new audience of over 600,000 in 2017. This was casinosites.one the wooricasinos.info first casino

tadakonachtigall said...

Top 10 for "Genesis Classic" Games - ArcadeP.org
In the list below, you will see 다크걸 the list of titles and the overall top 50 titles. It's a game that's been around for a 토토카지노사이트 while now and is one of the main

Post a Comment