Contoh Program Penjualan tiket (C++)

Contoh Program Penjualan Tiket Bioskop

 

 

#include<stdio.h>
#include<conio.h>
#include<iostream.h>
main()
{ char kode,waktu,jawab,nama_film[20],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);printf("Kode Theater [1/2/3] : ");scanf("%s",&kode);
gotoxy(15,7);cout<<"Waktu Tayang [P/S/M] : ";cin>>waktu;

if(kode==’1′)
{ strcpy(nama_film,"Tusuk Jaelangkung");

if(waktu==’p’||waktu==’P’)
harga=17500;
else if(waktu==’s’|| waktu==’S’)
harga=20000;
else
harga=22500;
}
else if(kode==’2′)
{ strcpy(nama_film,"The Matrix");

if(waktu==’p’||waktu==’P’)
harga=18000;
else if(waktu==’s’|| waktu==’S’)
harga=20000;
else
harga=25000;
}
else
{ strcpy(nama_film,"Spiderman");

if(waktu==’p’||waktu==’P’)
harga=20000;
else if(waktu==’s’|| waktu==’S’)
harga=22500;
else
harga=25000;
}

gotoxy(15,6);printf("Nama Film : %s",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("Pembayaran : %.0f",bayar);
gotoxy(15,12);printf("Potongan : %.0f",pot);
gotoxy(15,13);printf("PPN : %.0f",ppn);
gotoxy(15,14);printf("Total Bayar : %.0f",total);
gotoxy(15,15);printf("********************************");
lagi:

gotoxy(15,16);printf("Uang Bayar : ");cin>>u_byr;

if (u_byr<total)

{goto lagi;
u_byr=0 ;
printf("%d",u_byr) ;
}
else

u_kmb=u_byr-total;
gotoxy(15,17);printf("Uang Kembali : %.0f",u_kmb);
gotoxy(13,19);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:
}
 

About these ads

2 Tanggapan

  1. Salam kenal…(Indonesia)
    Numpang promosi nih!
    Ada yg mau kuliah dengan beasiswa? Belajar Wirausaha?
    Main ke blog kampusku – Makasih ya!

  2. Pertamak nich…..jadi clingak-clinguk heheheeh…!!!

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Logout / Ubah )

Twitter picture

You are commenting using your Twitter account. Logout / Ubah )

Facebook photo

You are commenting using your Facebook account. Logout / Ubah )

Google+ photo

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

Ikuti

Get every new post delivered to your Inbox.

%d bloggers like this: