forked from OOP-ADF/Task_1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIndexPoint.java
More file actions
53 lines (46 loc) · 1.43 KB
/
IndexPoint.java
File metadata and controls
53 lines (46 loc) · 1.43 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package alwaw;
import java.util.Scanner;
public class Index {
public static void main(String[] args){
Scanner cin = new Scanner(System.in);
double uts, uas, quis;
double hasilA, hasilB, hasilC;
double hasil;
String indexHasil;
System.out.print("Nilai UTS : ");
uts = cin.nextInt();
System.out.print("Nilai Uas : ");
uas = cin.nextInt();
System.out.print("Nilai Quiz : ");
quis = cin.nextInt();
if ((uts <= 100) && (uas <= 100) && (quis <= 100)){
hasilA = 0.35*uts;
hasilB = 0.4*uas;
hasilC = 0.25*quis;
hasil = hasilA + hasilB + hasilC;
System.out.println("Rata-Rata hasil : " + hasil);
if ((hasil<=100) && (hasil>=85)){
indexHasil = "Excellent";
}
else if ((hasil<=84) && (hasil>=75)){
indexHasil = "VeryGood";
}
else if ((hasil<=74) && (hasil>=65)){
indexHasil = "Good";
}
else if ((hasil<=64) && (hasil>=50)){
indexHasil = "Accepted";
}
else if ((hasil<=100) && (hasil>=0)){
indexHasil = "Failed";
}
else{
indexHasil = "Hasil Error";
}
System.out.println("index yg diperoleh : " +indexHasil);
}
else{
System.out.println("input salah");
}
}
}