Thursday, 15 December 2011

program hitung total harga restaurant


#include<conio.h>
#include<stdio.h>
#include<iostream.h>
main()
{
clrscr();
float diskon,a,b,c,d,total,bayar;
cout<<"       DAFTAR MENU DAN HARGA\n";
cout<<"          Rumah Makan SIJAY   \n\n\n";

cout<<"No | Nama Menu   | Harga/porsi |\n";
cout<<"--------------------------------\n";
cout<<"1. | Bakso Super | Rp. 10.000,-|\n";
cout<<"2. | Bakso Cinta | Rp. 15.000,-|\n";
cout<<"3. | Bebek Bakar | Rp. 20.000,-|\n";
cout<<"4. | Aneka Pempek| Rp.  5.000,-|\n";
cout<<"\n\n\n\nDaftar Menu yang telah dipesan\n";
cout<<"---------------------------------\n";
cout<<"Bakso Super berapa porsi = ";cin>>a;
cout<<"Bakso Cinta berapa porsi = ";cin>>b;
cout<<"Bebek Bakar berapa porsi = ";cin>>c;
cout<<"Pempek berapa porsi      = ";cin>>d;
total=(10000*a)+(15000*b)+(20000*c)+(5000*d);
if (total>50000)
{
diskon=0.1*total;
bayar=total-diskon;}
else if (total<=50000)
{diskon=0;
bayar=total;}
cout<<"\n\nTotal            = "<<total<<" Rupiah"<<endl;
cout<<"Discount         = "<<diskon<<" Rupiah"<<endl;
cout<<"Total Bayar      = "<<bayar<<" Rupiah";


getch();
}

No comments:

Post a Comment