fork(1) download
  1. <?php
  2. class Company
  3. {
  4. private $departaments = array();
  5.  
  6. public function add_departament($departament)
  7. {
  8. $this->departaments [] = $departament;
  9. }
  10.  
  11. public function get_Count_Workers()
  12. {
  13. foreach ($this->departaments as $departament) {
  14. $count_workers += $departament->get_Sum_Workers();
  15. }
  16. return $count_workers;
  17. }
  18.  
  19. public function get_Average_Workers()
  20. {
  21. return $this->get_Count_Workers()/count($this->departaments);
  22. }
  23.  
  24. public function get_Count_Salary()
  25. {
  26. foreach ($this->departaments as $departament) {
  27. $count_salary += $departament->get_Sum_Salary();
  28. }
  29. return $count_salary;
  30. }
  31.  
  32. public function get_Average_Salary()
  33. {
  34. return $this->get_Count_Salary()/count($this->departaments);
  35. }
  36.  
  37. public function get_Count_Coffee()
  38. {
  39. foreach ($this->departaments as $departament) {
  40. $count_coffee += $departament->get_Sum_Coffee();
  41. }
  42. return $count_coffee;
  43. }
  44.  
  45. public function get_Average_Coffee()
  46. {
  47. return $this->get_Count_Coffee()/count($this->departaments);
  48. }
  49.  
  50. public function get_Count_Pages()
  51. {
  52. foreach ($this->departaments as $departament) {
  53. $count_pages += $departament->get_Sum_Pages();
  54. }
  55. return $count_pages;
  56. }
  57.  
  58. public function get_Average_Pages()
  59. {
  60. return $this->get_Count_Pages()/count($this->departaments);
  61. }
  62.  
  63. public function get_Count_Salary_For_Page()
  64. {
  65. foreach ($this->departaments as $departament) {
  66. $count_salary_for_page += $departament->get_Salary_For_Page();
  67. }
  68. return $count_salary_for_page;
  69. }
  70.  
  71. public function get_Average_Salary_For_Page()
  72. {
  73. return $this->get_Count_Salary_For_Page()/count($this->departaments);
  74. }
  75.  
  76. public function print_Info()
  77. {
  78. $col2 = 12;
  79. $col3 = 15;
  80. foreach ($this->departaments as $departament) {
  81. echo padRight($departament->get_Departament_Name(), $col2);
  82. echo padLeft($departament->get_Sum_Workers(), $col2);
  83. echo padLeft($departament->get_Sum_Salary(), $col2);
  84. echo padLeft($departament->get_Sum_Coffee(), $col2);
  85. echo padLeft($departament->get_Sum_Pages(), $col2);
  86. echo padLeft($departament->get_Salary_For_Page(), $col3)."\n";
  87. }
  88. }
  89.  
  90. //Cократить в каждом департаменте 40% (округляя в большую сторону) инженеров,
  91. //преимущественно самого низкого ранга. Если инженер является боссом, вместо него
  92. //надо уволить другого инженера, не босса.
  93. public function Destruction_Workers($count_in_percent, $proffesion)
  94. {
  95. foreach ($this->departaments as $departament) {
  96. $count_workers = $departament->get_Workers_And_Destruction($count_in_percent, $proffesion);
  97. }
  98. }
  99. }
  100.  
  101.  
  102. class Departament
  103. {
  104. private $departament_name;
  105. private $workers = array();
  106.  
  107. public function __construct($name)
  108. {
  109. $this->set_Departament_Name($name);
  110. }
  111.  
  112. public function get_Departament_Name()
  113. {
  114. return $this->departament_name;
  115. }
  116.  
  117. public function set_Departament_Name($name)
  118. {
  119. $this->departament_name = $name;
  120. }
  121.  
  122. public function add_Workers($count, $rank, $proffesion, $is_Head)
  123. {
  124. for ($i = 0; $i < $count; $i++) {
  125. $worker = new $proffesion($rank, $is_Head);
  126. $this->workers[] = $worker;
  127. }
  128. }
  129.  
  130. public function get_Sum_Workers()
  131. {
  132. return count($this->workers);
  133. echo count($this->workers->salary);
  134. }
  135.  
  136. public function get_Sum_Salary()
  137. {
  138. foreach ($this->workers as $worker) {
  139. $sum_salary = $sum_salary+$worker->get_Salary($worker);
  140. }
  141. return $sum_salary;
  142. }
  143.  
  144. public function get_Sum_Coffee()
  145. {
  146. foreach ($this->workers as $worker) {
  147. $sum_coffee += $worker->get_Coffee($worker);
  148. }
  149. return $sum_coffee;
  150. }
  151.  
  152. public function get_Sum_Pages()
  153. {
  154. foreach ($this->workers as $worker) {
  155. $sum_pages += $worker->get_Pages($worker);
  156. }
  157. return $sum_pages;
  158. }
  159.  
  160. public function get_Salary_For_Page()
  161. {
  162. $salary = $this->get_Sum_Salary();
  163. $pages = $this->get_Sum_Pages();
  164. return round($salary/$pages, 3);
  165. }
  166.  
  167. public function get_Workers_And_Destruction($count_in_percent,$proffesion)
  168. {
  169. foreach ($this->workers as $worker) {
  170. if ($worker->get_Proffesion() == $proffesion) {
  171. $count_workers ++;
  172. }
  173. }
  174. $sum_to_destroy = ceil($count_workers*$count_in_percent-$count_workers);
  175. $i = 0;
  176. foreach ($this->workers as $number => $worker) {
  177. if ($worker->get_Proffesion() == $proffesion &&
  178. $worker->get_Rank() == '1' &&
  179. $i < $sum_to_destroy &&
  180. $worker->get_Is_Head() == false ) {
  181. unset($this->workers[$number]);
  182. $i++;
  183. }
  184. }
  185. foreach ($this->workers as $number => $worker) {
  186. if ($worker->get_Proffesion() == $proffesion &&
  187. $worker->get_Rank() == '2' &&
  188. $i < $sum_to_destroy &&
  189. $worker->get_Is_Head() == false ) {
  190. unset($this->workers[$number]);
  191. $i++;
  192. }
  193. }
  194. foreach ($this->workers as $number => $worker) {
  195. if ($worker->get_Proffesion() == $proffesion &&
  196. $worker->get_Rank() == '3' &&
  197. $i < $sum_to_destroy &&
  198. $worker->get_Is_Head() == false ) {
  199. unset($this->workers[$number]);
  200. $i++;
  201. }
  202. }
  203. }
  204. }
  205.  
  206.  
  207. abstract class Worker
  208. {
  209. private $rank;
  210. private $proffesion;
  211. private $is_Head;
  212. private $salary;
  213. private $consumed_coffee;
  214. private $made_pages;
  215.  
  216. public function __construct($rank, $proffesion, $is_Head, $salary, $consumed_coffe, $made_pages)
  217. {
  218. $this->set_Rank($rank);
  219. $this->set_Proffesion($proffesion);
  220. $this->set_Is_Head($is_Head);
  221. $this->set_Salary($salary);
  222. $this->set_Consumed_Coffee($consumed_coffe);
  223. $this->set_Made_Pages($made_pages);
  224. }
  225.  
  226. public function set_Rank($rank)
  227. {
  228. $this->rank = $rank;
  229. }
  230.  
  231. public function set_Proffesion($proffesion)
  232. {
  233. $this->proffesion = $proffesion;
  234. }
  235.  
  236. public function set_Is_Head($is_Head)
  237. {
  238. $this->is_Head = $is_Head;
  239. }
  240.  
  241. public function set_Salary($salary)
  242. {
  243. $this->salary = $salary;
  244. }
  245.  
  246. public function set_Consumed_Coffee($consumed_coffee)
  247. {
  248. $this->consumed_coffee = $consumed_coffee;
  249. }
  250.  
  251. public function set_Made_Pages($made_pages)
  252. {
  253. $this->made_pages = $made_pages;
  254. }
  255.  
  256. public function get_Salary($worker)
  257. {
  258. $rank = $this->rank;
  259. if ($rank == 1) {
  260. $coef_salary = 1;
  261. }elseif ($rank == 2) {
  262. $coef_salary = 1.25;
  263. }elseif ($rank == 3) {
  264. $coef_salary = 1.5;
  265. }
  266. if ($this->is_Head == true) {
  267. $coef_head = 1.5;
  268. }else{
  269. $coef_head = 1;
  270. }
  271. return $this->salary*$coef_salary*$coef_head;
  272. }
  273.  
  274. public function get_Coffee($worker)
  275. {
  276. if ($this->is_Head == true) {
  277. $coef_head = 2;
  278. }else{
  279. $coef_head = 1;
  280. }
  281. return $this->consumed_coffee*$coef_head;
  282. }
  283.  
  284. public function get_Pages($worker)
  285. {
  286. if ($this->is_Head == true) {
  287. $coef_head = 0;
  288. }else{
  289. $coef_head = 1;
  290. }
  291. return $this->made_pages*$coef_head;
  292. }
  293.  
  294. public function get_Proffesion()
  295. {
  296. return $this->proffesion;
  297. }
  298.  
  299. public function get_Rank()
  300. {
  301. return $this->rank;
  302. }
  303.  
  304. public function get_Is_Head()
  305. {
  306. return $this->is_Head;
  307. }
  308. }
  309.  
  310. class Manager extends Worker
  311. {
  312. public function __construct($rank, $is_Head)
  313. {
  314. parent::__construct($rank, 'Manager', $is_Head, 500, 20, 200);
  315. }
  316. }
  317.  
  318. class Marketer extends Worker
  319. {
  320. public function __construct($rank, $is_Head)
  321. {
  322. parent::__construct($rank, 'Marketer', $is_Head, 400, 15, 150);
  323. }
  324. }
  325. class Engineer extends Worker
  326. {
  327. public function __construct($rank, $is_Head)
  328. {
  329. parent::__construct($rank, 'Engineer', $is_Head, 200, 5, 50);
  330. }
  331. }
  332. class Analyst extends Worker
  333. {
  334. public function __construct($rank, $is_Head)
  335. {
  336. parent::__construct($rank, 'Analyst', $is_Head, 800, 50, 5);
  337. }
  338. }
  339.  
  340. $company = new Company;
  341.  
  342. $departament_purchase = new Departament("Purchase");
  343. $departament_purchase->add_Workers(9, 1, 'Manager', false);
  344. $departament_purchase->add_Workers(3, 2, 'Manager', false);
  345. $departament_purchase->add_Workers(2, 3, 'Manager', false);
  346. $departament_purchase->add_Workers(2, 1, 'Marketer', false);
  347. $departament_purchase->add_Workers(1, 2, 'Manager', true);
  348. $company->add_departament($departament_purchase);
  349.  
  350. $departament_sales = new Departament("Sales");
  351. $departament_sales->add_Workers(12, 1, 'Manager', false);
  352. $departament_sales->add_Workers(6, 1, 'Marketer', false);
  353. $departament_sales->add_Workers(3, 1, 'Analyst', false);
  354. $departament_sales->add_Workers(2, 2, 'Analyst', false);
  355. $departament_sales->add_Workers(1, 2, 'Marketer', true);
  356. $company->add_departament($departament_sales);
  357.  
  358. $departament_advertising = new Departament("advertising");
  359. $departament_advertising->add_Workers(15, 1, 'Marketer', false);
  360. $departament_advertising->add_Workers(10, 2, 'Marketer', false);
  361. $departament_advertising->add_Workers(8, 1, 'Manager', false);
  362. $departament_advertising->add_Workers(2, 1, 'Engineer', false);
  363. $departament_advertising->add_Workers(1, 3, 'Marketer', true);
  364. $company->add_departament($departament_advertising);
  365.  
  366. $departament_logistics = new Departament("Logistics");
  367. $departament_logistics->add_Workers(13, 1, 'Manager', false);
  368. $departament_logistics->add_Workers(5, 2, 'Manager', false);
  369. $departament_logistics->add_Workers(5, 1, 'Engineer', false);
  370. $departament_logistics->add_Workers(1, 1, 'Manager', true);
  371. $company->add_departament($departament_logistics);
  372.  
  373. function padRight($string, $length)
  374. {
  375. $long_string = strlen ($string);
  376. $x = $length-$long_string;
  377. $space = str_repeat(" ",$x);
  378. echo $string.$space;
  379. }
  380.  
  381. function padLeft($string, $length)
  382. {
  383. $long_string = strlen ($string);
  384. $x = $length-$long_string;
  385. $space = str_repeat(" ",$x);
  386. echo $space.$string;
  387. }
  388.  
  389. function printer($company)
  390. {
  391. $col1 = 12;
  392. $col2 = 12;
  393. $col3 = 16;
  394.  
  395. // Заголовок таблицы
  396. echo padRight ("Departaments",$col1).
  397. padLeft("Workers", $col2) .
  398. padLeft("Salary", $col2) .
  399. padLeft("Coffee", $col2) .
  400. padLeft("Pages", $col2) .
  401. padLeft("Salary/Pages", $col3) ."\n";
  402.  
  403. echo "----------------------------------------------------------------------\n";
  404. $company->print_Info();
  405. echo "----------------------------------------------------------------------\n";
  406. echo padRight('Average', $col2);
  407. echo padLeft($company->get_Average_Workers(), $col2);
  408. echo padLeft($company->get_Average_Salary(), $col2);
  409. echo padLeft($company->get_Average_Coffee(), $col2);
  410. echo padLeft($company->get_Average_Pages(), $col2);
  411. echo padLeft($company->get_Average_Salary_For_Page(), $col3)."\n";
  412. echo "----------------------------------------------------------------------\n";
  413. echo padRight('VSEGO', $col2);
  414. echo padLeft($company->get_Count_Workers(), $col2);
  415. echo padLeft($company->get_Count_Salary(), $col2);
  416. echo padLeft($company->get_Count_Coffee(), $col2);
  417. echo padLeft($company->get_Count_Pages(), $col2);
  418. echo padLeft($company->get_Count_Salary_For_Page(), $col3)."\n\n\n";
  419. }
  420.  
  421.  
  422. printer($company);
  423. $company->Destruction_Workers(1.4, Engineer);
  424. printer($company);
  425.  
  426.  
  427.  
  428.  
Success #stdin #stdout #stderr 0.01s 82880KB
stdin
Standard input is empty
stdout
Departaments     Workers      Salary      Coffee       Pages    Salary/Pages
----------------------------------------------------------------------
Purchase              17      9612.5         350        3100          3.101
Sales                 24       13550         610        3325          4.075
advertising           36       16300         575        5450          2.991
Logistics             24       11375         425        3850          2.955
----------------------------------------------------------------------
Average            25.25   12709.375         490     3931.25          3.2805
----------------------------------------------------------------------
VSEGO                101     50837.5        1960       15725          13.122


Departaments     Workers      Salary      Coffee       Pages    Salary/Pages
----------------------------------------------------------------------
Purchase              17      9612.5         350        3100          3.101
Sales                 24       13550         610        3325          4.075
advertising           35       16100         570        5400          2.981
Logistics             22       10975         415        3750          2.927
----------------------------------------------------------------------
Average             24.5   12559.375      486.25     3893.75           3.271
----------------------------------------------------------------------
VSEGO                 98     50237.5        1945       15575          13.084


stderr
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_coffee in /home/UH8YEW/prog.php on line 147
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_coffee in /home/UH8YEW/prog.php on line 147
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_coffee in /home/UH8YEW/prog.php on line 147
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_coffee in /home/UH8YEW/prog.php on line 147
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: count_workers in /home/UH8YEW/prog.php on line 14
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: count_salary in /home/UH8YEW/prog.php on line 27
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_coffee in /home/UH8YEW/prog.php on line 147
PHP Notice:  Undefined variable: count_coffee in /home/UH8YEW/prog.php on line 40
PHP Notice:  Undefined variable: sum_coffee in /home/UH8YEW/prog.php on line 147
PHP Notice:  Undefined variable: sum_coffee in /home/UH8YEW/prog.php on line 147
PHP Notice:  Undefined variable: sum_coffee in /home/UH8YEW/prog.php on line 147
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: count_pages in /home/UH8YEW/prog.php on line 53
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: count_salary_for_page in /home/UH8YEW/prog.php on line 66
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: count_workers in /home/UH8YEW/prog.php on line 14
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: count_salary in /home/UH8YEW/prog.php on line 27
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_coffee in /home/UH8YEW/prog.php on line 147
PHP Notice:  Undefined variable: count_coffee in /home/UH8YEW/prog.php on line 40
PHP Notice:  Undefined variable: sum_coffee in /home/UH8YEW/prog.php on line 147
PHP Notice:  Undefined variable: sum_coffee in /home/UH8YEW/prog.php on line 147
PHP Notice:  Undefined variable: sum_coffee in /home/UH8YEW/prog.php on line 147
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: count_pages in /home/UH8YEW/prog.php on line 53
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: count_salary_for_page in /home/UH8YEW/prog.php on line 66
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Use of undefined constant Engineer - assumed 'Engineer' in /home/UH8YEW/prog.php on line 423
PHP Notice:  Undefined variable: count_workers in /home/UH8YEW/prog.php on line 174
PHP Notice:  Undefined variable: count_workers in /home/UH8YEW/prog.php on line 174
PHP Notice:  Undefined variable: count_workers in /home/UH8YEW/prog.php on line 174
PHP Notice:  Undefined variable: count_workers in /home/UH8YEW/prog.php on line 174
PHP Notice:  Undefined variable: count_workers in /home/UH8YEW/prog.php on line 171
PHP Notice:  Undefined variable: count_workers in /home/UH8YEW/prog.php on line 171
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_coffee in /home/UH8YEW/prog.php on line 147
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_coffee in /home/UH8YEW/prog.php on line 147
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_coffee in /home/UH8YEW/prog.php on line 147
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_coffee in /home/UH8YEW/prog.php on line 147
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: count_workers in /home/UH8YEW/prog.php on line 14
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: count_salary in /home/UH8YEW/prog.php on line 27
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_coffee in /home/UH8YEW/prog.php on line 147
PHP Notice:  Undefined variable: count_coffee in /home/UH8YEW/prog.php on line 40
PHP Notice:  Undefined variable: sum_coffee in /home/UH8YEW/prog.php on line 147
PHP Notice:  Undefined variable: sum_coffee in /home/UH8YEW/prog.php on line 147
PHP Notice:  Undefined variable: sum_coffee in /home/UH8YEW/prog.php on line 147
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: count_pages in /home/UH8YEW/prog.php on line 53
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: count_salary_for_page in /home/UH8YEW/prog.php on line 66
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: count_workers in /home/UH8YEW/prog.php on line 14
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: count_salary in /home/UH8YEW/prog.php on line 27
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_coffee in /home/UH8YEW/prog.php on line 147
PHP Notice:  Undefined variable: count_coffee in /home/UH8YEW/prog.php on line 40
PHP Notice:  Undefined variable: sum_coffee in /home/UH8YEW/prog.php on line 147
PHP Notice:  Undefined variable: sum_coffee in /home/UH8YEW/prog.php on line 147
PHP Notice:  Undefined variable: sum_coffee in /home/UH8YEW/prog.php on line 147
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: count_pages in /home/UH8YEW/prog.php on line 53
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: count_salary_for_page in /home/UH8YEW/prog.php on line 66
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155
PHP Notice:  Undefined variable: sum_salary in /home/UH8YEW/prog.php on line 139
PHP Notice:  Undefined variable: sum_pages in /home/UH8YEW/prog.php on line 155