TUGAS
1. Buatlah Program menggunakan Array 1 dimensi untuk mengakses data-data
mahasiswa.
Penyelesaian :
<html>
<head>
<title>Modul 6 | Praktik 3</title>
<link href='/style.css' rel='stylesheet' type='text/css'/>
<script src='/script.js' type='text/javascript'></script>
</head>
<body onLoad="document.body.style.backgroundColor=bg">
<div id="judul">Data Mahasiswa</div>
<div id="isi">
<?php
$nim = Array
("13MI0001","13MI0002","13MI0003","13MI0004","13MI0005","13MI0006","13MI0007","13MI0008","13MI0010","13MI0011","13MI0012","13MI0013","13MI0014","13MI0015","13M
I0016","13MI0017","13MI0018","13MI0019","13MI0020","13MI0021","13MI0023","13MI0024","13MI0025","13MI0026","13MI0027","13MI0028",);
$nama = Array("Adi Nurcahyo","Ahmad Amirudin","Ahmad Shoerudin","Anang Sulistyo Fadli","Bayu Aditya","Defi Dyah
Anggraeni","Destantia Permatasari","Fitriyani","Imam Ihsan Permana","Inarotul Ainiyah","Insanatun Fadillah","Laila Kurniati Rahma","Luvi Ikhtiyarini",
"Ninik Fitriani","Nurhalimah","Nuri Hadiningsih","Oki Satria Setiawan","Rizki Arie Putra","Samsul Ma'arif","Sari Setianingtyas","Siti Khadikotun
Sururiah","Solikhatun","Supriyani","Tita Isrofi","Titis Rachmatika","Arif Rahman");
print ("<table width=49% align=center border=1 cellspacing=0 style=float:left;><tr><th>NIM</th><th>Nama</th></tr>");
for ($data = 0; $data <= 12; $data++) {
print("<tr><td>$nim[$data]</td><td>$nama[$data]</td></tr>");
}
print ("</table>");
print ("<table width=49% align=center border=1 cellspacing=0 style=float:right;><tr><th>NIM</th><th>Nama</th></tr>");
for ($data = 13; $data <= 25; $data++) {
print("<tr><td>$nim[$data]</td><td>$nama[$data]</td></tr>");
}
print ("</table>");
?>
</div>
</body>
</html>