<?php
class Department {
public $employees = array();
public function __construct($boss, $name,
$managers1, $managers2, $managers3,
$marketers1, $marketers2, $marketers3,
$engineers1,
$analysts1, $analysts2) {
$this->name = $name;
for ($i = 0; $i < $managers1; $i++){
$this->employees[] = new Manager(1, false);
}
for ($i = 0; $i < $managers2; $i++){
$this->employees[] = new Manager(2, false);
}
for ($i = 0; $i < $managers3; $i++){
$this->employees[] = new Manager(3, false);
}
for ($i = 0; $i < $marketers1; $i++){
$this->employees[] = new Marketer(1, false);
}
for ($i = 0; $i < $marketers2; $i++){
$this->employees[] = new Marketer(2, false);
}
for ($i = 0; $i < $marketers3; $i++){
$this->employees[] = new Marketer(3, false);
}
for ($i = 0; $i < $engineers1; $i++){
$this->employees[] = new Engineer(1, false);
}
for ($i = 0; $i < $analysts1; $i++){
$this->employees[] = new Analyst(1, false);
}
for ($i = 0; $i < $analysts2; $i++){
$this->employees[] = new Analyst(2, false);
}
$this->employees[] = $boss;
}
public function calcCoffeeConsumption() {
$consumption = 0;
foreach ($this->employees as $employee) {
$consumption = $consumption + $employee->coffee;
}
return $consumption;
}
public function calcMoneyConsumption() {
$consumption = 0;
foreach ($this->employees as $employee) {
$consumption = $consumption + $employee->salary;
}
return $consumption;
}
public function calcReportsGeneration() {
$generation = 0;
foreach ($this->employees as $employee) {
$generation = $generation + $employee->reports;
}
return $generation;
}
public function calcToogreeksPerPage() {
$toogreeks = $this->calcMoneyConsumption() / $this->calcReportsGeneration();
return round($toogreeks, 2); }
public function getNumberOfEmployees() {
return count($this->employees); }
}
abstract class Employee {
public function countSalary($salary) {
if ($this->rank == 2) {
$salary = $salary * 1.25;
}elseif ($this->rank == 3) {
$salary = $salary * 1.5;
}
if ($this->isBoss == true) {
$salary = $salary * 1.5;
}
return $salary;
}
public function countCoffee($coffee) {
if ($this->isBoss == true) {
$coffee = $coffee * 2;
}
return $coffee;
}
public function countReports($reports) {
if ($this->isBoss == true) {
$reports = 0;
}
return $reports;
}
}
class Manager extends Employee {
public function __construct($rank, $isBoss) {
$salary = 500;
$coffee = 20;
$reports = 200;
$this->rank = $rank;
$this->isBoss = $isBoss;
$this->salary = $this->countSalary($salary);
$this->coffee = $this->countCoffee($coffee);
$this->reports = $this->countReports($reports);
}
}
class Marketer extends Employee {
public function __construct($rank, $isBoss) {
$salary = 400;
$coffee = 15;
$reports = 150;
$this->rank = $rank;
$this->isBoss = $isBoss;
$this->salary = $this->countSalary($salary);
$this->coffee = $this->countCoffee($coffee);
$this->reports = $this->countReports($reports);
}
}
class Engineer extends Employee {
public function __construct($rank, $isBoss) {
$salary = 200;
$coffee = 5;
$reports = 50;
$this->rank = $rank;
$this->isBoss = $isBoss;
$this->salary = $this->countSalary($salary);
$this->coffee = $this->countCoffee($coffee);
$this->reports = $this->countReports($reports);
}
}
class Analyst extends Employee {
public function __construct($rank, $isBoss) {
$salary = 800;
$coffee = 50;
$reports = 5;
$this->rank = $rank;
$this->isBoss = $isBoss;
$this->salary = $this->countSalary($salary);
$this->coffee = $this->countCoffee($coffee);
$this->reports = $this->countReports($reports);
}
}
function padLeft($string, $length) {
if ($stlen < $length) {
for ($i = 0; $i < $length - $stlen; $i++) {
$string = " " . $string;
}
}
return $string;
}
function padRight($string, $length) {
if ($stlen < $length) {
for ($i = 0; $i < $length - $stlen; $i++) {
$string = $string . " ";
}
}
return $string;
}
function calcAverage($company, $method) {
$summary = 0;
foreach ($company as $department) {
$summary = $summary + $department->$method();
}
}
function calcTotal($company, $method) {
$summary = 0;
foreach ($company as $department) {
$summary = $summary + $department->$method();
}
return $summary;
}
$purchasing = new Department(new Manager(2, true), "Закупок",
9, 3, 2,
2, 0, 0,
0,
0, 0);
$sales = new Department(new Marketer(2, true), "Продаж",
12, 0, 0,
6, 0, 0,
0,
3, 2);
$marketing = new Department(new Marketer(3, true), "Рекламы",
8, 0, 0,
15, 10, 0,
2,
0, 0);
$logistics = new Department(new Manager(1, true), "Логистики",
13, 5, 0,
0, 0, 0,
5,
0, 0);
$company = array($purchasing, $sales, $marketing, $logistics);
$col1 = 20;
$col2 = 8;
$col3 = 10;
$col4 = 10;
$col5 = 10;
$col6 = 12;
echo padRight("Департамент", $col1) .
padLeft("сотр.", $col2) .
padLeft("тугр.", $col3) .
padLeft("кофе", $col4) .
padLeft("стр.", $col5) .
padLeft("тугр./стр.", $col6) . "\n----------------------------------------------------------------------\n-\n";
foreach ($company as $department) {
echo padRight($department->name, $col1) .
padLeft
(count($department->employees), $col2) . padLeft($department->calcMoneyConsumption(), $col3) .
padLeft($department->calcCoffeeConsumption(), $col4) .
padLeft($department->calcReportsGeneration(), $col5) .
padLeft($department->calcToogreeksPerPage(), $col6) . "\n";
}
echo "-\n" . padRight("Среднее", $col1) .
padLeft(calcAverage($company, 'getNumberOfEmployees'), $col2) .
padLeft(calcAverage($company, 'calcMoneyConsumption'), $col3) .
padLeft(calcAverage($company, 'calcCoffeeConsumption'), $col4) .
padLeft(calcAverage($company, 'calcReportsGeneration'), $col5) .
padLeft(calcAverage($company, 'calcToogreeksPerPage'), $col6) . "\n";
echo padRight("Всего", $col1) .
padLeft(calcTotal($company, 'getNumberOfEmployees'), $col2) .
padLeft(calcTotal($company, 'calcMoneyConsumption'), $col3) .
padLeft(calcTotal($company, 'calcCoffeeConsumption'), $col4) .
padLeft(calcTotal($company, 'calcReportsGeneration'), $col5) .
padLeft(calcTotal($company, 'calcToogreeksPerPage'), $col6) . "\n";
?>
PD9waHAKZXJyb3JfcmVwb3J0aW5nKC0xKTsKbWJfaW50ZXJuYWxfZW5jb2RpbmcoJ3V0Zi04Jyk7CgpjbGFzcyBEZXBhcnRtZW50IHsKICAgIHB1YmxpYyAkZW1wbG95ZWVzID0gYXJyYXkoKTsKCiAgICBwdWJsaWMgZnVuY3Rpb24gX19jb25zdHJ1Y3QoJGJvc3MsICRuYW1lLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRtYW5hZ2VyczEsICRtYW5hZ2VyczIsICRtYW5hZ2VyczMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJG1hcmtldGVyczEsICRtYXJrZXRlcnMyLCAkbWFya2V0ZXJzMywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZW5naW5lZXJzMSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkYW5hbHlzdHMxLCAkYW5hbHlzdHMyKSB7CiAgICAgICAgJHRoaXMtPm5hbWUgPSAkbmFtZTsKICAgICAgICBmb3IgKCRpID0gMDsgJGkgPCAkbWFuYWdlcnMxOyAkaSsrKXsKICAgICAgICAgICAgJHRoaXMtPmVtcGxveWVlc1tdID0gbmV3IE1hbmFnZXIoMSwgZmFsc2UpOwogICAgICAgIH0KICAgICAgICBmb3IgKCRpID0gMDsgJGkgPCAkbWFuYWdlcnMyOyAkaSsrKXsKICAgICAgICAgICAgJHRoaXMtPmVtcGxveWVlc1tdID0gbmV3IE1hbmFnZXIoMiwgZmFsc2UpOwogICAgICAgIH0KICAgICAgICBmb3IgKCRpID0gMDsgJGkgPCAkbWFuYWdlcnMzOyAkaSsrKXsKICAgICAgICAgICAgJHRoaXMtPmVtcGxveWVlc1tdID0gbmV3IE1hbmFnZXIoMywgZmFsc2UpOwogICAgICAgIH0KICAgICAgICBmb3IgKCRpID0gMDsgJGkgPCAkbWFya2V0ZXJzMTsgJGkrKyl7CiAgICAgICAgICAgICR0aGlzLT5lbXBsb3llZXNbXSA9IG5ldyBNYXJrZXRlcigxLCBmYWxzZSk7CiAgICAgICAgfQogICAgICAgIGZvciAoJGkgPSAwOyAkaSA8ICRtYXJrZXRlcnMyOyAkaSsrKXsKICAgICAgICAgICAgJHRoaXMtPmVtcGxveWVlc1tdID0gbmV3IE1hcmtldGVyKDIsIGZhbHNlKTsKICAgICAgICB9CiAgICAgICAgZm9yICgkaSA9IDA7ICRpIDwgJG1hcmtldGVyczM7ICRpKyspewogICAgICAgICAgICAkdGhpcy0+ZW1wbG95ZWVzW10gPSBuZXcgTWFya2V0ZXIoMywgZmFsc2UpOwogICAgICAgIH0KICAgICAgICBmb3IgKCRpID0gMDsgJGkgPCAkZW5naW5lZXJzMTsgJGkrKyl7CiAgICAgICAgICAgICR0aGlzLT5lbXBsb3llZXNbXSA9IG5ldyBFbmdpbmVlcigxLCBmYWxzZSk7CiAgICAgICAgfQogICAgICAgIGZvciAoJGkgPSAwOyAkaSA8ICRhbmFseXN0czE7ICRpKyspewogICAgICAgICAgICAkdGhpcy0+ZW1wbG95ZWVzW10gPSBuZXcgQW5hbHlzdCgxLCBmYWxzZSk7CiAgICAgICAgfQogICAgICAgIGZvciAoJGkgPSAwOyAkaSA8ICRhbmFseXN0czI7ICRpKyspewogICAgICAgICAgICAkdGhpcy0+ZW1wbG95ZWVzW10gPSBuZXcgQW5hbHlzdCgyLCBmYWxzZSk7CiAgICAgICAgfQogICAgICAgICR0aGlzLT5lbXBsb3llZXNbXSA9ICRib3NzOwogICAgfQoKICAgIHB1YmxpYyBmdW5jdGlvbiBjYWxjQ29mZmVlQ29uc3VtcHRpb24oKSB7CiAgICAgICAgJGNvbnN1bXB0aW9uID0gMDsKICAgICAgICBmb3JlYWNoICgkdGhpcy0+ZW1wbG95ZWVzIGFzICRlbXBsb3llZSkgewogICAgICAgICAgICAkY29uc3VtcHRpb24gPSAkY29uc3VtcHRpb24gKyAkZW1wbG95ZWUtPmNvZmZlZTsKICAgICAgICB9CiAgICAgICAgcmV0dXJuICRjb25zdW1wdGlvbjsKICAgIH0KICAgIHB1YmxpYyBmdW5jdGlvbiBjYWxjTW9uZXlDb25zdW1wdGlvbigpIHsKICAgICAgICAkY29uc3VtcHRpb24gPSAwOwogICAgICAgIGZvcmVhY2ggKCR0aGlzLT5lbXBsb3llZXMgYXMgJGVtcGxveWVlKSB7CiAgICAgICAgICAgICRjb25zdW1wdGlvbiA9ICRjb25zdW1wdGlvbiArICRlbXBsb3llZS0+c2FsYXJ5OwogICAgICAgIH0KICAgICAgICByZXR1cm4gJGNvbnN1bXB0aW9uOwogICAgfQogICAgcHVibGljIGZ1bmN0aW9uIGNhbGN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N1bW1hcnkgPSAwOwogICAgZm9yZWFjaCAoJGNvbXBhbnkgYXMgJGRlcGFydG1lbnQpIHsKICAgICAgICAkc3VtbWFyeSA9ICRzdW1tYXJ5ICsgJGRlcGFydG1lbnQtPiRtZXRob2QoKTsKICAgIH0KICAgIHJldHVybiAkc3VtbWFyeTsKfQoKJHB1cmNoYXNpbmcgPSBuZXcgRGVwYXJ0bWVudChuZXcgTWFuYWdlcigyLCB0cnVlKSwgItCX0LDQutGD0L/QvtC6IiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICA5LCAzLCAyLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIsIDAsIDAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLCAwKTsKCiRzYWxlcyA9IG5ldyBEZXBhcnRtZW50KG5ldyBNYXJrZXRlcigyLCB0cnVlKSwgItCf0YDQvtC00LDQtiIsCiAgICAgICAgICAgICAgICAgICAgICAgIDEyLCAwLCAwLAogICAgICAgICAgICAgICAgICAgICAgICA2LCAwLCAwLAogICAgICAgICAgICAgICAgICAgICAgICAwLAogICAgICAgICAgICAgICAgICAgICAgICAzLCAyKTsKCiRtYXJrZXRpbmcgPSBuZXcgRGVwYXJ0bWVudChuZXcgTWFya2V0ZXIoMywgdHJ1ZSksICLQoNC10LrQu9Cw0LzRiyIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICA4LCAwLCAwLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgMTUsIDEwLCAwLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgMiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsIDApOwoKJGxvZ2lzdGljcyA9IG5ldyBEZXBhcnRtZW50KG5ldyBNYW5hZ2VyKDEsIHRydWUpLCAi0JvQvtCz0LjRgdGC0LjQutC4IiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEzLCA1LCAwLAogICAgICAgICAgICAgICAgICAgIC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