Skip to content
This repository was archived by the owner on Oct 26, 2020. It is now read-only.

Commit bc62e64

Browse files
committed
4-taxt.js is done
1 parent b55ae4a commit bc62e64

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

week-1/2-mandatory/4-tax.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
Sales tax is 20% of the price of the product
66
*/
77

8-
function calculateSalesTax() {}
8+
function calculateSalesTax(priceOfProduct) {
9+
10+
let salesTax=(20/100*priceOfProduct)+priceOfProduct;
11+
return salesTax;
12+
}
913

1014
/*
1115
CURRENCY FORMATTING
@@ -17,7 +21,11 @@ function calculateSalesTax() {}
1721
Remember that the prices must include the sales tax (hint: you already wrote a function for this!)
1822
*/
1923

20-
function formatCurrency() {}
24+
function formatCurrency(a) {
25+
var price=calculateSalesTax(a);
26+
27+
return ${price.toFixed(2)}`;
28+
}
2129

2230
/* ======= TESTS - DO NOT MODIFY =====
2331
There are some Tests in this file that will help you work out if your code is working.

0 commit comments

Comments
 (0)