Question: class Pizza { public $size; / / Corrected: Added $ for property and removed 'public' keyword redundancy public $type; / / Corrected: Added $ for
class Pizza
public $size; Corrected: Added $ for property and removed 'public' keyword redundancy
public $type; Corrected: Added $ for property and removed 'public' keyword redundancy
Method to set the size of the pizza
public function setsize$newsize
$thissize $newsize; Corrected: Used $this to refer to the current object
Method to set the type of the pizza
public function settype$newtype
$thistype $newtype; Corrected: Used $this to refer to the current object
Method to get the size of the pizza
public function getsize
return $thissize; Returns the size of the pizza
Method to get the type of the pizza
public function gettype
return $thistype; Returns the type of the pizza
Create a $pizza object from the Pizza class.
Create the $pizza object just below this problem.
This problem has no output.
: Set the $pizza size to "medium".
You can do this just below this problem.
This problem has no output.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
