Upload files to "/"

This commit is contained in:
2026-06-13 07:00:29 +00:00
commit de0ab258ba
5 changed files with 251 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
class PendaftaranKelas {
static int kuotaTerisi = 0;
final static int MAX_KUOTA = 25;
String namaMhs;
PendaftaranKelas(String nama) {
this.namaMhs = nama;
}
void prosesDaftar() {
if (kuotaTerisi < MAX_KUOTA) {
kuotaTerisi++;
System.out.printf("%s -> BERHASIL MASUK KELAS A (Terisi: %d)\n", this.namaMhs, kuotaTerisi);
} else {
System.out.printf("%s -> GAGAL! KELAS PENUH, TERLEMPAR KE KELAS B\n", this.namaMhs);
}
}
}
public class daftarkelas {
public static void main(String[] args) {
System.out.println("LIRS KELAS PBO DIMULAI!\n");
for (int i = 1; i <= 26; i++) {
PendaftaranKelas mhsBaru =
new PendaftaranKelas(String.format("Mahasiswa %02d", i));
mhsBaru.prosesDaftar();
}
}
}