We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b55ae4a commit bc62e64Copy full SHA for bc62e64
1 file changed
week-1/2-mandatory/4-tax.js
@@ -5,7 +5,11 @@
5
Sales tax is 20% of the price of the product
6
*/
7
8
-function calculateSalesTax() {}
+function calculateSalesTax(priceOfProduct) {
9
+
10
+ let salesTax=(20/100*priceOfProduct)+priceOfProduct;
11
+ return salesTax;
12
+}
13
14
/*
15
CURRENCY FORMATTING
@@ -17,7 +21,11 @@ function calculateSalesTax() {}
17
21
Remember that the prices must include the sales tax (hint: you already wrote a function for this!)
18
22
19
23
20
-function formatCurrency() {}
24
+function formatCurrency(a) {
25
+var price=calculateSalesTax(a);
26
27
+return `£${price.toFixed(2)}`;
28
29
30
/* ======= TESTS - DO NOT MODIFY =====
31
There are some Tests in this file that will help you work out if your code is working.
0 commit comments