Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need a PHP solution for the below requireemnt Pizza Menu A restaurant has the following pizza menu: Small Medium Large Plain 3.50 6.25 8.00 Vegetarian

Need a PHP solution for the below requireemnt

Pizza Menu A restaurant has the following pizza menu:

Small

Medium

Large

Plain

3.50

6.25

8.00

Vegetarian

4.35

7.60

12.00

Pepperoni

7.25

10.75

14.00

Hawaiian

8.00

12.50

15.50

Req't #

Requirement

You shall write a single PHP document that fulfills ALL these requirements. Using a minimum of a one function.

Hint:

The document shall be named pizzaOrder.php.

All the price data in the menu shown above shall be stored within the script in a two-dimensional associative array called $pizzaPrices.

Anytime the price data is needed, it shall be retrieved programmatically from this array. It shall not be "hardcoded" anywhere else in the PHP document. To clarify, if the array contained different prices than the ones shown above, whatever prices are in the array would be used in all calculations and displays.

When the pizzaOrder.php script is run with no form data submitted, it shall display the pizza menu and an order form.

The pizza menu shall appear in table form as shown above. The price data appearing in the table shall be obtained programmatically from the $pizzaPrices array.

The order form shall allow selection of the kind of pizza (plain, vegetarian, pepperoni, or hawaiian).

The order form shall allow selection of the size of pizza (small, medium, or large).

When the user submits the form, the script shall run (again). The response shall display a receipt.

The receipt shall include the kind of pizza.

The receipt shall include the size of the pizza.

The receipt shall include the price of the pizza. This price shall be retrieved programmatically from the $pizzaPrices array.

The receipt shall include the amount of sales tax at 9.75%

The receipt shall include the total price of the order.

The receipt shall be in the following format:

Hawaiian

Medium

$12.50

$1.22

$13.72

All monetary amounts in the receipt shall appear in the following format: $13.72 Hint: Use the number_format() function (ending zero 13.70). See the PHP Manual ( http://php.net/manual/en/function.number-format.php (Links to an external site.)Links to an external site.) for usage.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions

Question

=+employee to take on the international assignment?

Answered: 1 week ago

Question

=+differences in home- and host-country costs of living?

Answered: 1 week ago