質問編集履歴

1

マークダウン

2021/01/23 07:33

投稿

monoymd
monoymd

スコア2

test CHANGED
File without changes
test CHANGED
@@ -12,7 +12,57 @@
12
12
 
13
13
 
14
14
 
15
+ ```
15
16
 
17
+ <?php
18
+
19
+ class Menu {
20
+
21
+ private $name;
22
+
23
+ private $price;
24
+
25
+ private $image;
26
+
27
+ private $orderCount = 0;
28
+
29
+
30
+
31
+ public function __construct($name, $price, $image) {
32
+
33
+ $this->name = $name;
34
+
35
+ $this->price = $price;
36
+
37
+ $this->image = $image;
38
+
39
+ }
40
+
41
+
42
+
43
+ public function hello() {
44
+
45
+ echo '私は'.$this->name.'です';
46
+
47
+ }
48
+
49
+
50
+
51
+ public function getName() {
52
+
53
+ return $this->name;
54
+
55
+ }
56
+
57
+
58
+
59
+ public function getImage() {
60
+
61
+ return $this->image;
62
+
63
+ }
64
+
65
+
16
66
 
17
67
  public function getOrderCount() {
18
68
 
@@ -38,15 +88,19 @@
38
88
 
39
89
 
40
90
 
41
- // getTotalPriceメソッドを定義してください
42
-
43
- public function getTotalPrice(){
91
+ public function getTotalPrice() {
44
92
 
45
93
  return $this->getTaxIncludedPrice() * $this->orderCount;
46
94
 
47
95
  }
48
96
 
97
+
49
98
 
99
+ }
100
+
101
+ ?>
102
+
103
+ ```
50
104
 
51
105
 
52
106
 
@@ -68,13 +122,13 @@
68
122
 
69
123
 
70
124
 
71
-
125
+ ```
72
126
 
73
127
  public function getTotalPrice(){
74
128
 
75
129
  return $this->getTaxIncludedPrice() * $this->getOrderCount();
76
130
 
77
-
131
+ ```
78
132
 
79
133
  でもいいのでは?と思いました。
80
134