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);



        }
   
    }

ARRAY 2 DIMENSI



/*
 * 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 array.pkg2.dimensi;

import java.util.Scanner;

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

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        Scanner nextInt = new Scanner(System.in);
        Scanner nextLine = new Scanner(System.in);
        int[][] nilai = new int[3][3];
    int baris,kolom = 0;
   
    System.out.println("");
    for(baris=0;baris<nilai.length;baris++){
        for(kolom=0;kolom<nilai[baris].length;kolom++){
        Scanner bacaRecord = new Scanner(System.in);
        System.out.print("Input nilai Tabel baris["+baris+"]kolom["+kolom+"]=");
        nilai[baris][kolom]= bacaRecord.nextInt();
        }
    }
   
    System.out.println("\n--------------Hasil nilai------------------");
    for(baris=0;baris<nilai.length;baris++){
        for(kolom=0;kolom<nilai[baris].length;kolom++){
        System.out.print("|"+nilai[baris][kolom]);
    }
   
    System.out.print("|\n");  
    }
    System.out.println("-----------------------------------------");
    }
}