Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Currency Exchange]: Reworded task explanations #2626

Merged
merged 8 commits into from
Dec 14, 2021
17 changes: 8 additions & 9 deletions exercises/concept/currency-exchange/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ Your friend Chandler plans to visit exotic countries all around the world. Sadly
Create the `exchange_money()` function, taking 2 parameters:

1. `budget` : The amount of money you are planning to exchange.
2. `exchange_rate` : Unit value of the foreign currency.
2. `exchange_rate` : The amount of domestic currency that equals one unit of foreign currency.
BethanyG marked this conversation as resolved.
Show resolved Hide resolved

This function should return the value of the exchanged currency.

**Note:** If your currency is USD and you want to exchange USD for EUR with an exchange rate of `1.20`, then `1.20 USD == 1 EUR`.

**Note:** If there are converting USD to EUR, and there are `1.20 USD` in `1.00 EUR`, the exchange rate is `1.20`.
BethanyG marked this conversation as resolved.
Show resolved Hide resolved
```python
>>> exchange_money(127.5, 1.2)
106.25
Expand All @@ -39,7 +38,7 @@ Create the `get_value_of_bills()` function, taking 2 parameters:
1. `denomination` : The value of a single bill.
2. `number_of_bills` : Amount of bills you received.

This function should return the total value of the given *bills*.
This exchanging booth only deals in cash. The total you receive must be divisible by the value of one bill, which can leave behind a reminder. This function should return the total value of the given *bills*.
BethanyG marked this conversation as resolved.
Show resolved Hide resolved

```python
>>> get_value_of_bills(5, 128)
Expand All @@ -50,8 +49,8 @@ This function should return the total value of the given *bills*.

Create the `get_number_of_bills()` function, taking `budget` and `denomination`.

This function should return the *number of bills* that you can get using the *budget*.
**Note: ** You can only receive _whole bills_, not fractions of bills, so remember to divide accordingly.
This function should return the *number of bills* that you can get using the *budget*. In other words, how many bills of the denomination's value fit into the total budget
BethanyG marked this conversation as resolved.
Show resolved Hide resolved
**Note: ** You can only receive _whole bills_, not fractions of bills, so remember to divide accordingly. You are rounding down to the nearest whole number.
BethanyG marked this conversation as resolved.
Show resolved Hide resolved
```python
>>> get_number_of_bills(127.5, 5)
25
Expand All @@ -61,8 +60,8 @@ This function should return the *number of bills* that you can get using the *bu

Create the `exchangeable_value()` function, taking `budget`, `exchange_rate`, `spread`, and `denomination`.

Parameter `spread` is the *percentage taken* as an exchange fee.
If `1.00 EUR == 1.20 USD` and the *spread* is `10`, the actual exchange will be: `1.00 EUR == 1.32 USD`.
Parameter `spread` is the *percentage taken* as an exchange fee, written as an integer. It needs to be converted to decimal by dividing it by 100.
BethanyG marked this conversation as resolved.
Show resolved Hide resolved
If `1.00 EUR == 1.20 USD` and the *spread* is `10`, the actual exchange rate will be: `1.00 EUR == 1.32 USD` because 10% of 1.20 is 0.12, and this additional fee is added to the exchange.
BethanyG marked this conversation as resolved.
Show resolved Hide resolved

This function should return the maximum value of the new currency after calculating the *exchange rate* plus the *spread*.
Remember that the currency *denomination* is a whole number, and cannot be sub-divided.
Expand All @@ -80,7 +79,7 @@ Remember that the currency *denomination* is a whole number, and cannot be sub-d

Create the `non_exchangeable_value()` function, taking `budget`, `exchange_rate`, `spread`, and `denomination`.

This function should return the value that is *not* exchangeable due to the *denomination* of the bills.
This function should return the value that is *not* exchangeable due to the *denomination* of the bills, by subtracting your value after exchange from the theoretical value. The theoretical value assumes bills can be subdivided, therefore ignoring denomination, but does take into account spread.
BethanyG marked this conversation as resolved.
Show resolved Hide resolved

**Note:** Returned value should be `int` type.

Expand Down