This commit is contained in:
@@ -20,12 +20,17 @@
|
||||
<p>Folgende Definitionen steht dir zur Verfügung:</p>
|
||||
<p>
|
||||
<code>
|
||||
'use strict'<br />
|
||||
const TAX_PERCENTAGE = 22<br />
|
||||
let price = 150<br />
|
||||
/* your code here */<br />
|
||||
console.log(totalPrice)<br />
|
||||
</code>
|
||||
'use strict'
|
||||
|
||||
const TAX_PERCENTAGE = 22
|
||||
|
||||
let price = 150
|
||||
|
||||
/* your code here */
|
||||
|
||||
console.log(totalPrice)
|
||||
|
||||
|
||||
</p>
|
||||
</div>
|
||||
<div class="output alert alert-secondary my-3"></div>
|
||||
@@ -34,12 +39,22 @@
|
||||
<script>
|
||||
'use strict';
|
||||
const TAX_PERCENTAGE = 22;
|
||||
const TAX_RATE = 1 + TAX_PERCENTAGE / 100; // => 1.22
|
||||
|
||||
|
||||
const outputEl = document.querySelector('.output');
|
||||
|
||||
const price = 150;
|
||||
|
||||
/* your code here */
|
||||
// const totalPrice = price + (price * TAX_PERCENTAGE) / 100;
|
||||
const totalPrice = price * TAX_RATE;
|
||||
|
||||
|
||||
|
||||
console.log(totalPrice);
|
||||
|
||||
outputEl.textContent = `total price: $${totalPrice}`;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</code>
|
||||
Reference in New Issue
Block a user