From f94571efd92c5156c1be5db641314e1b9ef5500d Mon Sep 17 00:00:00 2001 From: Cas <140918847+Cas-Romero@users.noreply.github.com> Date: Mon, 16 Jun 2025 09:43:39 -0500 Subject: [PATCH] fix(curriculum): combined sentences and added examples (#60858) Co-authored-by: Ilenia <26656284+ilenia-magoni@users.noreply.github.com> --- .../67eaa957114d373deb3a9149.md | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) 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.