/*
* To change this
template, choose Tools | Templates
* and open the
template in the editor.
*/
package penggajian;
import java.util.Scanner;
/**
*
* @author Planet
Setup
*/
public class Main {
/**
* @param args the
command line arguments
*/
public static void
main(String[] args) {
Scanner input
= new Scanner (System.in);
double total =
0,jmlpot = 0,jam,gaji = 0,gn = 0;
String ket =
null;
System.out.println("gaji karyawan");
System.out.print("jam kerja perminggu :");
jam=input.nextDouble();
if(jam >=
50 && jam <= 60)
{
total =
jam * 5000;
gn=5000*jam;}
else if(jam
>= 60){
gaji=jam-60;
jmlpot=gaji*7500;
total=jam*5000+jmlpot;
gn=5000*jam;}
else
if(jam<=50){
gaji=50-jam;
jmlpot=gaji*2500;
total=gn-jmlpot;
gn=5000*jam;}
System.out.println("jam
potongan:"+gaji);
System.out.println("jumlah potongan:"+jmlpot);
System.out.println("gaji normal:"+gn);
System.out.println("total gaji:"+total);
// TODO code
application logic here
}
}
Komentar
Posting Komentar