Program C++ Program Kasir Toko Buku

Assalamu'alaikum wr.wb.

Kali ini saya akan membagikan PROGRAM C++ tentang PROGRAM KASIR TOKO BUKU, disini saya menggunakan software Dev C++, Ini merupakan Contoh tugas PEMROGRAMAN TERINSTRUKTUR. Cekidot.

Program C++ tentang Program Kasir


PROGRAM C++ KASIR TOKO BUKU


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

using namespace std;
int main(){
int i;
                char nol, satu, dua, ch, pass;
                int kode;
long int y, t, hb,jb, diskon,bayar,kembalian,total_hrg_buku, harga_buku, total_pembayaran;

cout<<"I============================================================================I"<<endl;
cout<<"I PROGRAM KASIR I"<<endl;
cout<<"I I"<<endl;
cout<<"I Nama/NPM : Risman Hanafi/1717051036 I"<<endl;
cout<<"I : Agneta I"<<endl;
    cout<<"I : Yenny I"<<endl;
cout<<"I Kelas : B I"<<endl;
cout<<"I I"<<endl;
cout<<"I============================================================================I"<<endl;
cout<<"I============================================================================I"<<endl;
cout<<"I SELAMAT DATANG DI FORM LOGIN I"<<endl;
cout<<"I============================================================================I"<<endl;
for (i=1;i<=3;i++){
                    string user ="";
                    string ch ="";
                    cout<<"Username :";cin>>user;
                    cout<<"Passsword :";cin>>ch;
                    pass=_getch();
                    while(pass!=13){
                    ch.push_back(pass);
                    cout<<"*";
                    pass=_getch();
                }
                if (user=="rismanhanafi"&&ch=="12345"){
                    cout<<"Anda berhasil login"<<endl;
                    if (ch=="12345");
                        system("cls");
                        goto nol;
                }
                else{
                    cout<<"Maaf username / Password yang anda masukan salah"<<endl;
                }
                }
                    while (i<=3);
                    cout<<" Anda telah 3x salah memasukan username atau password "<<endl;
                    cout<<"Mohon maaf akun anda kami blokir sementara"<<endl;
                    cout<<"Silahkan hubungi operator penyedia layanan, Terima kasih.."<<endl;
                    getch();
                    return 0;           
nol:
cout<<"Buku jenis apa yang ingin anda beli ?"<<endl;
cout<<"1. Buku novel"<<endl;
cout<<"2. Buku komik"<<endl;
cout<<"Masukan kode angka :";
cin>>kode;
system("cls");
switch (kode) {

case 1:
cout<<"BUKU NOVEL :"<<endl;
cout<<"1. Ketika cinta bertasbih "<<endl;
cout<<endl;
cout<<"Harga Buku novel : Rp.";
cin>>hb;
cout<<"Jumlah buku yang dibeli : ";
cin>>jb;
cout<<"Total harga buku novel= Rp."<<hb*jb<<endl;
cout<<endl;
{                           
if(jb>=10&&jb<15)
{
diskon=hb*5/100;
total_hrg_buku=harga_buku-diskon;
cout<<endl;
cout<<"Total pembayaran buku novel = "<<hb<<"* 5% = Rp."<<total_hrg_buku<<endl;
}
else if(jb>=15)
{
diskon=hb*10/100;
total_hrg_buku=hb-diskon;
cout<<endl;
cout<<"Total pembayaran buku novel = "<<hb<<"* 10% = Rp."<<total_hrg_buku<<endl;
}
else
{
total_hrg_buku=hb;
cout<<endl;
cout<<"Total pembayaran buku novel= Rp."<<total_hrg_buku<<endl;;
cout<<"Pembelian ini tidak mendapatkan diskon"<<endl;
}
                cout<<"===================================================="<<endl;
}
break;

case 2:
cout<<"BUKU KOMIK :"<<endl;
cout<<"1. Naruto shipuden"<<endl;
cout<<"================================================"<<endl;
cout<<endl;
cout<<"harga buku komik : Rp.";
cin>>hb;
cout<<"jumlah pembelian buku komik : ";
cin>>jb;
cout<<"Total harga buku komik : Rp."<<hb*jb<<endl;
cout<<endl;
{
if(jb>=10&&jb<=15)
{
diskon=hb*5/100;
total_hrg_buku=hb-diskon;
cout<<endl;
cout<<"Total pembayaran buku komik = "<<hb<<"* 5% = Rp."<<total_hrg_buku<<endl;
}
else if(jb>=15)
{
diskon=hb*10/100;
total_hrg_buku=hb-diskon;
cout<<endl;
cout<<"Total pembayaran buku komik = "<<hb<<"* 10% = Rp."<<total_hrg_buku<<endl;
}
else
{

total_hrg_buku>=hb;
cout<<endl;
cout<<"Total pembayaran buku komik = Rp."<<total_hrg_buku<<endl;
cout<<"Pembelian ini tidak mendapatkan diskon"<<endl;
}
cout<<"===================================================="<<endl;
break;
end:
{cout<<"Terima kasih sudah berbelanja di toko kami"<<endl;
return 0;
default:cout<<"Maaf kode yang anda masukan salah "<<endl;
        cout<<"Silahkan masukan ulang kode buku :";
        cin>>kode;
        system("cls");
        if (kode) goto nol;
}
}
return 0;
}



Demikian Artikel ini saya buat semoga bermanfaat bagi para calon PROGRAMER. Jangan lupa terus kunjungi indoceplus.bogspot.com untuk mendapatkan program C++ terbaru. Bila ada pertanyaan ataupun request program silahkan tanyakan pada kolom komentar.
Terima kasih sudah berkunjung.
Wassalamu'alaikum.wr.wb.

Subscribe to receive free email updates:

1 Response to "Program C++ Program Kasir Toko Buku"