Homework

Burger order system

Write an HTML page which asks the user two questions using prompt:

  1. What burger would you like?

  2. Would you like fries with that (yes/no)?

For the first question, the user can type in anything. For the second question, we expect a "yes" or "no" answer.

Example 1

Let's say the user typed in "cheeseburger" for the first question.

If they said "yes" to fries your website should display this text:

So that's 1 cheeseburger with fries.

If they said "no" to fries, it should say:

So that's 1 cheeseburger, no fries.

Example 2

Let's say the user typed in "vege burger" for the first question.

If they said "yes" to fries your website should display this text:

So that's 1 vege burger with fries.

If they said "no" to fries, it should say:

So that's 1 vege burger, no fries.

Optional extensions:

  • If they said yes to fries, also ask what size fries.

  • Calculate the price based on their order, and show the price too.

Last updated