-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
50 lines (42 loc) · 1.2 KB
/
index.php
File metadata and controls
50 lines (42 loc) · 1.2 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
<?php
$pel = array ("Bahasa PHP","Bahasa Delphi","Bahasa MySQL","Bahasa C++","Bahasa PERL");
$nama = array (
array("Anto","Edi","Sita"),
array("Anto","Budi"),
array("Nana","Alif","Jordan", "Rahmat"),
array("Masio","Ruri","Omar"),
array("Andi")
);
for ($i = 0; $i < count($pel); $i++) {
echo $pel[$i] . "<br>";
for ($j = 0; $j < count($nama[$i]); $j++) {
echo $j+1 . ". ";
echo $nama[$i][$j] . "<br>";
}
echo "<br>";
}
for ($i = 2004; $i < 2050; $i+= 4) {
echo $i . "<br><br>";
}
$total = 1000000;
if ($total > 200000) {
echo "Anda mendapat diskon sebesar 20% <br>";
echo "total belanja anda = ";
echo $total - $total * 20 / 100;
} else {
echo "Anda tidak mendapat diskon <br>";
echo "total belanja anda = " . $total;
}
$nilai_angka = 101;
if ( 90 <= $nilai_angka && $nilai_angka <= 100) {
echo "Mendapat Nilai A";
} elseif ( 70 <= $nilai_angka && $nilai_angka <= 89) {
echo "Mendapat Nilai B";
} elseif ( 50 <= $nilai_angka && $nilai_angka <= 69) {
echo "Mendapat Nilai C";
} elseif ( 30 <= $nilai_angka && $nilai_angka <= 49) {
echo "Mendapat Nilai D";
} elseif ( 0 <= $nilai_angka && $nilai_angka <= 29) {
echo "Mendapat Nilai E";
} else {echo "error";}
?>