In Swift → Freelancer Rates, there is an apparent contradiction in the assignment (first it says “round down”, then it says “round up”:
3. Calculate the number of workdays given a budget, hourly rate and discount
Another day, a project manager offers the freelancer to work on a project with a fixed budget. Given the fixed budget and the freelancer’s hourly rate, help them calculate the number of days they would work until the budget is exhausted. The result must be rounded down to the nearest whole number.
Implement the function workdaysIn(budget:hourlyRate:withDiscount:)
, that takes the arguments:
budget
which holds the budget for the project.hourlyRate
which holds the freelancers hourly rate.withDiscount
which holds the discount the freelancer is willing to give to the client. The function should return the number of workdays the freelancer will work on the project rounded up.
Whichever is desired is fine, suggest making it consistent!
Thanks!