Rabu, 24 Mei 2017

array 2 dimensi


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

import java.util.Scanner;

/**
 *
 * @author rachmad r.
 */
public class JavaArrai2dimesi1 {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

String[][] array = new String[4][4];
int cek;
        @SuppressWarnings("UnusedAssignment")
String bintang = "";
for(int i=0;i<array.length;i++){
for(int j=0;j<array.length;j++){
System.out.print("Input Angka baris["+i+"]"+" kolom["+j+"]= ");
array[i][j] = scan.next();
}
System.out.println("\n");
}
                System.out.println("\n");
                System.out.println("Hasil Nilai Inputan");
    for (String[] array1 : array) {
        for (int j = 0; j<array.length; j++) {
            System.out.print("|" + array1[j] + "|");
            bintang = array1[j];
            cek = bintang.indexOf("4");
            array1[j] = cek>=0 ? "**" : array1[j];
        }
        System.out.println("");
    }
                System.out.println("------------------------------------");
                System.out.println("");
                System.out.println("Hasil Nilai Berubah");
    for (String[] array1 : array) {
        for (int j = 0; j<array.length; j++) {
            System.out.print("|" + array1[j] + "|");
        }
        System.out.println();
    }
}
}

Hasil Nilai Inputan
|1||2||3||4|
|1||2||3||4|
|1||2||1||2|
|1||2||1||1|
------------------------------------

Hasil Nilai Berubah
|1||2||3||**|
|1||2||3||**|
|1||2||1||2|
|1||2||1||1|

BUILD SUCCESSFUL (total time: 19 minutes 22 seconds)


Rachmad ramadhan
1655201084
Teknik Informatika S1

Sabtu, 06 Mei 2017

project 4

Gaji karyawan

Ketentuan :



- User menginput data Karyawan (Nama, Nik, Bagian)
- User menginput golongan karyawan (A/B/C)
- User menginput jumlah hari masuk
- System menampilkan => Data Karyawan
                                             Tunjangan Transport
                                             Gaji Pokok
                                             Potongan Asuransi
                                             Total Gaji

- Uang Transport 25.000/hari
 

- Tunjangan Trasnport = jumlah hari masuk*uang transport per hari
- Gaji Pokok :  Golongan A
                         Gaji pokok = 3.000.000
                         Potongan asuransi =5% dari gaji pokok
                         Golongan B
                         Gaji pokok = 2.500.000
                         Potongan asuransi =3% dari gaji pokok
                         Golongan C
                         Gaji pokok = 2.000.000
- Total Gaji = gaji pokok + tunjangan transport


SOURCE CODE
 
/*
 * 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 gaji.karyawan.rahmat;

/**
 *
 * @author Rachmad R.
 */
import java.util.Scanner;
public class Gajikaryawanrahmat {

    public static void main(String[] args) {
Scanner input = new Scanner (System.in);
       
        String nama,nik,bagian;
        int golongan,hari,potongan,gapok,transport,total,gaji;
             
        System.out.println ("GAJI KARYAWAN");
        System.out.println (" ");
        System.out.print ("Masukkan Nama              = ");
        nama = input.nextLine();
        System.out.print ("Masukkan NIK               = ");
        nik = input.nextLine();
        System.out.print ("Masukkan jabatan            = ");
        bagian = input.nextLine();
        System.out.println ("Golongan Karyawan          = \n <1>A\n <2>B\n <3>C" );
        System.out.print ("Masukkan Pilihan           = ");  
        golongan = input.nextInt();
        System.out.print ("Masukkan Jumlah Masuk = ");
        hari = input.nextInt();
        transport=hari*25000;
        System.out.println ("\n");
        System.out.println ("Nama                       = "+nama);
        System.out.println ("NIK                        = "+nik);
        System.out.println ("Jabatan                    = "+bagian);
      
            switch (golongan) {
            case 1:
                gapok=3000000;
                potongan=gapok*5/100;
                gaji=gapok-potongan;
                total=gaji+transport;
                System.out.println ("Tunjangan Transport        = "+transport);
                System.out.println ("Gaji Pokok                 = "+gapok);
                System.out.println ("Potongan Asuransi          = "+potongan);
                System.out.println ("Total Gaji                 = "+total);
                break;
            case 2:
                gapok=2500000;
                potongan=gapok*3/100;
                gaji=gapok-potongan;
                total=gaji+transport;
                System.out.println ("Tunjangan Transport        = "+transport);
                System.out.println ("Gaji Pokok                 = "+gapok);
                System.out.println ("Potongan Asuransi          = "+potongan);
                System.out.println ("Total Gaji                 = "+total);
                break;
            case 3:
                gapok=2000000;
                total=gapok+transport;
                System.out.println ("Tunjangan Transport        = "+transport);
                System.out.println ("Gaji Pokok                 = "+gapok);
                System.out.println ("Total Gaji                 = "+total);
                break;
                default:
                break;
          } 
    }  
}
 
Flowchart
 
 
 

Kamis, 04 Mei 2017

project 3

APLIKASI PICKUP BARANG

FLOWCHART
























SOURCE CODE

package pickup_barang;

import java.util.Scanner;

public class Pickup_barang {

    public static void main(String[] args) {

        Scanner input = new Scanner (System.in);
       
        String nama, alamat, tujuan;
        int jarak, paket,berat,beratTotal,jarakTotal,biayaPaket,ppn,biayaTotal;
               
        System.out.println ("    PROGRAM PICKUP BARANG    ");
        System.out.println ("-----------------------------");
        System.out.print ("Masukkan Nama : ");
        nama = input.nextLine();
        System.out.print ("Masukkan Alamat : ");
        alamat = input.nextLine();
        System.out.print ("Masukkan Alamat Pengiriman : ");
        tujuan = input.nextLine();
        System.out.print ("Masukkan Jarak Pengiriman(km) : ");
        jarak = input.nextInt();
        System.out.print ("Masukkan Berat Barang(kg) : ");
        berat = input.nextInt();
        System.out.println ("Menu Layanan : \n <1>Paket Reguler\n <2>Paket Khusus\n <3>Paket VIP" );
        System.out.print ("Masukkan Pilihan : ");
        paket = input.nextInt();
        System.out.println ("\n-----------------------------");
        System.out.println ("Nama : "+nama);
        System.out.println ("Alamat : "+alamat);
        System.out.println ("Alamat Pengiriman : "+tujuan);
        System.out.println ("Jarak Pengiriman : "+jarak+" Km");
        System.out.println ("Berat Barang : "+berat+" Kg");
       
        switch (paket) {
            case 1:
                beratTotal=berat*10000;
                jarakTotal=jarak*20000;
                biayaPaket=beratTotal+jarakTotal;
                ppn=biayaPaket*10/100;
                biayaTotal=biayaPaket+ppn;
                System.out.println ("Total Biaya Kg : "+beratTotal);
                System.out.println ("Total Biaya Km : "+jarakTotal);
                System.out.println ("Nilai PPN 10% : "+ppn);
                System.out.println ("Biaya Total : "+biayaTotal);
                break;
            case 2:
                beratTotal=berat*20000;
                jarakTotal=jarak*35000;
                biayaPaket=beratTotal+jarakTotal;
                ppn=biayaPaket*10/100;
                biayaTotal=biayaPaket+ppn;
                System.out.println ("Total Biaya Kg : "+beratTotal);
                System.out.println ("Total Biaya Km : "+jarakTotal);
                System.out.println ("Nilai PPN 10% : "+ppn);
                System.out.println ("Biaya Total : "+biayaTotal);
                break;
            case 3:
                beratTotal=berat*30000;
                jarakTotal=jarak*50000;
                biayaPaket=beratTotal+jarakTotal;
                ppn=biayaPaket*10/100;
                biayaTotal=biayaPaket+ppn;
                System.out.println ("Total Biaya Kg : "+beratTotal);
                System.out.println ("Total Biaya Km : "+jarakTotal);
                System.out.println ("Nilai PPN 10% : "+ppn);
                System.out.println ("Biaya Total : "+biayaTotal);
                break;
            default:
                break;
        }   
    }
}
 



Oval: End



Oval: End