示例#1
0
 public function lawyerInfo()
 {
     parent::workingmanInfo();
     echo $this->fees . '/Fees, in USD %<br>';
     echo $this->number_of_cases_lost . '/ Number of cases lost<br>';
     echo round($this->number_of_cases_won) . '/ Number of cases won<br>';
 }
示例#2
0
 public function musicianInfo()
 {
     parent::workingmanInfo();
     echo $this->popularity . '/Popularity, in %<br>';
     echo $this->fees . '/ Fees, in USD<br>';
     echo $this->skills . '/Skills, in %<br>';
 }
示例#3
0
 public function programmerInfo()
 {
     parent::workingmanInfo();
     echo $this->salary . '/ Sallary, in USD<br>';
     echo $this->qualification . ' Qualification, in %<br>';
 }
示例#4
0
<?php

include_once 'includes\\header.php';
echo "<h2>Object 1 Class WorkingMan</h2>";
$worker = new WorkingMan('Worker 1', '01-01-1990');
$worker->workingmanInfo();
echo "<hr>";
echo "<h2>Object 2 Class Musician</h2>";
$ozzy_osbourne = new Musician('Ozzy Osbourne', '03-12-1948', 70, 100000, 40);
$ozzy_osbourne->musicianInfo();
echo "<hr>";
$ozzy_osbourne->practice(15);
$ozzy_osbourne->work(100, 15, 1);
//$days, $price, $km, $number
echo "<h3>Profit from 2015 tour is " . $ozzy_osbourne->tour_profit(150, 500, 10000, 130) . " USD</h3>";
$ozzy_osbourne->musicianInfo();
echo "<hr>";
echo "<h2>Object 3 Class Lawyer</h2>";
//$workingman_name, $workingman_date_b, $lawyer_fees, $lawyer_ncl, $lawyer_ncw
$lawyer = new Lawyer('Lawyer Lawyer', '12-03-1968', 500, 10, 150);
$lawyer->lawyerInfo();
$lawyer->practice(5);
$lawyer->read(3);
$lawyer->work(3, 100, 1);
echo "<h3>Info again - </h3>";
$lawyer->lawyerInfo();
echo "<hr>";
echo "<h2>Object 4 Class Programmer</h2>";
//$workingman_name, $workingman_date_b, $programmer_salary, $programmer_qualification
$programmer = new Programmer("Programmer Programmer", '20-01-1975', 1000, 10);
$programmer->programmerInfo();