RSS

Tugas Borland C++











#include
#include
#include

main()
{
char lagi,kode[5 ],nama[40],bonus[20];
int jumlah;
float potongan=0,ppn;
long int harga=0,total=0;

atas:
clrscr();
cout<<"\tTOKO BUKU MATAHARI SENJA"<cout<<"-------------------------------------------------"<cout<<"Masukan Kode Buku [1|2|3]: ";cin>>kode;
cout<<"Jumlah pembelian buku: ";cin>>jumlah;
if (strcmpi(kode,"1")==0)
    {
   strcpy(nama,"Sukses Belajar Borland C++");
   harga=50000*jumlah;
   (else if(kode,'2')==0)
   strcpy(nama,"kunci pribadi yang sukses");
   harga=35000*jumlah;
   (else if(kode,'3')==0)
   strcpy(nama,"mencari mutiara di dasar hati");
   harga=45000*jumlah;
   if(jumlah>5)
   {strcpy(bonus,"Notebook");
   potongan=0.1*harga;
   }
   else
   cout<<"MAAF TIDAK DAPAT BONUS"<
cout<<"NAMA BUKU         : "<cout<<"HARGA BUKU        : "<cout<<"POTONGAN          : "<cout<<"BONUS             : "<total=harga-potongan;
cout<<"TOTAL BAYAR    : "<ppn=0.1*total;
cout<<"PPN                :  "<cout<<"    ****TERIMA KASIH****    "<
cout<<"APA MAU INPUT LAGI? [Y/N]??";
lagi=getche();
if(lagi=='Y'||lagi=='y')
    goto atas;


getch();
}

0 komentar:

Posting Komentar