PERTANYAAN UJIAN
masukkan data ke 1 :
nim : 1234
nama : tono
nilai : 90
masukkan data ke 2 :
nim : 1235
No. Deskripsi Soal Bobot
nama : andi
nilai : 80
masukkan data ke 3 :
nim : 1236
nama : budi
nilai : 65
masukkan data ke 4 :
nim : 1237
nama : abby
nilai : 77
result :
1. 1237 abby 77
2. 1235 andi 80
3. 1236 budi 65
4. 1234 tono 90
Buatlah sebuah program untuk mencetak deret angka dengan ketentuan sebagai
3 20
berikut:
a. program meminta 2 input.
b. Input pertama mewakili jumlah angka yang mau dicetak
c. Input kedua mewakili batas angka yang dicetak
d. Resultnya angka akan dicetak mulai dari batas yang diinput dan terus dikurang 1.
Jika angka sudah mencapai angka 1, maka angka akan dimulai lagi dari batas
yang diinput
Contoh1 :
Input jumlah angka : 5
input batas angka : 3
output : 3 2 1 3 2
Contoh2 :
Input jumlah angka : 10
input batas angka : 4
output : 4 3 2 1 4 3 2 1 4 3
RUBRIK PENILAIAN
LO SKORE : % dari Bobot NILAI
Bobot KONTEN / ELEMEN
(85 <= 100) (75 <= 84) (65 <= 74) (<= 64) Skor x bobot
Level
Pseudo Code, Pseudo Code, Pseudo Code, Pseudo Code,
Use pseudocode,
LO1 Flowchart, or NS Flowchart, or NS Flowchart, or NS Flowchart, or NS
Flowchart, or NS
Understanding Diagram are Diagram are Diagram are Diagram are
Diagram to explain
10 relevant to express relevant to express relevant to express relevant to express
Algorithm
the algorithm the algorithm the algorithm the algorithm
Use Java syntax to Java syntax is used Java syntax is used Java syntax is used Java syntax for the
perform different kinds appropriately, and appropriately, but appropriately but algorithm is used
LO1
of algorithms Java the algorithm is not all the the algorithm is not inappropriately, and
Understanding
syntax is used suitable algorithm is suitable suitable not suitable with
10
appropriately, and the the algorithm
algorithm is suitable
All of the More than half of The operations is The operations is
LO2 Ability to express operations are the operations are expressed for expressed wrongly
Understanding arithmetic assignment, expressed properly expressed properly different purpose
30 logical, and relatonal
data.print(input);
2. Code:
import java.util.Comparator;
return name1.compareToIgnoreCase(name2);
}
};
}
import java.util.Scanner;
import java.util.ArrayList;
import java.util.Arrays;
int quota;
System.out.print("Input Jumlah Data : ");
quota=scan.nextInt();
String name ;
int nim ;
int score ;
student[] stdlist = new student [quota];
ArrayList<String> names = new ArrayList<String>();
do {
System.out.print("Nama \t: ");
name=scan.nextLine();
}while (names.contains(name));
names.add(name);
do {
System.out.print("Nilai \t: ");
score=scan.nextInt();
}while (score<1||score>100);
System.out.println("\nHasil : ");
Arrays.sort(stdlist, student.studentnamecomparator);
for(int i =0; i< stdlist.length;++i){
int no =1;
System.out.println(no+i+"."+stdlist[i].print());
}
3. Code:
import java.util.Scanner;
public class No3 {
System.out.println("Output : ");