latihan6 .java
Nama File lat6.java
import java.io.* ;
public class lat6{
public static void main(String Arg[]) throws IOException{
String str ; String NIP ; String Nama ;String jbt ;
double gaji=0 ; double pajak =0 ; double total=0 ;
int Kdj ;
BufferedReader Get=new BufferedReader(new InputStreamReader(System.in)) ;
System.out.print(“NIP : “) ; NIP = Get.readLine() ;
System.out.print(“Nama : “) ; Nama = Get.readLine() ;
System.out.print(“Kode : “) ; str = Get.readLine() ;
Kdj = Integer.parseInt(str) ;
if (Kdj==1) {
jbt = “Direktur” ; gaji = 5000000 ;
} else if (Kdj==2) {
jbt = “Wakil Direktur” ; gaji = 4000000 ;
} else if (Kdj==3) {
jbt = “Bendahara” ; gaji = 3000000 ;
} else if (Kdj==4) {
jbt = “Staf” ; gaji = 2000000 ;
} else {
jbt = “” ; gaji = 0 ;
}
pajak = 0.1 * gaji ;
total = gaji-pajak ;
System.out.println(“Jabatan : ” + jbt ) ;
System.out.println(“Gaji : ” + gaji) ;
System.out.println(“Pajak : ” + pajak ) ;
System.out.println(“Total : ” + total ) ;
}
}
import java.io.* ;
public class lat6{
public static void main(String Arg[]) throws IOException{
String str ; String NIP ; String Nama ;String jbt ;
double gaji=0 ; double pajak =0 ; double total=0 ;
int Kdj ;
BufferedReader Get=new BufferedReader(new InputStreamReader(System.in)) ;
System.out.print(“NIP : “) ; NIP = Get.readLine() ;
System.out.print(“Nama : “) ; Nama = Get.readLine() ;
System.out.print(“Kode : “) ; str = Get.readLine() ;
Kdj = Integer.parseInt(str) ;
if (Kdj==1) {
jbt = “Direktur” ; gaji = 5000000 ;
} else if (Kdj==2) {
jbt = “Wakil Direktur” ; gaji = 4000000 ;
} else if (Kdj==3) {
jbt = “Bendahara” ; gaji = 3000000 ;
} else if (Kdj==4) {
jbt = “Staf” ; gaji = 2000000 ;
} else {
jbt = “” ; gaji = 0 ;
}
pajak = 0.1 * gaji ;
total = gaji-pajak ;
System.out.println(“Jabatan : ” + jbt ) ;
System.out.println(“Gaji : ” + gaji) ;
System.out.println(“Pajak : ” + pajak ) ;
System.out.println(“Total : ” + total ) ;
}
}
0 Response to "latihan6 .java"
Posting Komentar