This repository was archived by the owner on Oct 26, 2020. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 Write a function that converts a price to USD (exchange rate is 1.4 $ to £)
66*/
77
8- function convertToUSD ( ) { }
8+ function convertToUSD ( price ) {
9+ let convertToUs = 1.4 * price ; ;
10+ return convertToUs ;
11+ }
912
1013/*
1114 CURRENCY FORMATTING
@@ -16,7 +19,12 @@ function convertToUSD() {}
1619 Find a way to add 1% to all currency conversions (think about the DRY principle)
1720*/
1821
19- function convertToBRL ( ) { }
22+ function convertToBRL ( price ) {
23+ let percentOfPrice = ( 1 / 100 ) * ( 5.7 * price ) ;
24+ let convertToBrazil = 5.7 * price ;
25+ let total = percentOfPrice + convertToBrazil ;
26+ return total ;
27+ }
2028
2129/* ======= TESTS - DO NOT MODIFY =====
2230There are some Tests in this file that will help you work out if your code is working.
You can’t perform that action at this time.
0 commit comments