fork download
  1. <html>
  2. <head>
  3. <meta charset="UTF-8"/>
  4. <title></title>
  5. <link rel="stylesheet" href="css/reset.css"/>
  6. <link rel="stylesheet" href="css/bootstrap.css"/>
  7. <script src="js/jquery-3.2.1.min.js"></script>
  8. <script src="js/bootstrap.js"></script>
  9. <style type="text/css">
  10. body {background-color: black;}
  11. </style>
  12. </head>
  13.  
  14. <?php
  15. class Employee {
  16. public $name;
  17. public $rate;
  18. public $hours = array();
  19.  
  20. public function __construct($name, $rate){
  21. $this->name = $name;
  22. $this->rate = $rate;
  23. }
  24.  
  25. public function getTotalHoursWorked(){
  26. return array_sum($this->hours);
  27. }
  28.  
  29. public function getSalary(){
  30. $hours = $this->getTotalHoursWorked();
  31. $salary = $hours * $this->rate;
  32. return $salary;
  33. }
  34. }
  35.  
  36. $ivan = new Employee('Иванов Иван', 10);
  37. $ivan->hours = array(40,40,40,40);
  38.  
  39. $peter = new Employee('Петров Пётр', 8);
  40. $peter->hours = array(40,10,40,50);
  41.  
  42. $roman = new Employee('Романов Роман', 12);
  43. $roman->hours = array(0, 0, 50, 80);
  44. ?>
  45.  
  46. <body>
  47. <div class="container">
  48. <div class="row well">
  49. <h4>ООП в пехопе</h4>
  50. <table class="table table-hover">
  51. <thead>
  52. <tr>
  53. <th>Имя</th>
  54. <th>Ставка</th>
  55. <th>Отработано часов</th>
  56. <th>Получено $</th>
  57. </tr>
  58. </thead>
  59. <tbody>
  60. <tr>
  61. <td><?php echo "$ivan->name"; ?></td>
  62. <td><?php echo "$ivan->rate"; ?></td>
  63. <td><?php echo "{$ivan->getTotalHoursWorked()}"; ?></td>
  64. <td><?php echo "{$ivan->getSalary()}"; ?></td>
  65. </tr>
  66. <tr>
  67. <td><?php echo "$peter->name"; ?></td>
  68. <td><?php echo "$peter->rate"; ?></td>
  69. <td><?php echo "{$peter->getTotalHoursWorked()}"; ?></td>
  70. <td><?php echo "{$peter->getSalary()}"; ?></td>
  71. </tr>
  72. <tr>
  73. <td><?php echo "$roman->name"; ?></td>
  74. <td><?php echo "$roman->rate"; ?></td>
  75. <td><?php echo "{$roman->getTotalHoursWorked()}"; ?></td>
  76. <td><?php echo "{$roman->getSalary()}"; ?></td>
  77. </tr>
  78. </tbody>
  79. </table>
  80. </div>
  81. </div>
  82. </body>
  83.  
  84. </html>
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class, interface, or enum expected
<html>
^
Main.java:1: error: class, interface, or enum expected
<html>
 ^
Main.java:10: error: class, interface, or enum expected
    	body {background-color: black;}
    	                              ^
Main.java:16: error: <identifier> expected
        public $name;
                    ^
Main.java:17: error: <identifier> expected
        public $rate;
                    ^
Main.java:18: error: <identifier> expected
        public $hours = array();
                     ^
Main.java:20: error: <identifier> expected
        public function __construct($name, $rate){
                                         ^
Main.java:20: error: <identifier> expected
        public function __construct($name, $rate){
                                                ^
Main.java:21: error: not a statement
            $this->name = $name;
            ^
Main.java:22: error: not a statement
            $this->rate = $rate;
            ^
Main.java:36: error: class, interface, or enum expected
    $ivan = new Employee('?????? ????', 10);
    ^
Main.java:36: error: unclosed character literal
    $ivan = new Employee('?????? ????', 10);
                         ^
Main.java:36: error: unclosed character literal
    $ivan = new Employee('?????? ????', 10);
                                     ^
Main.java:37: error: class, interface, or enum expected
    $ivan->hours = array(40,40,40,40);
    ^
Main.java:39: error: class, interface, or enum expected
    $peter = new Employee('?????? ????', 8);
    ^
Main.java:39: error: unclosed character literal
    $peter = new Employee('?????? ????', 8);
                          ^
Main.java:39: error: unclosed character literal
    $peter = new Employee('?????? ????', 8);
                                      ^
Main.java:40: error: class, interface, or enum expected
    $peter->hours = array(40,10,40,50);
    ^
Main.java:42: error: class, interface, or enum expected
    $roman = new Employee('??????? ?????', 12);
    ^
Main.java:42: error: unclosed character literal
    $roman = new Employee('??????? ?????', 12);
                          ^
Main.java:42: error: unclosed character literal
    $roman = new Employee('??????? ?????', 12);
                                        ^
Main.java:43: error: class, interface, or enum expected
    $roman->hours = array(0, 0, 50, 80);
    ^
Main.java:44: error: class, interface, or enum expected
?>
^
Main.java:47: error: <identifier> expected
	<div class="container">
	          ^
Main.java:47: error: illegal start of type
	<div class="container">
	           ^
Main.java:47: error: <identifier> expected
	<div class="container">
	                      ^
Main.java:47: error: ';' expected
	<div class="container">
	                       ^
Main.java:48: error: <identifier> expected
		<div class="row well">
		    ^
Main.java:48: error: illegal start of type
		<div class="row well">
		          ^
Main.java:48: error: <identifier> expected
		<div class="row well">
		           ^
Main.java:48: error: ';' expected
		<div class="row well">
		                     ^
Main.java:49: error: '(' expected
			<h4>??? ? ??????</h4>
			          ^
Main.java:49: error: illegal start of type
			<h4>??? ? ??????</h4>
			                 ^
Main.java:49: error: ';' expected
			<h4>??? ? ??????</h4>
			                    ^
Main.java:50: error: > expected
            <table class="table table-hover">
                  ^
Main.java:50: error: illegal start of type
            <table class="table table-hover">
                   ^
Main.java:50: error: <identifier> expected
            <table class="table table-hover">
                        ^
Main.java:50: error: '(' expected
            <table class="table table-hover">
                         ^
Main.java:50: error: illegal start of type
            <table class="table table-hover">
                                            ^
Main.java:50: error: <identifier> expected
            <table class="table table-hover">
                                             ^
Main.java:51: error: ';' expected
                <thead>
                 ^
Main.java:51: error: illegal start of type
                <thead>
                      ^
Main.java:51: error: <identifier> expected
                <thead>
                       ^
Main.java:52: error: ';' expected
                    <tr>
                     ^
Main.java:52: error: illegal start of type
                    <tr>
                       ^
Main.java:52: error: <identifier> expected
                    <tr>
                        ^
Main.java:53: error: ';' expected
                        <th>???</th>
                         ^
Main.java:53: error: illegal start of type
                        <th>???</th>
                           ^
Main.java:53: error: ';' expected
                        <th>???</th>
                               ^
Main.java:53: error: <identifier> expected
                        <th>???</th>
                                ^
Main.java:53: error: <identifier> expected
                        <th>???</th>
                                   ^
Main.java:54: error: illegal start of type
                        <th>??????</th>
                                   ^
Main.java:54: error: '(' expected
                        <th>??????</th>
                                      ^
Main.java:55: error: '(' expected
                        <th>?????????? ?????</th>
                                            ^
Main.java:55: error: <identifier> expected
                        <th>?????????? ?????</th>
                                             ^
Main.java:55: error: <identifier> expected
                        <th>?????????? ?????</th>
                                                ^
Main.java:56: error: '(' expected
                        <th>???????? $</th>
                                      ^
Main.java:56: error: <identifier> expected
                        <th>???????? $</th>
                                       ^
Main.java:56: error: <identifier> expected
                        <th>???????? $</th>
                                          ^
Main.java:57: error: <identifier> expected
                    </tr>
                     ^
Main.java:57: error: <identifier> expected
                    </tr>
                        ^
Main.java:58: error: <identifier> expected
                </thead>
                 ^
Main.java:58: error: <identifier> expected
                </thead>
                       ^
Main.java:60: error: illegal start of type
                    <tr>
                    ^
Main.java:61: error: illegal start of expression
                        <td><?php echo "$ivan->name"; ?></td>
                        ^
Main.java:61: error: illegal start of type
                        <td><?php echo "$ivan->name"; ?></td>
                             ^
Main.java:61: error: illegal start of expression
                        <td><?php echo "$ivan->name"; ?></td>
                              ^
Main.java:61: error: '(' expected
                        <td><?php echo "$ivan->name"; ?></td>
                                       ^
Main.java:61: error: illegal start of type
                        <td><?php echo "$ivan->name"; ?></td>
                                                      ^
Main.java:61: error: ';' expected
                        <td><?php echo "$ivan->name"; ?></td>
                                                       ^
Main.java:61: error: <identifier> expected
                        <td><?php echo "$ivan->name"; ?></td>
                                                         ^
Main.java:61: error: <identifier> expected
                        <td><?php echo "$ivan->name"; ?></td>
                                                            ^
Main.java:62: error: illegal start of type
                        <td><?php echo "$ivan->rate"; ?></td>
                            ^
Main.java:62: error: illegal start of type
                        <td><?php echo "$ivan->rate"; ?></td>
                             ^
Main.java:62: error: illegal start of expression
                        <td><?php echo "$ivan->rate"; ?></td>
                              ^
Main.java:62: error: '(' expected
                        <td><?php echo "$ivan->rate"; ?></td>
                                       ^
Main.java:62: error: illegal start of type
                        <td><?php echo "$ivan->rate"; ?></td>
                                                      ^
Main.java:62: error: ';' expected
                        <td><?php echo "$ivan->rate"; ?></td>
                                                       ^
Main.java:62: error: <identifier> expected
                        <td><?php echo "$ivan->rate"; ?></td>
                                                         ^
Main.java:62: error: <identifier> expected
                        <td><?php echo "$ivan->rate"; ?></td>
                                                            ^
Main.java:63: error: illegal start of type
                        <td><?php echo "{$ivan->getTotalHoursWorked()}"; ?></td>
                            ^
Main.java:63: error: illegal start of type
                        <td><?php echo "{$ivan->getTotalHoursWorked()}"; ?></td>
                             ^
Main.java:63: error: illegal start of expression
                        <td><?php echo "{$ivan->getTotalHoursWorked()}"; ?></td>
                              ^
Main.java:63: error: '(' expected
                        <td><?php echo "{$ivan->getTotalHoursWorked()}"; ?></td>
                                       ^
Main.java:63: error: illegal start of type
                        <td><?php echo "{$ivan->getTotalHoursWorked()}"; ?></td>
                                                                         ^
Main.java:63: error: ';' expected
                        <td><?php echo "{$ivan->getTotalHoursWorked()}"; ?></td>
                                                                          ^
Main.java:63: error: <identifier> expected
                        <td><?php echo "{$ivan->getTotalHoursWorked()}"; ?></td>
                                                                            ^
Main.java:63: error: <identifier> expected
                        <td><?php echo "{$ivan->getTotalHoursWorked()}"; ?></td>
                                                                               ^
Main.java:64: error: illegal start of type
                        <td><?php echo "{$ivan->getSalary()}"; ?></td>
                            ^
Main.java:64: error: illegal start of type
                        <td><?php echo "{$ivan->getSalary()}"; ?></td>
                             ^
Main.java:64: error: illegal start of expression
                        <td><?php echo "{$ivan->getSalary()}"; ?></td>
                              ^
Main.java:64: error: '(' expected
                        <td><?php echo "{$ivan->getSalary()}"; ?></td>
                                       ^
Main.java:64: error: illegal start of type
                        <td><?php echo "{$ivan->getSalary()}"; ?></td>
                                                               ^
Main.java:64: error: ';' expected
                        <td><?php echo "{$ivan->getSalary()}"; ?></td>
                                                                ^
Main.java:64: error: <identifier> expected
                        <td><?php echo "{$ivan->getSalary()}"; ?></td>
                                                                  ^
Main.java:64: error: <identifier> expected
                        <td><?php echo "{$ivan->getSalary()}"; ?></td>
                                                                     ^
Main.java:65: error: <identifier> expected
                    </tr>
                     ^
Main.java:65: error: <identifier> expected
                    </tr>
                        ^
Main.java:67: error: illegal start of type
                        <td><?php echo "$peter->name"; ?></td>
                        ^
Main.java:67: error: illegal start of expression
                        <td><?php echo "$peter->name"; ?></td>
                            ^
100 errors
stdout
Standard output is empty