Monday, April 1, 2013

Program Menghitung Lama Kerja

Source Code :


import java.util.Scanner;

public class LamaKerja{
public static void main(String [] args){
int kerja;
Scanner input = new Scanner(System.in);

System.out.print("Jam Masuk : ");
int awal = input.nextInt();

System.out.print("Jam Pulang : ");
int akhir = input.nextInt();

if(awal>akhir)
kerja = 12-awal+akhir;
else
kerja = akhir-awal;

System.out.print("Lama Bekerja "+kerja+" jam");
}
}

Outputnya :



Silahkan Copas Gannnn,,,,
Tapi Tolong Jangan Lupa Komentarnya yy gann,,,



0 comments:

Post a Comment