This time I will make a post about how to enter the discount input on an item payment, this time the post continues from my previous post Calculating the Number of Scanner Prices. This post is related to the following question:
1. If the total purchase is more than IDR 50,000, you can get a 5% discount
2. If the total purchase is more than IDR 100,000, you can get a 10% discount
3. If the total purchase is more than IDR 200,000, a 15% discount can be obtained
4. If the number of items purchased from is equal to 50 units, then an additional discount will be obtained as much as 5%
The steps are as follows:
1. Run the NetBeans Application, if you don't have a download here, NB needs a JDK if you don't have it here yet
2. After the application opens, it will appear as shown below and choose NEW PROJECT (Ctrl + Shift + N).
3. After that will appear like the example image below, Select Foleder Java> Java Application> Click Next
After that, specify the LOCATION for storing your project file and TITLE your project then click Finish
4. Write the input "import java.util.Scanner;" under the discount package;
5. Enter the Input just below "// TODO code application logic here" as shown below
int jml, hrg, ttl, discount;
Scanner scan = new Scanner (System.in);
System.out.println ("Input Amount:");
jml = scan.nextInt ();
System.out.println ("Enter Price:");
hrg = scan.nextInt ();
ttl = jml * hrg;
if (ttl> = 200000) {
discount = ttl * 15/100;
ttl = ttl - discount;
System.out.println ("Discount = 15%");
} else if
(ttl> = 100000) {
discount = ttl * 10/100;
ttl = ttl - discount;
System.out.println ("Discount = 10%");
} else if
(ttl> = 50000) {
discount = ttl * 5/100;
ttl = ttl - discount;
System.out.println ("Discount = 5%");
}
if (jml> = 50) {
discount = ttl - ((ttl * 5) / 100);
System.out.println ("Add 5% Discount \ n Total Pay =" + discount);
}
else {
System.out.println ("Total Pay = Rp." + Ttl);
}
8. After that we test by pressing the F6 key on the keyboard (Make sure the input source code is written correctly and there are no errors).
After that we input the numbers on the output tab
Lihat Juga Source Code lainnya dibawah ini :
- Download Source Code Portal Berita berbasis Web PHP & MySQL Siap Pakai
- Source Code Aplikasi Rekam Medis Gigi berbasis Web (PHP Native & MySQL) Siap pakai
- Source Code Pelayanan informasi Puskesmas berbasis Web PHP Codeigniter
- Download Template web Blog Responsive HTML5 Cocok Untuk Anime Google Adsense
- Source Code Toko Onlineshop Busana Muslim Siap pakai + Modifikasi
- Source Code Project Android Ecommerce Native Android Studio Siap Pakai
- Download Source Code Managemen Lelang Berbasis Web Based PHP native Siap Pakai
- Download Source Code Portal Berita berbasis Web PHP & MySQL Siap Pakai
- Source Code Gratis Point of sales Versi Laravel versi 5.6 Schema database Siap pakai
- Source Code terbaru Android Studio All In One Untuk Videos Streaming versi 3.0
- Source Code Gratis Aplikasi Sistem Pengelolaan Informasi Desa Berbasis Web PHP Siap Pakai
- Source Code Sistem PENJUALAN HUTANG PIUTANG BERBASIS PHP & Mysql Siap Pakai
- SOURCE CODE Gratis Aplikasi Management KLINIK & APOTEK Berbasis PHP Siap Pakai
- Source Code Web PHP Native RESERVASI KAMAR HOTEL Versi 2.3 Siap pakai
- Source Code Penilaian Siswa Berbasis Web PHP Framework Codeigniter 3 Siap Pakai
- Source Code Pelayanan informasi Puskesmas berbasis Web PHP Codeigniter
- Donwload Source Code Aplikasi Pengarsipan Surat menggunakan Web Based Codeigniter
- Source Code Siap pakai Management keuangan Menggunakan PHP Mysql versi 3.4