View difference between Paste ID: tvdzY29t and x0QLHqk0
SHOW: | | - or go back to the newest paste.
1
<?php
2
3-
$tresholdNilai = 75;
3+
$nilai = "A";
4-
$tresholdKehadiran = 80;
4+
switch ($nilai) {
5
    case "A":
6-
$skorAnda = 80;
6+
        echo "Anda lulus dengan baik";
7-
$absenAnda = 90;
7+
        break;
8
    case "B":
9-
if ($skorAnda >= $tresholdNilai && $absenAnda >= $tresholdKehadiran) {
9+
    case "C":
10-
    echo "Anda Lulus";
10+
        echo "Anda lulus";
11-
}else{
11+
        break;
12-
    echo "Anda Tidak Lulus";
12+
    case "D":
13
        echo "Anda tidak lulus";
14
        break;
15
    case "E":
16
        echo "Sepertinya anda salah jurusan";
17
        break;
18
    default:
19
        echo "Nilai tidak ditemukan";
20
}