Question: / * Place your output code inside the HTML list items for each question comment. Non - output PHP logic & values can be placed

/*
Place your output code inside the HTML list items for
each question comment.
Non-output PHP logic & values can be placed underneath
the questions near the top of the file.
Do not change any of the other code in this file.
*/
/*01: create a class named Pizza that has two
properties: size and type.
Create the class just below this problem.
This problem has no output.
*/
/*02: Add set_size and set_type methods to the Pizza class
above. This problem has no output.
*/
/*03: Add get_size and get_type methods to the Pizza class
above. This problem has no output.
*/
/*04: Create a $pizza object from the Pizza class.
Create the $pizza object just below this problem.
This problem has no output.
*/
/*05: Set the $pizza size to "medium".
You can do this just below this problem.
This problem has no output.
*/
/*06: Set the $pizza type to "Pepperoni".
You can do this just below this problem.
This problem has no output.
*/
/*06: Call the get_size method and output the
returned value in appropriate HTML list item below. */
/*07: Call the get_type method and output the
returned value in appropriate HTML list item below. */
/*08: Add a method to the Pizza class above named serve.
The serve method should output:
"Here's your {type} pizza!"
Replace {type} with the value of the type
property.
Call the serve method and output the
returned value in appropriate HTML list item below.
*/
/*09: Add a private property named
slices to the Pizza class above.
Next, add a method named get_slices
to the Pizza class.
The method should return the number
of slices.
A small pizza has 6 slices.
A medium pizza has 8 slices.
A large pizza has 10 slices.
Set the value of the private slices
property when the size is set.
Call the get_slices method and
output the returned value in
appropriate HTML list item below.
*/
/*10: Add a method named description
to the Pizza class above.
The method should return:
"My pizza is a {size}{type} and
has {slices} slices!"
Replace {slices} with the number of slices.
Replace {size} and {type} with their
appropriate values.
Create a $myPizza object.
Set the size to "large".
Set the type to "Supreme".
Call the description method for $myPizza
and output the returned value in
appropriate HTML list item below.
?>*/

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To implement the task described we will create a PHP script that follows the sequence given ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!