contoh program c++ penjualan tiket bioskop

Kali ini saya akan share contoh program c++ penjualan tiket bioskop ini adalah salah satu contoh program yang sangat sederhana, semoga bermanfaat bagi teman-teman semua.

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

#include <stdlib.h>


using namespace std;


main()

{

    int pil,a;

    char choice (2);



    system("cls");

    menu:

    cout<<"========= WELCOME TO CINEMA-TAU ========\n\n"<<endl;

    cout<<"<--------------------------------------->\n"<<endl;

    cout<<"Created by:\n";

    cout<<"     >> Arman\n"<<endl;

    cout<<"     >> Denny Hakim\n"<<endl;

    cout<<"     >> Gita Rachmah Ikhwanty\n"<<endl;

    cout<<"<--------------------------------------->\n"<<endl;



    cout<<"=============MENU=============\n"<<endl;

    cout<<"      1.Order Ticket(s)         "<<endl;

    cout<<"      2.Check Seat              "<<endl;

    cout<<"      3.End                     "<<endl<<endl;



    cout<<"      Enter Your Choice     : ";

    cin>>pil;


    switch(pil)

    {

    case 1:

        mulai:


        system("cls");


        int jenis,jumlah,total_tiket;


        char*jenis_txt;



        cout<<"::::::::>> WELCOME TO CINEMA-TAU <<::::::::<\n\n";

        cout<<"Ticket Price: \n1. Adult\t: Rp.20.000,-\n2. Child\t: Rp.15.000,-\n\n";


        cout<<"\n\Enter Your Choice: \n";

        cout<<"1. Adult\n";

        cout<<"2. Child\n";

        cout<<"Your Choice: ";

        cin>>jenis;

        cout<<endl;


        cout<<"Please Enter The Ticket You Want To Buy Below"<<endl;

        cout<<"= ";

        cin>>jumlah;


        if(jenis==1)

        {

            total_tiket=jumlah*20000;

            jenis_txt="Adult";

        }

        else if(jenis==2)

        {

            total_tiket=jumlah*15000;

            jenis_txt="Child";

        }

        else

        {

            cout<<"Not Available";



        getch();

        goto mulai;

        }

        system("cls");


        cout<<endl;

        cout<<"::::::::>> Welcome to Cinema-TAU <<:::::::\n"<<endl;

        cout<<"Ticket Type: "<<jenis_txt<<endl;

        cout<<"Total Payment: \n"<<jumlah<<" "<<"Person"<<endl;

        cout<<"-------------------------------------------\n";

        cout<<"Bill: Rp. "<<total_tiket<<endl<<endl;

        cout<<"Press Any Key to Continue"<<endl;


        getch();


        break;


        case 2:


        system("cls");


        int kursi_isi[4],kursi_kosong[4];



        cout<<"========Check Remaining Seat=========\n\n";

        cout<<"INSTRUCTION: \n";

        cout<<"\n-Total of seat in every studio is 50 seats\n";

        cout<<"\n-Please enter the number of seat which is will be use\n\n";



        a=0;


        do

        {

            cout<<"CINEMA-TAU"<<" "<<a+1;

            cout<<"= ";

            cin>>kursi_isi[a];

            a++;

        }


        while (a<4);


        for(a=0;a<4;a++)

        {

            kursi_kosong[a]=50-kursi_isi[a];


            system("cls");

        }

        cout<<"========Check Remaining Seat=========\n\n";

        cout<<"\tRemaining Seat\t"<<endl;


        for(a=0;a<4;a++)


        {

            cout<<"STUDIO"<<" "<<a+1<<"= "<<kursi_kosong[a];

            cout<<"-------------\n";

        }

        getch();

        break;


        default:

        cout<<"Not Available\n\n";

        }

        cout<<"Back to Menu? [Y / N]: "<<endl;

        cin>>choice;


        if(choice == 'y')

        {

            goto menu;

        }

        else

        {

            system("cls");


        }


getch();

} 
Default image
Arman Basir
A New Journey. Menyukai hal-hal baru yang menantang dan kompleks untuk di pecahkan

Leave a Reply