Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * 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 Praktikum;
- import java.io.DataInputStream;
- import java.io.*;
- /**
- *
- * @author kalvin jr
- */
- public class Latihan7_do_while {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- // TODO code application logic here
- String nip,nama,gol;
- int i=0;
- int a,b,c,lama_ker,gapok,tunj,upah_lembur,jam_kerja;
- double pph,gajikes;
- DataInputStream input =new DataInputStream(System.in);
- do{
- try{
- System.out.print("Masukkan NIP :");
- nip =input.readLine();
- System.out.print("Masukkan Nama :");
- nama =input.readLine();
- System.out.print("Masukkan Golongan :");
- gol =input.readLine();
- System.out.print("Masukkan LAMA KERJA :");
- lama_ker =Integer.parseInt(input.readLine());
- switch(gol)
- {
- case "3A" :
- { gapok =1000000;
- tunj=100000;
- break;}
- case "3B" :
- { gapok =2000000;
- tunj=200000; break;}
- case "3C" :
- {gapok=2500000;
- tunj=250000; break;}
- case "3D" :
- {gapok=3000000;
- tunj=300000; break;}
- case "4A" :
- { gapok=3500000;
- tunj=350000;
- break;}
- case "4B" :
- { gapok=4000000;
- tunj=400000;break;}
- case "4C" :
- { gapok=4500000;
- tunj=450000;break;}
- default :{ gapok=0;
- tunj=0; break;}
- }
- jam_kerja=lama_ker-7;
- switch(lama_ker)
- {
- case 1: {
- upah_lembur=0; break;}
- case 2: {
- upah_lembur=0; break;}
- case 3: {
- upah_lembur=0; break;}
- case 4: {
- upah_lembur=0; break;}
- case 5: {
- upah_lembur=0; break;}
- case 6: {
- upah_lembur=0; break;}
- case 7: {
- upah_lembur=0; break;}
- default : {upah_lembur=jam_kerja*50000;break;
- }
- }
- pph=0.1 *gapok;
- gajikes=(gapok+tunj+upah_lembur)-(int)pph;
- System.out.println("\n");
- System.out.println("DAFTAR GAJI KARYAWAN");
- System.out.println("NIP :"+nip);
- System.out.println("NAMA :"+nama);
- System.out.println("GOLONGAN :"+gol);
- System.out.println("GAJI POKOK :"+gapok);
- System.out.println("TUNAJNGAN :"+tunj);
- System.out.println("UPAH LEMBUR :" +upah_lembur);
- System.out.println("PPH :"+pph);
- System.out.println("TOTAL GAJI :"+gajikes);
- }catch(IOException e){}
- System.out.println("/n/n");
- }while(i < 20);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement