Skip to content

Commit 49d8105

Browse files
Merge pull request #222 from HackYourFuture-CPH/fix-intro-to-js-week-1-exercise
fix: intro-to-js week-1 session exercises - small adjustments
2 parents aebef48 + dbe2da2 commit 49d8105

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

courses/foundation/intro-to-javascript/week1/session-plan.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ const pizzaPriceDiscounted = pizzaprice - 10;
216216
const users = ["peter", "Johnny", "Børge"];
217217

218218
const lastUser = users[3];
219+
console.log(lastUser);
219220
```
220221

221222
### Pizza project
@@ -227,23 +228,24 @@ const lastUser = users[3];
227228
3. Also inside the folder create a new JavaScript file called "pizza.js"
228229
4. Remember to Include the pizza.js script in the html file
229230
5. Write a log statement, so you know that your javascript code is running:
231+
230232
`console.log("I love pizza");`
233+
231234
6. Create a variable to store the name of your favourite pizza
232235
7. Create a variable to store the price of the pizza
233236
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+
234238
`New pizza order: <name of pizza>. The price of the pizza is: <price of pizza>`
235239

236240
#### Part 2
237241

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.
239243

240244
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:
241248

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>`
248250

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

Comments
 (0)