package
uts;
import
java.util.Scanner;
public
class UTS {
public static void main(String[] args) {
System.out.println(" Ujian Tengah
Semester ");
System.out.println("Nama : Nur Iman Sarumaha
");
System.out.println("Kelas : SI-M1502
");
System.out.println("Mata Kuliah :
Pemograman Berorientasi Objek
");
System.out.println("");
Scanner NIK=new Scanner (System.in);
System.out.print("Input NIK : ");
Integer nik=NIK.nextInt();
if(nik==11002) {
System.out.println("Nama : Merry Riana");
System.out.println("Alamat : Jln.MT.Haryono");
System.out.println("Pendidikan : Strata-2");
}else if(nik==2) {
System.out.println("Nama : Dian");
System.out.println("Alamat : JL.AR.Hakim");
System.out.println("Pendidikan : Strata-1");
}else {
System.out.println("Nama : Agus");
System.out.println("Alamat : JL.Pakam");
System.out.println("Pendidikan : Strata-1");
}
System.out.println("");
System.out.println("Rincian:");
double totalgaji;
double potongangaji;
double gajibersih;
Integer Gapok=2500000;
System.out.println("Gaji
pokok : Rp. " +Gapok);
Scanner Jabatan=new Scanner
(System.in);
System.out.print("Input
Jabatan : ");
String jabatan=Jabatan.nextLine();
double Tunjanganjabatan=0.02*Gapok;
System.out.println("Tunjangan
Jabatan : Rp. "
+Tunjanganjabatan);
Scanner Status=new Scanner (System.in);
System.out.print("Input
Status : ");
String status=Status.nextLine();
double Tunjangankeluarga=0.03*Gapok;
System.out.println("Tunjangan
Keluarga : Rp. "
+Tunjangankeluarga);
Scanner Jumlahanak=new Scanner
(System.in);
System.out.print("Input Jumlah
anak : ");
String jumlahanak=Jumlahanak.nextLine();
double Tunjangananak=0*Gapok;
System.out.println("Tunjangan
Anak : Rp. " +Tunjangananak);
double Transportasi=0.03*Gapok;
System.out.println("Transportasi : Rp. " +Transportasi);
double Uangmakan=0.04*Gapok;
System.out.println("Uang
makan : Rp. " +Uangmakan);
double Pajak=0.03*Gapok;
System.out.println("Pajak : Rp. " +Pajak);
double BPJS=0.02*Gapok;
System.out.println("BPJS
Kesehatan : Rp. " +BPJS);
double Jamsostek=0.01*Gapok;
System.out.println("Jamsostek : Rp. " +Jamsostek);
totalgaji=(Gapok+(0.02*Gapok)+(0.03*Gapok)+(0*Gapok)+(0.03*Gapok)+(0.04*Gapok));
System.out.println("Total
Gaji = Rp. " +totalgaji);
potongangaji=((0.03*Gapok)+(0.02*Gapok)+(0.01*Gapok));
System.out.println("Potongan = Rp. " +potongangaji);
gajibersih=(totalgaji-potongangaji);
System.out.println("Gaji
Bersih = Rp. " +gajibersih);
Scanner NIK_2=new Scanner
(System.in);
System.out.println("Input NIK = ");
Integer Nik=NIK_2.nextInt();
if(Nik==2) {
System.out.println("Nama
: Desna");
System.out.println("Alamat
: JL.Pandu");
System.out.println("Pendidikan
: Strata-2");
}else if(Nik==3) {
System.out.println("Nama
: Miralis");
System.out.println("ALamat
: JL.Solo");
System.out.println("Pendidikan : Diploma-3");
}else {
System.out.println("Nama
: Tiurma");
System.out.println("Alamat
: JL.AIR BERSIH");
System.out.println("Pendidikan
: STRATA-1");
}
Scanner Golongan_2=new Scanner
(System.in);
System.out.println("Input Golongan = ");
String
golongan_2=Golongan_2.nextLine();
double totalgaji_2;
double potongangaji_2;
double gajibersih_2;
Integer x=3200000;
System.out.println("Gaji
pokok : Rp. " +x);
Scanner Jabatan_2=new Scanner
(System.in);
System.out.print("Input
Jabatan : ");
String
jabatan_2=Jabatan_2.nextLine();
double
Tunjanganjabatan_2=0.06*x;
System.out.println("Tunjangan Jabatan : Rp. "
+Tunjanganjabatan_2);
Scanner Status_2=new Scanner
(System.in);
System.out.println("Input
Status : ");
String
status_2=Status_2.nextLine();
double
Tunjangankeluarga_2=0.03*x;
System.out.println("Tunjangan Keluarga : Rp. "
+Tunjangankeluarga_2);
Scanner Jumlahanak_2=new
Scanner (System.in);
System.out.print("Input
Jumlah anak = ");
String jumlahanak_2=Jumlahanak_2.nextLine();
double Tunjangananak_2=0.02*x;
System.out.println("Tunjangan Anak : Rp. " +Tunjangananak_2);
double Transportasi_2=0.03*x;
System.out.println("Transportasi
: Rp. " +Transportasi_2);
double Uangmakan_2=0.04*x;
System.out.println("Uang
makan : Rp. " +Uangmakan_2);
double Pajak_2=0.03*x;
System.out.println("Pajak
: Rp. " +Pajak_2);
double BPJS_2=0.02*x;
System.out.println("BPJS
Kesehatan : Rp. " +BPJS_2);
double Jamsostek_2=0.01*x;
System.out.println("Jamsostek : Rp. " +Jamsostek_2);
totalgaji_2=(x+(0.06*x)+(0.03*x)+(0.02*x)+(0.03*x)+(0.04*x));
System.out.println("Total
Gaji = Rp. " +totalgaji_2);
potongangaji_2=((0.03*x)+(0.02*x)+(0.01*x));
System.out.println("Potongan
= Rp. " +potongangaji_2);
gajibersih_2=(totalgaji_2-potongangaji_2);
System.out.println("Gaji
Bersih =
Rp. " +gajibersih_
Hasilnya: