Responsive Ads Here

Sabtu, 04 November 2017

Program Sederhan Transaksi Penjualan Toko Komputer dengan Java NetBeans

Assalamu'alaikum wr. wb.
Hai sahabat bloger sekalian, kali ini saya akan membahas tentang "Contoh Program atau Aplikasi Sederhana Transaksi Penjualan Komputer menggunakan Java NetBeans".  kegunaan program ini untuk memudahkan konsumen/kasir memilih Item barang serta mengetahui jumlah total yang harus di bayar. Cek it dot...

Komponen pada Program ini ;
  • Konsumen / Kasir
  • Item Barang dan Uang / Jumlah Pembayaran
Formula / Penghitungan ;
  • Total Paket = Harga Paket*Qty
  • Total Custom = Total Proci+Total RAM+Total VGA+Total HDD
  • Total Aksesoris = Total Mouse+Total KeyBoard+Total Headset
  • Tagihan = Total Paket+Total Custom+Total Aksesoris
  • Kembalian = Uang Cash-Tagihan
Step-step pada program ini yaitu;
  • Menawarkan Apakan ingin Paket Gaming ?
  1. Jika "ya" maka Daftar Paket yang tersedia akan muncul.
  2. masukan nomor paket yang di inginkan serta banyaknya.
  3. lalu akan muncul paket yang dipilih dan harga satuannya.
  4. Total pembelian Paket.
  5. jika "tidak" maka ke-step selanjutnya.
  • Menawarkan Apakah konsumen ingin Custom?
  1. Jika "ya" maka Daftar Item Custom yang tersedia akan muncul, yaitu Proceccor, RAM, VGA, dan HDD. 
  2. masukan nomor yang di inginkan serta banyaknya item.
  3. kemudian akan muncul item yang dipilih dan harga satuannya
  4. Total dari masing-masing item dan Total Pembelian Custom.
  5. Jika "tidak" maka ke proses selanjutnya.
  • Menawarkan Apakah ingin Membeli Aksesoris Gaming ?
  1. Jika "ya" maka akan muncul Daftar Item. Item yang tersedia Mouse, KeyBoard dan HeadSet.
  2. Masukan pilihan nomer barang dan banyaknya item
  3. Maka akan muncul Item yang di pilih dan harga satuannya.
  4. Lalu Total harga Item-item akan muncul serta Total pembelian Aksesoris Gaming.
  5. Jika "tidak", maka langsung ke-proses penghitungan Taggihan
  • Penghitungan Tagihan
  1. Total Paket yang dibeli, Total Custom yang dipilih, dan Total Item Aksesoris.
  2. Lalu Total Keseluruhan akan muncul
  3. Masukan Uang Tunai konsumen
  4. setelah dikalkulasikan maka akan muncul sisa Uang konsumen, Jika kurang akan muncul Uang anda kurang sejumlah sisa Tagihan. jika cukup atau lebih maka akan muncul Uang kembalian dan Ucapan "TERIMA KASIH"

FlowChart (Alur Transaksi)

Source Code


import java.util.*;import java.text.*;
public class Gaming_HardWare { public static void main(String[] args){
//menampilkan tanggal dari komputer        Date Tanggal=new Date(); SimpleDateFormat tgl; tgl=new SimpleDateFormat("E, dd/MMM/yy hh:mm:ss a");
//Deklarasi Variabel         int Paket=0, Proci=0, RAM=0, VGA=0, HDD=0, Mouse=0, KeyBoard=0, HeadSet; int p1=3000000, p2=8000000, p3=15000000; //harga Paket Gaming         int i3=1000000, i5=2000000, i7=3000000; //Harga Proceccor int r2=250000, r4=450000, r8=8000000, r16=1500000;//Harga RAM int v1=500000, v2=750000, v4=1000000; //Harga VGA int h320=350000, h500=500000, h1000=900000, h2000=1500000; //Harga HDD int m1=1000000, m2=2000000, m3=2000000, m4=1000000, m5=1250000, m6=1320000,             m7=2000000, m8=1500000, m9=2150000, m10=1250000; //Harga Mouse int k1=1900000, k2=2500000, k3=1600000, k4=2800000, k5=2600000, k6=1400000,              k7=900000, k8=650000, k9=100000, k10=160000; //Harga Keyboard        int h1=470000, h2=425000, h3=390000, h4=360000, h5=295000, h6=265000, h7=230000,              h8=210000, h9=200000, h10=155000; //Harga HeadSet //Banyak Item int Qty=0, QtyP=0, QtyPr=0, QtyR=0, QtyV=0, QtyH=0, QtyM=0, QtyK=0, QtyHS=0;  int TP=0, TPr=0, TR=0, TV=0, TH=0, TM=0, TK=0, THS=0; //Total Item        int TotalPaket=0, TotalCustom=0, TotalAcc=0; String paket1="Ci3/RAM4GB/VGA2GB/HDD500GB",                    paket2="Ci5/RAM8GB/VGA2GB/HDD1TB",                    paket3="Ci7/RAM16GB/VGA4GB/HDD1TB";        //Input Data / Pilihan Scanner input=new Scanner(System.in);
//Display awal System.out.println("=========================================="); System.out.println("              -[GamingWare]-              "); System.out.println("\t "+tgl.format(Tanggal)); System.out.println("=========================================="); System.out.println("       Apakah Agan Ingin Paket Gaming?    "); System.out.println("=========================================="); System.out.print("\t\t Ya / Tidak : "); String Pilih=input.next(); //input penawaran System.out.println("=========================================="); if ( Pilih.equals("Y")||Pilih.equals("y")){ System.out.println("     Pilih Paket Gaming yang tersedia     "); System.out.println("=========================================="); System.out.println("1. Ci3/RAM4GB/VGA2GB/HDD500GB        3 Jt "); System.out.println("2. Ci5/RAM8GB/VGA2GB/HDD1TB          8 Jt "); System.out.println("3. Ci7/RAM16GB/VGA4GB/HDD1TB        15 Jt "); System.out.println("=========================================="); System.out.print("Pilih Paket : "); Paket=input.nextInt(); switch (Paket){ case 1 :System.out.print("Berapa banyak : "); Qty=input.nextInt(); TP=p1*Qty; System.out.println("\nPaket1 "+paket1+" Rp."+p1); break; case 2 :System.out.print("Berapa banyak : "); Qty=input.nextInt(); TP=p2*Qty; System.out.println("\nPaket2 "+paket2+" Rp."+p2); break; case 3 :System.out.print("Berapa banyak : "); Qty=input.nextInt(); TP=p3*Qty; System.out.println("\nPaket3 "+paket3+" Rp."+p3); break; default :System.out.println("Tidak Ada Paket"); break; } System.out.println("Total Paket = Rp."+TP); }else{System.out.println("             Paket tidak ada             ");}
System.out.println("=========================================="); System.out.println("        Apakah Agan Ingin Custom ?        "); System.out.println("=========================================="); System.out.print("\t\t Ya / Tidak : "); String Custom = input.next(); System.out.println("=========================================="); if ( Custom.equals("Y")||Custom.equals("y")){ System.out.println("Pilihan Custom yang Agan inginkan"); System.out.println("=========================================="); System.out.println("1. Corei3                             1 Jt"); System.out.println("2. Corei5                             2 Jt"); System.out.println("3. Corei7                             3 Jt"); System.out.println("=========================================="); System.out.print("Pilih Proceccor : "); Proci=input.nextInt();                switch (Proci){ case 1 :System.out.print("Berapa banyak : "); QtyPr=input.nextInt(); TPr=i3*QtyPr; System.out.println("\nProceccor Corei3 @ Rp."+i3); break; case 2 :System.out.print("Berapa banyak : "); QtyPr=input.nextInt(); System.out.println("\nProceccor Corei5 @ Rp."+i5); TPr=i5*QtyPr; break; case 3 :System.out.print("Berapa banyak : "); QtyPr=input.nextInt(); System.out.println("\nProceccor Corei7 @ Rp."+i7); TPr=i7*QtyPr; break; default :System.out.println("Proceccor tidak ada"); break; }System.out.println("Total Proceccor = Rp."+TPr); System.out.println("=========================================="); System.out.println("1. 2GB                               250 K"); System.out.println("2. 4GB                               450 K"); System.out.println("3. 8GB                               800 K"); System.out.println("4. 16GB                              1,5 Jt"); System.out.println("=========================================="); System.out.print("Pilih RAM : "); RAM=input.nextInt(); switch (RAM){ case 1 :System.out.print("Berapa banyak : "); QtyR=input.nextInt(); System.out.println("RAM 2GB @ Rp."+r2); TR=r2*QtyR; break; case 2 :System.out.print("Berapa banyak : "); QtyR=input.nextInt(); System.out.println("RAM 4GB @ Rp."+r4); TR = r4*QtyR; break; case 3 :System.out.print("Berapa banyak : "); QtyR=input.nextInt(); System.out.println("RAM 8GB @ Rp."+r8); TR = r8*QtyR; break; case 4 :System.out.print("Berapa banyak : "); QtyR=input.nextInt(); System.out.println("RAM 16GB @ Rp."+r16); TR = r16*QtyR; break; default :System.out.println("RAM tidak ada"); break; }System.out.println("Total RAM = Rp."+TR); System.out.println("=========================================="); System.out.println("1. VGA 1GB                           500 K"); System.out.println("2. VGA 2GB                           750 K"); System.out.println("3. VGA 4GB                             1 Jt"); System.out.println("=========================================="); System.out.print("Pilih VGA : "); VGA=input.nextInt(); switch (VGA){ case 1 :System.out.print("Berapa banyak : "); QtyV=input.nextInt(); System.out.println("VGA 1GB @ Rp."+v1); TV= v1*QtyV; break; case 2 :System.out.print("Berapa banyak : "); QtyV=input.nextInt(); System.out.println("VGA 2GB @ Rp."+v2); TV= v2*QtyV; break; case 3 :System.out.print("Berapa banyak : "); QtyV=input.nextInt(); System.out.println("VGA 4GB @ Rp."+v4); TV= v4*QtyV; break; default :System.out.println("VGA tidak ada"); break;}System.out.println("Total VGA = Rp."+TV); System.out.println("=========================================="); System.out.println("1. HDD 320GB                   350 K"); System.out.println("2. 500GB                       500 K"); System.out.println("3. 1TB                         900 K"); System.out.println("4. 2TB                         1,5 Jt"); System.out.println("=========================================="); System.out.print("Pilih HDD : "); HDD=input.nextInt(); switch (HDD){ case 1 :System.out.print("Berapa banyak : "); QtyH=input.nextInt(); System.out.println("HDD 320GB @ Rp."+h320); TH= h320*QtyH; break; case 2 :System.out.print("Berapa banyak : "); QtyH=input.nextInt(); System.out.println("HDD 500GB @ Rp."+h500); TH= h500*QtyH; break; case 3 :System.out.print("Berapa banyak : "); QtyH=input.nextInt(); System.out.println("HDD 1TB @ Rp."+h1000); TH= h1000*QtyH; break; case 4 :System.out.print("Berapa banyak : "); QtyH=input.nextInt(); System.out.println("HDD 2TB @ Rp."+h2000); TH= h2000*QtyH; break; default :System.out.println("HDD Tidak ada"); break;} System.out.println("Total Rp."+TH); //Total Hasil Item Custom TotalCustom=TPr+TR+TV+TH; System.out.println("=========================================="); System.out.println("             Total Custom Agan            "); System.out.println("Proceccor        "+QtyPr+" = Rp."+TPr); System.out.println("RAM              "+QtyR+" = Rp."+TR); System.out.println("VGA              "+QtyV+" = Rp."+TV); System.out.println("HDD              "+QtyH+" = Rp."+TH); System.out.println("TOTAL              = Rp."+TotalCustom); System.out.println("=========================================="); }else{System.out.println("         Agan Tidak ingin Custom          ");                      System.out.println("==========================================");}         System.out.println("   Apakah Agan Ingin Membeli Item Lain ?  ");        System.out.println("=========================================="); System.out.print("\t\t Ya / Tidak : "); String Acc = input.next();        if ( Acc.equals("Y")||Acc.equals("y")){ System.out.println("                   MOUSE                  "); System.out.println("=========================================="); System.out.println("1 .Madcatz R.A.T.5               1 Jt "); System.out.println("2 .Madcatz M.M.O.7               2 Jt "); System.out.println("3 .Madcatz R.A.T 9               2 Jt "); System.out.println("4 .LOGITECH G502                 1 Jt "); System.out.println("5 .Razer Taipan               1,25 Jt "); System.out.println("6 .Razer Diamondback Chroma   1,32 Jt "); System.out.println("7 .Razer Naga Epic Chroma        2 Jt "); System.out.println("8 .Razer Ouroboros             1,5 Jt "); System.out.println("9 .Razer Mamba Chroma         2,15 Jt "); System.out.println("10.ROCCAT Kone Pure           1,2 5Jt "); System.out.println("=========================================="); System.out.print("Pilih Mouse : "); Mouse=input.nextInt(); switch (Mouse){ case 1 :System.out.print("Berapa banyak : "); QtyM=input.nextInt(); System.out.println("Mouse Madcatz R.A.T.5 @ Rp."+m1); TM= m1*QtyM; break; case 2 :System.out.print("Berapa banyak : "); QtyM=input.nextInt(); System.out.println("Mouse Madcatz M.M.O.7 @ Rp."+m2); TM= m2*QtyM; break; case 3 :System.out.print("Berapa banyak : "); QtyM=input.nextInt(); System.out.println("Mouse Madcatz R.A.T 9 @ Rp."+m3); TM= m3*QtyM; break; case 4 :System.out.print("Berapa banyak : "); QtyM=input.nextInt(); System.out.println("Mouse LOGITECH G502 @ Rp."+m4); TM= m4*QtyM; break; case 5 :System.out.print("Berapa banyak : "); QtyM=input.nextInt(); System.out.println("Mouse Razer Taipan @ Rp."+m5); TM= m5*QtyM; break; case 6 :System.out.print("Berapa banyak : "); QtyM=input.nextInt(); System.out.println("Mouse Razer Diamondback Chroma @ Rp."+m6); TM= m6*QtyM; break; case 7 :System.out.print("Berapa banyak : "); QtyM=input.nextInt(); System.out.println("Mouse Razer Naga Epic Chroma @ Rp."+m7); TM= m7*QtyM; break; case 8 :System.out.print("Berapa banyak : "); QtyM=input.nextInt(); System.out.println("Mouse Razer Ouroboros @ Rp."+m8); TM= m8*QtyM; break; case 9 :System.out.print("Berapa banyak : "); QtyM=input.nextInt(); System.out.println("Mouse Razer Mamba Chroma @ Rp."+m9); TM= m9*QtyM; break; case 10:System.out.print("Berapa banyak : "); QtyM=input.nextInt(); System.out.println("Mouse ROCCAT Kone Pure @ Rp."+m10); TM= m10*QtyM; break; default :System.out.println("Mouse tidak ada"); break;} System.out.println("Total Rp."+TM); System.out.println("                 KeyBoard                 "); System.out.println("=========================================="); System.out.println("1. MSideWinder X6                   1,9 jt"); System.out.println("2. Logitech G910 Orion Spark        2,5 jt"); System.out.println("3. Razer Anasi                      1,6 jt"); System.out.println("4. Corsair Vengeance K70RGB         2,8 jt"); System.out.println("5. Razer Black Widow Chroma         2,6 jt"); System.out.println("6. Logitech Wireless Illuminated    1,4 jt"); System.out.println("7. CM Storm QuickFire Rapid         900 K"); System.out.println("8. Microsoft ARC                    650 K"); System.out.println("9. HAVIT HV-K513CM                  100 K"); System.out.println("10.PUWEI                            160 K"); System.out.println("=========================================="); System.out.print("Pilih Keyboard : "); KeyBoard=input.nextInt(); switch (KeyBoard){ case 1 :System.out.print("Berapa banyak : "); QtyK=input.nextInt(); System.out.println("Keyboard MSideWinder X6 @ Rp."+k1); TK=QtyK*k1; break; case 2 :System.out.print("Berapa banyak : "); QtyK=input.nextInt(); System.out.println("KeyBoard Logitech G910 Orion Spark @ Rp."+k2); TK=QtyK*k2; break; case 3 :System.out.print("Berapa banyak : "); QtyK=input.nextInt(); System.out.println("Keyboard Razer Anasi @ Rp."+k3); TK=QtyK*k3; break; case 4 :System.out.print("Berapa banyak : "); QtyK=input.nextInt(); System.out.println("KeyBoard Corsair Vengeance K70RGB @ Rp."+k4); TK=QtyK*k4; break; case 5 :System.out.print("Berapa banyak : "); QtyK=input.nextInt(); System.out.println("Keyboard Razer Black Widow Chroma @ Rp."+k5); TK=QtyK*k5; break; case 6 :System.out.print("Berapa banyak : "); QtyK=input.nextInt(); System.out.println("KeyBoard Logitech Wireless Illuminated @ Rp."+k6); TK=QtyK*k6; break; case 7 :System.out.print("Berapa banyak : "); QtyK=input.nextInt(); System.out.println("Keyboard CM Storm QuickFire Rapid @ Rp."+k7); TK=QtyK*k7; break; case 8 :System.out.print("Berapa banyak : "); QtyK=input.nextInt(); System.out.println("KeyBoard Microsoft ARC @ Rp."+k7); TK=QtyK*k7; break; case 9 :System.out.print("Berapa banyak : "); QtyK=input.nextInt(); System.out.println("Keyboard HAVIT HV-K513CM @ Rp."+k9); TK=QtyK*k9; break; case 10 :System.out.print("Berapa banyak : "); QtyK=input.nextInt(); System.out.println("KeyBoard PUWEI @ Rp."+k10); TK=QtyK*k10; break; default :System.out.println("Keyboar tidak ada"); break;} System.out.println("Total Rp."+TK); System.out.println("HeadSet"); System.out.println("=========================================="); System.out.println("1. TT eSport Shock by Thermaltake    470 K"); System.out.println("2. FoxXray Glare 3D                  425 K"); System.out.println("3. DragonWar BEAST                   390 K"); System.out.println("4. Sades SA-903                      360 K"); System.out.println("5. Armaggeddon Molotov 3             295 K"); System.out.println("6. Armaggeddon Headset Pulse 5       265 K"); System.out.println("7. I-Rocks                           230 K"); System.out.println("8. Sonicgear Vibra 5                 210 K"); System.out.println("9. E-Blue Cobra                      200 K"); System.out.println("10.Warwolf R3                        155 K"); System.out.println("=========================================="); System.out.print("Pilih HeadSet : "); HeadSet=input.nextInt(); switch (HeadSet){ case 1 :System.out.print("Berapa banyak : "); QtyHS=input.nextInt(); System.out.println("TT eSport Shock by Thermaltake @ Rp."+h1); THS=QtyHS*h1; break; case 2 :System.out.print("Berapa banyak : "); QtyHS=input.nextInt(); System.out.println("FoxXray Glare 3D @ Rp."+h2); THS=QtyHS*h2; break; case 3 :System.out.print("Berapa banyak : "); QtyHS=input.nextInt(); System.out.println("DragonWar BEAST @ Rp."+h3); THS=QtyHS*h3; break; case 4 :System.out.print("Berapa banyak : "); QtyHS=input.nextInt(); System.out.println("Sades SA-903 @ Rp."+h4); THS=QtyHS*h4; break; case 5 :System.out.print("Berapa banyak : "); QtyHS=input.nextInt(); System.out.println("Armaggeddon Molotov 3 @ Rp."+h5); THS=QtyHS*h5; break; case 6 :System.out.print("Berapa banyak : "); QtyHS=input.nextInt(); System.out.println("Armaggeddon Headset Pulse 5 @ Rp."+h6); THS=QtyHS*h6; break; case 7 :System.out.print("Berapa banyak : "); QtyHS=input.nextInt(); System.out.println("I-Rocks @ Rp."+h7); THS=QtyHS*h7; break; case 8 :System.out.print("Berapa banyak : "); QtyHS=input.nextInt(); System.out.println("Sonicgear Vibra 5 @ Rp."+h8); THS=QtyHS*h8; break; case 9 :System.out.print("Berapa banyak : "); QtyHS=input.nextInt(); System.out.println("E-Blue Cobra @ Rp."+h9); THS=QtyHS*h9; break; case 10 :System.out.print("Berapa banyak : "); QtyHS=input.nextInt(); System.out.println("Warwolf R3 @ Rp."+h10); THS=QtyHS*h10; break; default :System.out.println("HeadSet tidak ada"); break;} System.out.println("Total Rp."+THS); TotalAcc=TM+TK+THS; System.out.println("=========================================="); System.out.println("              Total Aksesoris             "); System.out.println("Mouse            "+QtyM+" = Rp."+TM); System.out.println("KeyBoard         "+QtyK+" = Rp."+TK); System.out.println("HeadSet          "+QtyHS+" = Rp."+THS); System.out.println("TOTAL              = Rp."+TotalAcc); System.out.println("=========================================="); }else{System.out.println("       Tidak Ada Item yang di pilih       ");                      System.out.println("==========================================");}
int Total=TP+TotalCustom+TotalAcc;                                System.out.println("            Total Belanja Agan            "); System.out.println("=========================================="); System.out.println("Paket Gaming Agan       = Rp."+TP); System.out.println("Custom Agan             = Rp."+TotalCustom); System.out.println("Aksesori Gaming         = Rp."+TotalAcc); System.out.println("=========================================="); System.out.println("Tagihan                 = Rp."+Total); System.out.print  ("Tunai                   = Rp."); int Cash=input.nextInt(), kembali=(Cash-Total); if (Cash<=Total){ System.out.println("Uang Agan Kurang        = Rp."+(Cash-Total)); }else if(Cash>=Total){ System.out.println("=========================================="); System.out.println("Kembalian Agan          = Rp."+kembali);                        System.out.println("=========================================="); System.out.println("               TERIMAKASIH               ");} System.out.println("=========================================="); }}

Tampilan Tidak Ada Tranaksi

Tampilan Hasil Tranaksi



Tidak ada komentar:

Posting Komentar