#include"stdio.h"
#include"conio.h"
#include"iostream.h"
main()
{
char kode,waktu,jawab,nama_film[50],nama_pen[10];
float harga,beli,bayar,pot,ppn,total,u_byr,u_kmb;
film:
clrscr ();
gotoxy(17,1);printf("******THeaTHeR FiLM ABC******");
gotoxy(15,4);printf("Nama Penonton : ");scanf("%s",&nama_pen);
gotoxy(15,5);cout<<"Kode Theater [1/2/3] : ";cin>>kode;
gotoxy(15,7);cout<<"Waktu Tayang [P/S/M] : ";cin>>waktu;
if(kode=='1')
{ gotoxy(30,6);cout<<"Tusuk Jaelangkung";
if(waktu=='p'||waktu=='P')
harga=17500;
else if(waktu=='s'|| waktu=='S')
harga=20000;
else if(waktu=='m'|| waktu=='M')
harga=22500;
else
harga=0;
}
else if(kode=='2')
{ gotoxy(30,6);cout<<"The Matrix";
if(waktu=='p'||waktu=='P')
harga=18000;
else if(waktu=='s'|| waktu=='S')
harga=20000;
else if(waktu=='m'|| waktu=='M')
harga=25000;
else
harga=0;
}
else if(kode=='3')
{gotoxy(30,6);cout<<"Spiderman";
if(waktu=='p'||waktu=='P')
harga=20000;
else if(waktu=='s'|| waktu=='S')
harga=20000;
else if(waktu=='m'|| waktu=='M')
harga=22500;
else
harga=0;
}
else
{gotoxy(30,6);cout<<"maaf pilihan tidak ada";
if(waktu=='p'||waktu=='P')
harga=0;
else if(waktu=='s'|| waktu=='S')
harga=0;
else if(waktu=='m'|| waktu=='M')
harga=0;
else
harga=0;
}
gotoxy(15,6);cout<<"Nama Film : ";
gotoxy(15,8);printf("Harga Tiket : %.0f",harga);
gotoxy(15,9);printf("Jumlah Pembelian Tiket : ");scanf("%f",&beli);
gotoxy(15,10);printf("********************************");
bayar=harga*beli;
if(beli>=5)
pot=0.10*bayar;
else
pot=0;
ppn=0.5*bayar;
total=(bayar-pot)+ppn;
gotoxy(15,11);printf("Nama Penonton : %s",nama_pen);
gotoxy(15,12);printf("Pembayaran : %.0f",bayar);
gotoxy(15,13);printf("Potongan : %.0f",pot);
gotoxy(15,14);printf("PPN : %.0f",ppn);
gotoxy(15,15);printf("Total Bayar : %.0f",total);
gotoxy(15,16);printf("********************************");
lagi:
gotoxy(15,17);printf("Uang Bayar : ");cin>>u_byr;
if (u_byr
{goto lagi;
u_byr=0 ;
printf("%d",u_byr) ;
}
else
u_kmb=u_byr-total;
gotoxy(15,18);printf("Uang Kembali : %.0f",u_kmb);
gotoxy(13,20);printf("TeRiMa KaSiH AnDa TeLaH DaTaNG Ke CouNTeR KaMi");
gotoxy(15,22);printf("Input Data Lagi [Y/T] :");jawab=getche();
if(jawab=='Y'||jawab=='y')
goto film ;
getche();
keluar:
}
Tidak ada komentar:
Posting Komentar