Kamis, 13 September 2018

Membuat Nota Pembayaran + Diskon dengan Program


'Hasil gambar untuk nota


Hallo gays, kemaren banyak nih pertanyaan dan permintaan yang masuk ke gmail aku, kalau misal dalam nota kemarin ( lnk nota pembayaran ) diberi diskon gimana? Nah, dipostingan aku kali ini, aku akan kasih tau, kasih satu program contoh gimana sih bikin nota plus diskon. Langsung aja yuk simak :
import java.io.*;
public class blog
{
                public static void main ( String [] args ) throws IOException
                {
                                System.out.print (" ===================================== ");
                                System.out.print ("       NOTA PEMBAYARAN SEWA KAMAR ");
                                System.out.print (" ===================================== ");

                                BufferedReader br;
                                br = new BufferedReader ( new InputStreamReader ( System.in));
                                String nama, alamat;
                                int kode, harga, lamasewa, sewa, bayar;
                                double diskon;
                                int biaya = 0;
                                                System.out.print (" NAMA PENYEWA    :");
                                                nama = ( br.readLine());
                                                System.out.print (" ALAMAT PENYEWA  :");
                                                alamat = ( br.readLine());
                                                System.out.print ("KODE SPANDUK                        :");
                                                kode = Integer.parseInt ( br.readLine());
                                                switch ( kode )
                                {
                                                case 1 : System.out.println ("JENIS SPANDUK    : MINI ");
                                                                harga = 170000;
                                                                break;
                                                case 2 : System.out.println ("JENIS SPANDUK    : DOUBLE ");
                                                                harga = 310000;
                                                                break;
                                                case 3 : System.out.println ("JENIS SPANDUK    : JUMBO ");
                                                                harga = 550000;
                                                                break;
                                                }
                                                System.out.print (" BIAYA SEWA PER MINGGU                 :" +biaya);
                                                bayar = Integer.parseInt(br.readLine());              
                                                System.out.println (" LAMA SEWA                                          :");
                                                lamasewa = Integer.parseInt(br.readLine());
                                                sewa = biaya*lamasewa;
                                                                if ( lamasewa > 4)
                                                                {
                                                                                diskon = sewa * 10/100;
                                                                }
                                                else
                                                                {
                                                                                diskon = 0;
                                                                }
                                                                                bayar = sewa - diskon;
                                                                System.out.println (" DISKON                                                   :" +diskon);
                                                                System.out.println (" BIAYA TOTAL                                         :" +biaya);
                                                                System.out.println (" BAYAR                                                                     :" +biaya);
}
}

Selamat mencoba semuanya.. Kalau ada masalah silahkan komen di bawah yaa... J

0 komentar:

Posting Komentar