Free Aang Cursors at www.totallyfreecursors.com

Senin, 16 Februari 2015

C++ Teater Bioskop

Teater Bioskop



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


void main()
{
clrscr();
char kode, waktu, nama_film[20], nama_pen[10];
float harga, beli, bayar, pot, total,u_byr,u_kmb;


film:
gotoxy(17,1);
printf("************THEATER 21************");
gotoxy(15,4);
printf("Nama Penonton          : ");
scanf("%s", &nama_pen);
gotoxy(15,5);
printf("Kode Theather [1/2/3]  : ");
scanf("%s", &kode);
gotoxy(15,7);
cout<<"Waktu tayang [S/M]     : ";
cin>>waktu;


if (kode == '1')
{
      strcpy(nama_film,"JANDA KEMBANG");
      if (waktu == 's' || waktu == 'S')
harga = 10000;
else
harga = 1200;
}


else if (kode == '2')
{
strcpy (nama_film, "PUNK IN LOVE");
if (waktu == 's' || waktu == 'S')
harga = 10500;
else
harga = 12500;
}


else
{
strcpy (nama_film, "SELENDANG RINDU");
if (waktu == 's' || waktu == 'S')
harga = 11000;
else
harga = 13500;
}


gotoxy(15,6);
printf ("Nama Film              : %s",nama_film);
gotoxy(15,8);
printf ("Harga Tiket        :Rp. %.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;


total = (bayar-pot);


gotoxy(15,11);
printf("Pembayaran :Rp. %.0f",bayar);
gotoxy(15,12);
printf("Potongan   :Rp. %.0f",pot);
gotoxy(15,13);
printf("Total Bayar:Rp. %.0f",total);
gotoxy(15,14);
printf("*******************************");


//    lagi:


gotoxy(15,16);
printf("Uang bayar  :Rp. ");
cin>>u_byr;


  /*    if (u_byr<total)
{
goto lagi;
}


else */
{u_kmb = u_byr - total;
gotoxy(15,17);
cout<<"Uang Kembali:Rp. "<<u_kmb<<endl;
gotoxy(13,19);}
printf("Terima Kasih Anda Telah Datang ke Counter Kami");
getch();
}

Tidak ada komentar:

Posting Komentar