Posted by Materi Teknik Informatika • Informasi Teknologi Informasi • Digital Marketing on 9/23/2014
import java.util.Scanner;
public class Soal_302 {
public static void main(String[] args) {
Scanner masukan = new Scanner (System.in);
int jam;
double gaji,totalgaji,plus,minus,sisa;
System.out.print("Masukan Total Jam Kerja Anda/Minggu : ");
jam = masukan.nextInt();
if (jam>=60){
sisa = jam - 60;
jam = (int) (jam - sisa);
gaji = jam*5000;
plus = sisa*7500;
totalgaji = gaji+plus;
System.out.println("Maka Gaji Karyawan = Rp.7500/Jam & Total Gajinya/minggu = "+totalgaji);}
else if (jam<50) {
sisa = 50 - jam;
gaji = jam*5000;
minus = sisa*2500;
totalgaji = gaji-minus;
System.out.println("Maka Gaji Karyawan = Rp.2500/Jam & Total Gajinya/minggu = "+totalgaji);}
else {
totalgaji = jam*5000;
System.out.println("Maka Gaji Karyawan = Rp.5000/Jam & Total Gajinya/minggu = "+totalgaji);}
System.out.println("*** Tian Chan ***");
}
}
Berikut hasil output Program Gaji Karyawan Sesuai Jam Kerja Per-Minggu yang dihasilkan.