Sales
I have to pay X €
Buy some clothes, get a discount and pay the bill!
- Step 1: create 5 variables for all the items we are going to buy
- Trousers: 85€
- Sweater: 62€
- Coat: 120€
- Shirt: 25€
- Shoes: 105€
- Step 2: create a variable
discount
(for the discount percentage) with value 70 - Step 3: calculate the total amount to pay by adding up the items and applying the discount. Assign the result to a new variable
bill
. - Step 4: round the result to the nearest integer
- Step 5: replace the content of the
<span>
with the value of thebill
variable