Tugas MD 6 (1 & 2) by Fitriyani 16.59 Posting Komentar 1. Buatlah Program menggunakan Array 1 dimensi untuk mengakses data-data mahasiswa : Modul 6 Tugas Array 1 dimensi NIMNama "); for ($data = 0; $data <= 12; $data++) { print(" $nim[$data]$nama[$data] "); } print (" "); print (" NIMNama "); for ($data = 13; $data <= 25; $data++) { print(" $nim[$data]$nama[$data] "); } print (" "); ?> 2. Buatlah program menggunakan Array multidimensi dalam transaksi pembelian barang : Modul 6 Tugas array multidimensi Array("Gift","Harmoni","Lifeboy","Nuvo"),"sampo"=>Array("Sunsilk","Clear","Pantene","Lifeboy Shampo"),"deterjen"=>Array("Daia","Rinso","Soklin","Boom","B-39","Bunga"),"pewangi"=>Array("Downy","Soklin Pewangi"),"sabuncuci"=>Array("Sunlight")); $peralatan = Array("alatdapur"=>Array("Kompor","Panci","Kwali","Oven"),"alatmakan"=>Array("Sendok","Garpu","Piring","Mangkok","Gelas"),"alatkebersihan"=>Array("Sapu","Kain Lap","Tempat Sampah"),"alatkebun"=>Array("Cangkul","Sekop")); print("Daftar Belanja: Perlengkapan ".$perlengkapan['sabunmandi'][2]."(5) ".$perlengkapan['sampo'][0]."(2) ".$perlengkapan['sampo'][2]."(2) ".$perlengkapan['deterjen'][2]."(3) ".$perlengkapan['pewangi'][0]."(6) ".$perlengkapan['sabuncuci'][0]."(5) Peralatan ".$peralatan['alatdapur'][0]."(1) ".$peralatan['alatdapur'][3]."(1) ".$peralatan['alatmakan'][0]."(36) ".$peralatan['alatmakan'][2]."(12) ".$peralatan['alatkebersihan'][1]."(2) ".$peralatan['alatkebun'][1]."(1) "); ?> Berbagi : Open Comments Close Comments Posting Komentar untuk "Tugas MD 6 (1 & 2)"
Posting Komentar untuk "Tugas MD 6 (1 & 2)"
Teman-teman silahkan berkomentar dengan baik dan menjunjung tinggi tata krama :)