Kamis, 23 November 2017

PICK UP BARANG




/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package pelayanan.pickup.barang;

import java.util.Scanner;

/**
 *
 * @author USER
 */
public class PelayananPickupBarang {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
    String namapelanggan,alamat,alamatpengirim,Regular,Khusus,VIP;
     int jarak,berat_barang,berat,layanan;
    
    Scanner input = new Scanner (System.in);
    Scanner nextLine = new Scanner(System.in);
    Scanner nextInt = new Scanner(System.in);
    Scanner sc = new Scanner (System.in);
    int biayaperkg,biayaperkm;
    int biayaberat = 0,biayajarak = 0;
    float biaya_paket = 0;
    float ppn = 0;
    float biayatotal = 0;
    System.out.print("masukan Nama pelanggan :");
    namapelanggan = input.nextLine();
        System.out.print("masukan alamat :");
        alamat = input.nextLine();
        System.out.print("masukan alamat pengiriman :");
        alamatpengirim = input.nextLine();
    
        System.out.print("jarak alamat pengiriman :");
        jarak = input.nextInt();
        System.out.print("berat barang :");
        berat = input.nextInt();
        Scanner baca2 = new Scanner (System.in);
        System.out.println("Pilihan layanan :");
        System.out.println("1.Regular, 2.Khusus, 3.VIP");
        System.out.print("Masukan pilihan layanan:");
        layanan = input.nextInt();
        
       
        switch (layanan){
            case 1:
                biayaperkg = 10000;
                biayaperkm = 20000;
                biayaberat = biayaperkg*berat;
                biayajarak = biayaperkm*jarak;
                biaya_paket = biayaberat+biayajarak;
                ppn = biaya_paket*10/100;
                biayatotal = biaya_paket+ppn;
                break;
            case 2:
                biayaperkg = 20000;
                biayaperkm = 35000;
                biayaberat = biayaperkg*berat;
                biayajarak = biayaperkm*jarak;
                biaya_paket = biayaberat+biayajarak;
                ppn = biaya_paket*10/100;
                biayatotal = biaya_paket+ppn;
                break;
            case 3:
                biayaperkg = 30000;
                biayaperkm = 50000;
                biayaberat = biayaperkg*berat;
                biayajarak = biayaperkm*jarak;
                biaya_paket = biayaberat+biayajarak;
                ppn = biaya_paket*10/100;
                biayatotal = biaya_paket+ppn;
                break;
               
           
               
        }
        System.out.println("========================================");
        System.out.println("nama pelanggan :" +namapelanggan);
        System.out.println("alamat :"+alamat);
        System.out.println("alamat pengirim ;"+alamatpengirim);
        System.out.println("jarak :"+jarak);
        System.out.println("berat :"+berat);
        System.out.println("Total Biaya Kg :"+biayaberat);
        System.out.println("Total Biaya Km :"+biayajarak);
        System.out.println("Total Biaya PPN :"+ppn);
        System.out.println("Biaya Total :"+biayatotal);



        }
   
    }

Tidak ada komentar:

Posting Komentar