1 / 2

class Lingkaran { var $jariJari; function __construct($jariJari) {

class Lingkaran { var $jariJari; function __construct($jariJari) { $this->jariJari = $jariJari; } function hitungLuas() { return M_PI *$this->jariJari*$this->jariJari; } function hitungKeliling() { return 2*M_PI*$this->jariJari; } }. class Lingkaran {

irma
Download Presentation

class Lingkaran { var $jariJari; function __construct($jariJari) {

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. class Lingkaran { var $jariJari; function __construct($jariJari) { $this->jariJari = $jariJari; } function hitungLuas() { return M_PI*$this->jariJari*$this->jariJari; } function hitungKeliling() { return 2*M_PI*$this->jariJari; } } class Lingkaran { private $jariJari; private $luas; private $keliling; privatefunction hitung() { $this->luas = M_PI*$this->jariJari*$this->jariJari; $this->keliling = 2*M_PI*$this->jariJari; } publicfunction __construct($jariJari) { $this->jariJari = $jariJari; $this->hitung(); } publicfunction getJariJari() { return $this->jariJari; } publicfunction setJariJari($jariJari) { $this->jariJari = $jariJari; $this->hitung(); } publicfunction getLuas() { return $this->luas; } publicfunction getKeliling() { return $this->keliling; } }

  2. class Segitiga { var $alas; var $tinggi; function __construct($alas, $tinggi) { $this->alas = $alas; $this->tinggi = $tinggi; } function hitungLuas() { return 0.5*$this->alas*$this->tinggi; } } class Segitiga { private $alas; private $tinggi; private $luas; privatefunction hitung() { $this->luas = 0.5*$this->alas*$this->tinggi; } publicfunction __construct($alas, $tinggi) { $this->alas = $alas; $this->tinggi = $tinggi; $this->hitung(); } publicfunction getAlas() { return $this->alas; } publicfunction setAlas($alas) { $this->alas = $alas; $this->hitung(); } publicfunction getTinggi() { return $this->tinggi; } publicfunction setTinggi($tinggi) { $this->tinggi = $tinggi; $this->hitung(); } publicfunction getLuas() { return $this->luas; } }

More Related