forked from ab-rohman/Open-Hack2021
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArrayInputLoop.java
More file actions
29 lines (25 loc) · 937 Bytes
/
ArrayInputLoop.java
File metadata and controls
29 lines (25 loc) · 937 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
27
28
29
public class ArrayInputLoop {
public static void main(String [] args){
Scanner sc = new Scanner(System.in);
int[] nilaiUAS = new int [6];
for (int i=0; i<nilaiUAS.length;i++){
System.out.println("Masukkan nilai UAS MHS ke-"+i+": ");
nilaiUAS[i] = sc.nextInt();
}
for (int i = 0; i<nilaiUAS.length; i++){
if (nilaiUAS[i] > 70){
System.out.println("Mahasiswa ke-" + i+ "lulus!");
}
else {
System.out.println("Mahasiswa ke-" + i + "tidak lulus !");
}
//for(int i =0; i < 6; i++){
//System.out.println("Masukkan nilai UAS ke-" + i + ": ");
//nilaiUAS[i] = sc.nextInt();
//}
//for(int i = 0; i < 6; i++){
//System.out.println("Nilai UAS ke-" + i + " adalah : " + nilaiUAS[i]);
//}
}
}
}