Last active
January 28, 2017 06:05
-
-
Save muhikhsan101/cfef0d5cc95d4c13f5189b183590efe3 to your computer and use it in GitHub Desktop.
Revisions
-
muhikhsan101 revised this gist
Jan 28, 2017 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,20 @@ <?php // Membuat rancangan Mobil class Mobil { // Beberapa property yg dimiliki oleh Mobil: warna, merek, kecepatan_maksimum, status_mesin (status mesin nyala atau mati) public $warna; public $merek; public $kecepatan_maksimum; public $status_mesin = "mati"; // method untuk menyalakan mesin mobil function nyalakan_mesin() { // Kode untuk menyalakan mesin mobil // ... $this->status_mesin = "nyala"; } // method untuk mematikan mesin mobil function matikan_mesin() { // Kode untuk mematikan mesin mobil // ... -
muhikhsan101 revised this gist
Jan 28, 2017 . 1 changed file with 25 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,39 @@ <?php // Membuat rancangan Mobil class Mobil { public $warna; public $merek; public $kecepatan_maksimum; public $status_mesin = "mati"; function nyalakan_mesin() { // Kode untuk menyalakan mesin mobil // ... $this->status_mesin = "nyala"; } function matikan_mesin() { // Kode untuk mematikan mesin mobil // ... $this->status_mesin = "mati"; } } // Membuat objek mobil berdasarkan rancangan yg telah dibuat dalam class Mobil $mobil_A = new Mobil(); $mobil_B = new Mobil(); // Menyalakan mesin mobil_A dan mobil_B $mobil_A->nyalakan_mesin(); $mobil_B->nyalakan_mesin(); // Menampilkan status mesin mobil_A dan mobil_B echo '#1 Status mesin mobil_A: ' . $mobil_A->status_mesin . '<br>'; echo '#1 Status mesin mobil_B: ' . $mobil_B->status_mesin . '<br>'; // Mematikan mesin mobil_A $mobil_A->matikan_mesin(); // Menampilkan kembali status mesin mobil_A dan mobil_B echo '#2 Status mesin mobil_A: ' . $mobil_A->status_mesin . '<br>'; echo '#2 Status mesin mobil_B: ' . $mobil_B->status_mesin . '<br>'; -
muhikhsan101 revised this gist
Jan 28, 2017 . 1 changed file with 0 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +0,0 @@ -
muhikhsan101 revised this gist
Jan 28, 2017 . 2 changed files with 19 additions and 16 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ <?php class Mobil { public $warna; public $merek; public $kecepatan_maksimum; public $status_mesin = "mati"; public function nyalakan_mesin() { // Kode untuk menyalakan mesin mobil $this->status_mesin = "nyala"; } public function matikan_mesin() { // Kode untuk mematikan mesin mobil $this->status_mesin = "mati"; } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,3 @@ <?php $mobil_A = new Mobil(); $mobil_B = new Mobil(); -
muhikhsan101 created this gist
Jan 28, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ <?php class Mobil { public $warna; public $merek; public $kecepatan_maksimum; public $status_mesin = "mati"; public function nyalakan_mesin() { // Kode untuk menyalakan mesin mobil $this->status_mesin = "nyala"; } public function matikan_mesin() { // Kode untuk mematikan mesin mobil $this->status_mesin = "mati"; } }