Java - Cars, Assemble! Test problem

I think that the method “workingItemsPerMinute(int speed)” is supposed to receive “Minutes” as a parameter, correct?

The Tests are expecting speed as hour.

Ex: 5 minutes would produce 18 cars, not 16 as the Test expects, because it does not enter in any conditions, 5 minutes is 100% of the production.

If I use the parameter as 5 hours and enter 90% production, the test accepts the result, which I suppose is wrong.

Welcome to the forum!

I think that the method “workingItemsPerMinute(int speed)” is supposed to receive “Minutes” as a parameter, correct?

Not exactly. The speed here is a value from 1 to 10 that has no units. You can see it as a “speed multiplier” that affects both the speed but also the error rate. Since it is a speed multiplier, you can multiply it by the actual speed, regardless of the units that actual speed is using. But of course, you can’t just do that, since this speed multiplier also affects the error rate, but I don’t want to give away much of the exercise for you.

Would it be clearer for you if the parameter was called speedMultiplier instead of just speed? We can also adjust the instructions to make it clearer this is a speed multiplier and not an actual speed.

1 Like

Yes, I understood now.
Thanks.