TUGAS GAJI KARYAWAN
CODDING :
/**
* @(#)gaji.java
*
*
* @author
* @version 1.00 2002/1/1
*/
import java.util.Scanner;
public class gaji {
public static void main (String[] args) {
//input
System.out.println ("GAJI KARYAWAN");
System.out.println ("==============================");
Scanner input = new Scanner (System.in);
System.out.print ("Masukan nama anda = ");
String nama = input.nextLine();
System.out.print ("Masukan golongan = ");
int kode = input.nextInt();
System.out.print ("Tahun Masuk Kerja = ");
int tahun = input.nextInt();
int kerja = 2015 - tahun ;
System.out.println ("==============================");
long gaji=0,total;
//output
System.out.println ("Nama = "+nama);
System.out.println ("Golongan = "+kode);
System.out.println ("Tahun masuk kerja = "+tahun);
System.out.print ("Masa kerja = "+kerja);
System.out.println (" tahun");
switch(kode)
{
case 1 :
gaji = 750000;
System.out.println ("gaji pokok = Rp. 750000");
break;
case 2 :
gaji = 1000000;
System.out.println ("gaji pokok = Rp. 1000000");
break;
case 3 :
gaji= 1500000;
System.out.println ("gaji pokok = Rp. 1500000");
break;
case 4 :
gaji = 2000000;
System.out.println ("gaji pokok = Rp. 2000000");
break;
default :
System.out.println ("gaji anda tidak terdaftar");
break;
}
if (kerja>= 10)
{
System.out.println ("Bonus = Rp. 200000");
total = gaji + 200000;
System.out.println ("Total gaji = Rp. " +total);
}
else
{
System.out.println ("Bonus = Rp. 0 ");
total = gaji ;
System.out.println ("Total gaji = Rp. " +total);
}
}
}
OUTPUT :
Tidak ada komentar:
Posting Komentar