You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 41b67be
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: exercises/concept/freelancer-rates/.docs/instructions.md
+11-9Lines changed: 11 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,21 @@
1
1
# Instructions
2
2
3
-
In this exercise you'll be writing code to help a freelancer communicate with a project manager by providing a few utilities to quickly calculate daily and
4
-
monthly rates, optionally with a given discount.
3
+
In this exercise, you'll be writing code to help a freelancer communicate with a project manager.
4
+
Your task is to provide a few utilities to quickly calculate daily and monthly rates, optionally with a given discount.
5
5
6
6
We first establish a few rules between the freelancer and the project manager:
7
7
8
8
- The daily rate is 8 times the hourly rate.
9
9
- A month has 22 billable days.
10
10
11
-
Sometimes, the freelancer is offering to apply a discount on their daily rate (for example for their most loyal customers or for non-for-profit customers).
11
+
Sometimes, the freelancer is offering to apply a discount on their daily rate (for example for their most loyal customers or not-for-profit customers).
12
12
13
-
Discounts are modeled as fractional numbers representing percentage, for example `25.0` (25%).
13
+
Discounts are modeled as fractional numbers representing percentages, for example,`25.0` (25%).
14
14
15
15
## 1. Calculate the daily rate given an hourly rate
16
16
17
-
Implement a function to calculate the daily rate given an hourly rate:
17
+
Implement a function called `daily_rate` to calculate the daily rate given an hourly rate as a parameter.
18
+
The contract defines that a day has 8 billable hours.
18
19
19
20
```elixir
20
21
FreelancerRates.daily_rate(60)
@@ -25,7 +26,7 @@ The returned daily rate should be a float.
25
26
26
27
## 2. Calculate a discounted price
27
28
28
-
Implement a function to calculate the price after a discount.
29
+
Implement a function `apply_discount`to calculate the price after a discount.
29
30
30
31
```elixir
31
32
FreelancerRates.apply_discount(150, 10)
@@ -36,7 +37,8 @@ The returned value should always be a float, not rounded in any way.
36
37
37
38
## 3. Calculate the monthly rate, given an hourly rate and a discount
38
39
39
-
Implement a function to calculate the monthly rate, and apply a discount:
40
+
Implement a `monthly_rate` function to calculate the discounted monthly rate.
41
+
It takes two parameters, an hourly rate and the discount in percent.
0 commit comments