forked from izzazzhr/learning
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuiz01.java
More file actions
26 lines (26 loc) · 843 Bytes
/
Quiz01.java
File metadata and controls
26 lines (26 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import java.util.Scanner;
class Quiz01{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int penalty = -200;
int insentif=0;
int insentifLebih=0;
int totalInsentif=0;
System.out.print("Input Jumlah SKS... ");
int sks = input.nextInt();
if(sks >=8){
insentif = 200*8;
insentifLebih = 100*(sks-8);
System.out.printf("Insentif dasar = %d\n", 8);
System.out.printf("Insentif lebih = %d\n", sks-8);
totalInsentif = insentif + insentifLebih;
}else if (sks < 8 && sks >0){
System.out.printf("Insentif dasar = %d\n", 0);
System.out.printf("Denda = %d\n",penalty);
totalInsentif = penalty;
}else{
System.out.println("Anda tidak pernah mengajar");
}
System.out.printf("Total insentif = $%d \n",totalInsentif);
}
}