diff --git a/curriculum/challenges/english/25-front-end-development/lab-currency-converter/67eaa957114d373deb3a9149.md b/curriculum/challenges/english/25-front-end-development/lab-currency-converter/67eaa957114d373deb3a9149.md index 594a1d38ae0..7862f077aea 100644 --- a/curriculum/challenges/english/25-front-end-development/lab-currency-converter/67eaa957114d373deb3a9149.md +++ b/curriculum/challenges/english/25-front-end-development/lab-currency-converter/67eaa957114d373deb3a9149.md @@ -15,8 +15,24 @@ demoType: onClick 1. Your `CurrencyConverter` component should render an `input` element to accept the amount to be converted from. 2. Your `input` element should accept numbers. 3. Your `CurrencyConverter` component should render two `select` elements to choose the currency to convert **from** and **to**. -4. Your `select` element should include options for **at least** `USD`, `EUR`, `GBP`, and `JPY`. - 1. You may use any exchange rate, provided there is no one-to-one mapping between the currencies. +4. Your `select` element should include options for **at least** `USD`, `EUR`, `GBP`, and `JPY`. You may use any exchange rate, provided there is no one-to-one mapping between the currencies. Here are some examples of good and bad mappings: + + ```js + const badMapping = { + USD: 1, + EUR: 1, + GBP: 1, + JPY: 1 + }; + + const goodMapping = { + USD: 1, + EUR: 0.92, + GBP: 0.78, + JPY: 156.7 + }; + ``` + 5. Your `CurrencyConverter` component should memoize the calculation of the converted amounts for the **from** currency such that a change in the **to** `select` option will not recalculate the converted amounts. 6. Your `CurrencyConverter` component should render an element showing the converted amount in the format `XX.XX CCC`, where `XX.XX` is the converted amount and `CCC` is the currency code. 7. The converted amount should be rounded to two decimal places.