You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
3. Also inside the folder create a new JavaScript file called "pizza.js"
228
229
4. Remember to Include the pizza.js script in the html file
229
230
5. Write a log statement, so you know that your javascript code is running:
231
+
230
232
`console.log("I love pizza");`
233
+
231
234
6. Create a variable to store the name of your favourite pizza
232
235
7. Create a variable to store the price of the pizza
233
236
8. Now log a statement to the console that will show the chef the entire pizza order in a language they understand, e.g. like this:
237
+
234
238
`New pizza order: <name of pizza>. The price of the pizza is: <price of pizza>`
235
239
236
240
#### Part 2
237
241
238
-
Now we will modify the program so that you can order multiple pizzas and also decide if the pizzas should be family size
242
+
Now we will modify the program so you can order multiple pizzas and decide whether the order is takeaway.
239
243
240
244
1. Create a new variable to store the amount of pizzas you would like to order
245
+
2. Create a new variable to store whether or not the order is for takeaway
246
+
3. Now write a formula to calculate the total price of your pizza order, and save it in a variable called totalPrice
247
+
4. Modify the log statement for the chef so it includes whether or not the order is for takeaway, and now show the total price of the order:
241
248
242
-
2. Create a new variable to store whether or not you would to order a family size pizza.
243
-
244
-
3. Now write a formula to calculate the total price of your pizza order, and save it in a variable called totalPrice (if the pizza is family size the prize of the pizza is doubled.
245
-
246
-
4. Modify the log statement for the chef so it includes whether or not the pizza is family size, and now show the total price of the order
247
-
`New pizza order: <amount of pizzas> <family or not?> <name of pizza>. Total cost for the order is: <total price>`
249
+
`New pizza order (takeaway: <takeaway or not?>): <amount of pizzas> <name of pizza>. Total cost for the order is: <total price>`
248
250
249
-
5. Try to change the price of the pizza and if the pizza should be family size, and then check if the total price is calculated correctly.
251
+
5. Try to change the price of the pizza and then check if the total price is calculated correctly
0 commit comments