Full width home advertisement

Travel the world

Climb the mountains

Post Page Advertisement [Top]

Program Aplikasi Market Sederhana menggunakan bahasa C++

Program Aplikasi Market Sederhana menggunakan bahasa C++

Assalamu’alaikum
Hallo Pamoeda Coding!!,
Apa kabar sahabat Coding ? pasti baik dong, dan pasti udah siap nih buat nyimak mengenai source code yang akan saya share di blog ini ya.., okke tanpa basa basi langsung ke topik pembahasan lanjutken!! (bahasa sunda).
Oke pada kesempatan yang amat santai ini saya akan share ke teman-teman Pamoeda Coding tentang Program market sederhana, yang dimana di dalam program tersebut kita akan di sediakan menu-menu pilihan mengenai barang-barang apa saja yang di jual dan nantinya kita akan memilihnya dengan menginputkan kode yang tertera di menu tersebut.
Berikut ini adalah Source Code C++ nya silahkan diamati, dipelajari dan dijalankan ya teman Pamoeda Coding.
Source Code C++ :
/*
            program market
            nama pelanggan :
            kode Barang :
            discount :
            harga :
            di bayar :
            kembalian :

*/

#include <iostream>

using namespace std;


char namaP[20], ulang;
int kodeB,harga,harga1,bayar,kembalian,disc;
main (){
           
cout<<endl<<endl;
cout << "\t\t SELAMAT DATANG DI NAMA TOKO KALIAN :)\n";
cout << "\t ===================================================\n\n";
cout << "\t Nama Pelanggan : "; cin >> namaP;
cout <<endl<<endl;
cout << "\t   kode Barang      Barang\n";
cout << "\t ______________________________\n";
cout << "\t      1.         Indomie Soto\n";
cout << "\t      2.         Teh Botol Sosro\n";
cout << "\t      3.         Tanggo\n";
cout << "\t      4.         Sari Roti Cokelat\n";
            pilih :
            cout << "\t Kode Barang : "; cin >> kodeB;
                        switch(kodeB){
                         case 1 :
                                    cout << "\t Indomie Soto\n";
                                    cout << "\t Harga : 2500\n";
                                    harga1 = 2500;
                                    disc = harga1/100*5;
                                    harga = 2500 - disc;
                                    cout << "\t Disc. : 5% \n";
                                    cout << "\t Harga Disc. : "<<harga;
                                    lagi1 :
                                    cout << "\t Di Bayar : "; cin >> bayar;
                                    kembalian = bayar-harga;
                                                if(bayar<harga){
                                                            cout << "\t Maaf Uang Anda Kurang"<<endl;
                                                            goto lagi1;
                                                 }else {
                                                            cout << "\t Kembalian Anda : "<<kembalian<<endl;
                                                            cout << "\t Terimakasih Sudah Berkunjung :)"<<endl;
                                                 }
                                    break;                                     
                         case 2 :
                                    cout << "\t Teh Botol Sosro \n";
                                    cout << "\t Harga : 4500 \n";
                                    harga1 = 4500;
                                    disc = 4500/100*10;
                                    harga = 4500 - disc;
                                    cout << "\t Disc. : 10% \n";
                                    cout << "\t Harga Disc. : "<<harga;
                                    lagi2 :
                                    cout << "\t Di Bayar : "; cin >> bayar;
                                    kembalian = bayar-harga;
                                                if(bayar<harga){
                                                            cout << "\t Maaf Uang Anda Kurang"<<endl;
                                                            goto lagi2;
                                                 }else {
                                                            cout << "\t Kembalian Anda : "<<kembalian<<endl;
                                                            cout << "\t Terimakasih Sudah Berkunjung :)"<<endl;
                                                 }
                                    break;
                         case 3 :
                                                cout << "\t Tanggo \n";
                                                cout << "\t Harga : 12000 \n";
                                                harga1 = 12000;
                                                disc = 12000/100*9;
                                                harga = 12000 - disc;
                                                cout << "\t Disc. : 9% \n";
                                                cout << "\t Harga Disc. : "<<harga;
                                                lagi3 :
                                                cout << "\t Di Bayar : "; cin >> bayar;
                                                kembalian = bayar-harga;
                                                            if(bayar<harga){
                                                                        cout << "\t Maaf Uang Anda Kurang"<<endl;
                                                                        goto lagi3;
                                                             }else {
                                                                        cout << "\t Kembalian Anda : "<<kembalian<<endl;
                                                                        cout << "\t Terimakasih Sudah Berkunjung :)"<<endl;
                                                             }
                                    break;
                         case 4 :
                                                cout << "\t Sari Roti cokelat \n";
                                                cout << "\t Harga : 6000\n";
                                                harga1 = 6000;
                                                disc = 6000/100*5;
                                                harga = 6000 - disc;
                                                cout << "\t Disc. : 5% \n";
                                                cout << "\t Harga Disc. : "<<harga;
                                                lagi4 :
                                                cout << "\t Di Bayar : "; cin >> bayar;
                                                kembalian = bayar-harga;
                                                            if(bayar<harga){
                                                                        cout << "\t Maaf Uang Anda Kurang"<<endl;
                                                                        goto lagi4;
                                                             }else {
                                                                        cout << "\t Kembalian Anda : "<<kembalian<<endl;
                                                                        cout << "\t Terimakasih Sudah Berkunjung :)"<<endl;
                                                             }         
                                                break;
                                                            default :
                                                {
                                                            cout << "\t Kode Yang anda Masukan Belum Tersedia"<<endl;
                                                }                                 
                                                                       
                        }
           
                        cout << "\t Mau Belanja Lagi (Y/N) : "; cin >> ulang;
                                                if(ulang == 'y'||ulang =='Y'){
                                                            goto pilih;
                                                }else if(ulang == 'n'||ulang =='N'){
                                                            system("cls");
                                                            cout << endl << endl << endl;                                                        
                                                            cout << "\tTerimakasih " << namaP << " Telah Berbelanja di Toko NAMA TOKO KALIAN"<<endl;
                                                            cout << "\n\n\t\t       Berikut Struk Pembelian\n";
                                                            cout << "\t\t-----------------------------------------\n";
                                                            cout << "\t\t  Nama Pelanggan        : "<<namaP<<endl;
                                                            cout << "\t\t  Kode Barang                : "<<kodeB<<endl;
                                                            cout << "\t\t  Harga                          : "<<harga1<<endl;
                                                            cout << "\t\t  Diskon               : "<<disc<<endl;
                                                            cout << "\t\t  Harga disc                   : "<<harga<<endl;
                                                            cout << "\t\t  Di bayar                      : "<<bayar<<endl;
                                                            cout << "\t\t  Kembalian                   : "<<kembalian<<endl;
                                                            cout << "\t\t========================================="<<endl;
                                                           
                                                           
                                                }
           
            cin.get();
            return 0;
}
Oke Sekian dan terimakasih, semoga bisa bermanfaat ya teman Pamoeda Coding, Salam Pamoeda Coding

Wassalamu’alaikum






1 komentar:

  1. Sangat bagus sekali, bermanfaat semoga makin berkembang ya min

    BalasHapus

Bottom Ad [Post Page]