Ad
  • Default User Avatar

    I have the same problem. Here is the results of calculation
    input
    p0 -1000, %- 2.0, aug - 50, p - 1214
    Output
    1070.0
    1
    1141.4
    2
    1214.228
    3

    Calculation (manual)
    p % aug
    1 year 1 000,00 0,02 1,02 50 1 070,00
    2 year 1 070,00 0,02 1,02 50 1 141,40
    3 year 1 141,40 0,02 1,02 50 1 214,23

  • Custom User Avatar

    the population cant be a float number this is the mistake.

  • Custom User Avatar

    Regarding the rounding - it worked when I went low but not when I went high. And sometimes a being greater than or equal to b isn't the same as b being less than a. Hope that helps.

  • Default User Avatar

    Thank you, but I am using right one of that ways :)

    Now my trouble is to find right way to compare expressions :)

  • Custom User Avatar

    By now, you used 2 of 3 ways to convert a float number to an integer, the right one is the one you haven't tried.

  • Default User Avatar

    thanx, I have already understand that I have missed that :)
    during debug, I missed that I should compare with 1214 not 1200 🙂

  • Custom User Avatar

    In the description the value is 1200, yes. In the test your code fails, it is 1214.

  • Default User Avatar

    Sorry but I can't understand where you see the border of 3 or 4 yeras.
    Task description shows that population greater or equal to p = 1200 inhabitants!!!

    So both numbers: 1213 and 1214 are greater than 1200.

    Explain

  • Custom User Avatar

    You can discuss it here, where the author of this kata can see your post. So far you provided no information what or how it's wrong.

    Please understand that there really are no errors in tests, as you've been told below this post. The error is in your code.

    See the following for more tips: https://docs.codewars.com/training/troubleshooting

  • Custom User Avatar

    That's the difference between 3 years or 4 years, if you can't see that, then I can't help you, keep blaming the tests. Good luck.

    JavaScript Completions 38468

  • Default User Avatar

    1213 or 1214 it does not impact on exercise solution test plan!

    issue in the test plan code!

  • Custom User Avatar

    Read the example in the description again, at the 3rd year, you only reach 1213, not 1214.

  • Default User Avatar

    The problem is in the "Basic Test" block last step, when you press "ATTEMPT" !

    See steps below:
    1). 1000 * 2 + 50 + 1214
    2). 1141 * 2 + 50 + 1214
    3). 1214 * 2 + 50 + 1214
    1214 - 3

    I think, cotrol number should be 3 but in test block exist 4.

  • Default User Avatar

    In last test it's not 25%, it is 0,25%.
    You should everytime divide percent by 100, don't need to check "if (percent >= 1)"

  • Default User Avatar

    but if I found and error or trouble in test scripts how can I discuss it with platform owner ?

  • Loading more items...