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
 
 
 

Tidak ada komentar:

Posting Komentar