Kumpulan tugas - tugas

Diberdayakan oleh Blogger.

ALGORITMA dan PEMOGRAMAN BORLAND C++ QUIZ

QUIZ



#include<stdio.h>
#include<iostream.h>
#include<conio.h>

main()
{
char kode,pilihan[15];
int jml;
long int potong,harga,bayar,pot1,total;
clrscr;
cout<<"==============================="<<endl;
cout<<"=RESTORAN STMIK ICHSAN="<<endl;
cout<<"==============================="<<endl;
cout<<"==============================="<<endl;
cout<<"=Kode= Nama Makanan  =  Harga ="<<endl;
cout<<"=-------------------------------="<<endl;
cout<<"= 1  =  Nasi Goreng  = 15000 ="<<endl;
cout<<"= 2  =  Mie Goreng   = 12500 ="<<endl;
cout<<"= 3  =  Cap-Cay      = 10000 ="<<endl;
cout<<"= 4  =  Soto Ayam    = 9000  ="<<endl;
cout<<"=------------------------------="<<endl;
cout<<"\n Kode Makanan: ";cin>>kode;

if (kode=='1')
{
strcpy (pilihan,"Nasi Goreng");
harga=15000;
}
else if (kode=='2')
{
strcpy (pilihan,"Mie Goreng");
harga=12500;
}
else if (kode=='3')
{
strcpy (pilihan,"Cap-Cay");
harga=10000;
}
else if (kode=='4')
{
strcpy (pilihan,"Soto Ayam");
harga=9000;
}
else
{
   strcpy(pilihan,"Kode Yang Anda Masukan Tidak Ada");
   harga=0;
   }

clrscr();
   cout<<"\n====================================="<<endl;
   cout<<"\n=       RESTORAN STMIK ICHSAN        "<<endl;
   cout<<"\n====================================="<<endl;
   cout<<"\n====================================="<<endl;
   cout<<"\n==============Nota Pembayaran========"<<endl;
   cout<<"\n= Nama Makanan       = "<<pilihan<<endl;
   cout<<"\n= Jumlah Pesanan     = ";cin>>jml;
   if (jml>5 && kode=='1') {potong=5000;} else {potong=0;}
   cout<<"\n Harga Makanan       = Rp."<<harga<<endl;
   bayar=jml*harga;
   cout<<"\n Bayar               = Rp."<<bayar<<endl;
   pot1=bayar*10/100;
   cout<<"\n ppn 10%             = Rp."<<pot1<<endl;
   cout<<"\n Potongan            = Rp."<<potong<<endl;
   total=bayar+pot1-potong;
   cout<<"\n Total Bayar         = Rp."<<total<<endl;
   cout<<"\n ================================"<<endl;
   getch();
   }
0 Komentar untuk "ALGORITMA dan PEMOGRAMAN BORLAND C++ QUIZ"

Untuk menggunakan emoticon gunakan simbol berikut ^_^

:) | ^_^ | :-d | :-bd | \o/ | =( | :( | ;) | :D | =D | :p | @@,

Back To Top