Freelancer Rates Exercise Issue

The instruction prompt for this exercise clearly states that months are defined as 22 billable days, and that discounts are only applied when the contractor can bill for an entire month at a time. We are also told this module will have us work on two concepts, namely floating point and integer operations.

I believe that, as presented, the accepted solutions for the tests on FreelancerRates.days_in_budget are not right. You’re effectively asking us to steal from our contractor client by giving inappropriate discounts to the project manager.

The final test wants us to assert FreelancerRates.days_in_budget(480, 60, 20) == 1.2, discounting in a situation where the project manager can only afford a single workday and no discount should be applied. We’re making our client, the contractor, give away $96 of free labor in violation of the rules we were asked to follow.

The way I interpreted what was presented to us, I thought the correct approach was to integer divide the budget by the monthly discounted rate to find how many discounted months would fit in the budget, then take any remaining budget and see how many days that would cover, combining and rounding the two to come to a final result. My solution would return 1.0 where the final test is expecting a 1.2

1 Like

The problem statement mentions that the freelancer offers a discount for monthly billing, but not that the freelancer will only give a discount for monthly billing or that the discount can only be applied in 22 day chunks.

Ballsy to call the three thousand-odd people who did this exercise before this “willfully obtuse”.

Three thousand-odd people coding to the tests rather than the prompt, I suppose.

Hello :slightly_smiling_face:

I’m not on the Elixir track just yet, but I’ll be joining for #12in23.

Thanks for spotting this potential problem. In your view, how could we make this better?

1 Like

I understood the question the same way as @hTwo did and found the last test odd (applying a discount for a budget only enough for one days work).

The freelancer is offering to apply a discount if the project manager chooses to let the freelancer bill per month

I would add a note to this exercise somewhere stating that the discount can also be applied to ills for work which was below one month!

@hTwo Thanks for opening the issue. I understand that you are frustrated. However, please moderate your tone to be more respectful of those who create and maintain exercises that you’re getting for free. 94% of people who start the exercise finish it, so while I don’t disagree that it could be clearer, it’s also not providing some sort of logical impossibility.

@Georgy5 Thanks for your suggestion. I’ve opened a PR here. Does that make things clearer?

3 Likes

It’s funny because I had the same confusion when I first made that exercise in one of the tracks. But just a few minutes ago, I finished this exercise in the Elixir track without remembering or looking up how I did it in other tracks, and for some reason, this confusion didn’t come up this time. So I totally get why this can be confusing - I myself interpreted it 2 different ways at 2 different times :slight_smile:

I think the PR @iHiD made clarifies the issue, without making the instructions overly verbose. :+1:

1 Like

Thank you for improving the text :pray:t3: Your change does remove the confusion I had regards the daily rate.

1 Like