This site uses cookies from Google to deliver its services, to personalize ads and to analyze traffic. Information about your use of this site is shared with Google. By using this site, you agree to its use of cookies. Learn More

Creating Simple Class Php Interest Calculator

Creating Simple Class Php Interest Calculator Web-development (jquery) Creating Simple Class Php Interest Calculator

Creating simple class php interest Calculator
Creating simple class php interest Calculator

 <?php //Creating class interestCalculator class interestCalculator { public $rate; public $duration; public $capital; public function calculateInterest() { return ($this->rate*$this->duration*$this->capital)/100; } } //Creating various object of class interestCalculator to calculate interest on various amount $cls1 = new interestCalculator(); $cls2 = new $cls1; $cls1->rate =2; $cls1->duration =3; $cls1->capital = 300; $cls2->capital = 400; $interest1 = $cls1->calculateInterest(); $interest2 = $cls2->calculateInterest(); echo "$interest1 -- $interest2"; 

0 Response to "Creating Simple Class Php Interest Calculator"

Posting Komentar

Contact

Nama

Email *

Pesan *