#include<cstdlib>
#include<conio.h>
#include<iostream>
#include<windows.h>
using namespace std;
int main()
{
system("color 17");
int jml,total,bayar;
int komik,novel,majalah,diskon;
char p,buku,q;
komik=10000;
novel=15000;
majalah=20000;
awal:
system("cls");
cout<<"\n\t========================================================="<<endl;
cout<<"\t= TONI JASAMEDIA RENTAL BOOK ="<<endl;
cout<<"\t========================================================="<<endl;
cout<<"\n\tpinjam buku 5 atau lebih, discon
10%"<<endl;
cout<<"\n\tjenis buku :"<<endl;
cout<<"\t[1] komik, perbuku Rp
10.000"<<endl;
cout<<"\t[2] novel, perbuku Rp
15.000"<<endl;
cout<<"\t[3] majalah, perbuku Rp
20.000"<<endl;
cout<<"\n\tmasukan jenis buku :
";cin>>buku;
if (buku=='1')
{
cout<<"\n\tMasukkan banyak
buku yang ingin di pinjam : ";cin>>jml;
if(jml>=5)
{
bayar=jml*komik;
diskon=bayar*0.1;
total=bayar-diskon;
cout<<"\n\t======================================================="<<endl;
cout<<"\n\tanda mendapat
diskon 10% : Rp. "<<diskon<<endl;
}
else
{
total=jml*komik;
}
cout<<"\n\tTotal yang harus
di bayar : Rp. "<<total<<endl;
cout<<"\n\t======================================================="<<endl;
cout<<"\t Terima kasih sudah meminjam buku di toni
jasamedia "<<endl;
cout<<"\t======================================================="<<endl;
}
if (buku=='2')
{
cout<<"\n\tMasukkan banyak
buku yang ingin di pinjam : ";cin>>jml;
if(jml>=5)
{
bayar=jml*novel;
diskon=bayar*0.1;
total=bayar-diskon;
cout<<"\n\t======================================================="<<endl;
cout<<"\n\tanda mendapat
diskon 10% : Rp. "<<diskon<<endl;
}
else{
total=jml*novel;
}
cout<<"\n\tTotal yang harus
di bayar : Rp. "<<total<<endl;
cout<<"\n\t======================================================="<<endl;
cout<<"\t Terima kasih sudah meminjam buku di toni
jasamedia "<<endl;
cout<<"\t======================================================="<<endl;
}
if (buku=='3')
{
cout<<"\n\tMasukkan banyak
buku yang ingin di pinjam : ";cin>>jml;
if(jml>=5)
{
bayar=jml*komik;
diskon=bayar*0.1;
total=bayar-diskon;
cout<<"\n\t======================================================="<<endl;
cout<<"\n\tanda mendapat
diskon 10% : Rp. "<<diskon<<endl;
}
else{
total=jml*majalah;
}
cout<<"\n\tTotal yang harus
di bayar : Rp. "<<total<<endl;
cout<<"\n\t======================================================="<<endl;
cout<<"\t Terima kasih sudah meminjam buku di toni
jasamedia "<<endl;
cout<<"\t======================================================="<<endl;
}
{
cout<<"\n\tulang [y][n] :
";cin>>q;
switch(q)
{
case 'y':
{
goto awal;
}
break;
case 'n':
{
goto b;
}
break;
default:
goto awal;
}
}
b:
system("color 71");
return 0;
}
|
Komentar
Posting Komentar
berikan komentar postif