In Swift → Freelancer Rates, there is an apparent contradiction in the assignment (first it says “round down”, then it says “round up”:
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:
budgetwhich holds the budget for the project.
hourlyRatewhich holds the freelancers hourly rate.
withDiscountwhich 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!