Ad
  • Custom User Avatar

    Unpublishing due to low satisfaction and many unresolved issues.

  • Custom User Avatar

    What is the expected result if dob is a leap day?

  • Custom User Avatar

    Ruby: 2200-05-16 is considered not yet born, but it is before 2200-06-15 and so should've been born.

  • Custom User Avatar

    C++ has an error in tests:

    In file included from main.cpp:7:
    ./tests.cpp:133:7: error: use of undeclared identifier 'leapYear'
      if (leapYear(year) && month == 2 && year != 0) { return 29; }
          ^
    1 error generated.
    

    Also sample tests are wrong. They assume a current date of 2200-01-01.

  • Custom User Avatar

    with

    const std::string TIME = "2200-06-15";
    

    tests are:

    Describe(Examples) {
        It(DoB_2002_12_20) {
            Assert::That(calculateAge("2002-12-20"), 
                         Equals("Your age is 197 years, 0 months and 12 days.\n11 months and 19 days remaining for your birthday."));
        }
      
        It (DoB_2002_01_01) {
            Assert::That(calculateAge("2002-01-01"), 
                         Equals("Your age is 198 years, 0 months and 0 days.\nHappy Birthday!"));
        }
      
    };
    
  • Custom User Avatar

    Sounds correct. What does the test expect for these inputs?

  • Custom User Avatar

    Trying C++ and having a concern: if I was born in "2002-01-01" and the date (const TIME) is "2200-06-15", then my next birthday should be on "2201-01-01" ???

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    You have actually preempted my next question: Can there be thousands separators to the right of a decimal separator? Apparently not.

    This seems like a bit of a cop-out, but of course otherwise there is just no way of knowing how to interpret 123.456,789.

  • Custom User Avatar

    Yes, you're right! I will add that too. Thank you so much for your help!

  • Custom User Avatar

    Yeah, this is better.

    Next problem: how do I know that 123,456 and 123.456 are both 123 456 e -3 and not 123 456 e 0 ? Shouldn't you specify that there can only be thousands separators if there is a decimal separator?

  • Custom User Avatar

    I admit that was a little bit of a generalism. I believe I've made it sound better now!

  • Custom User Avatar

    Programming languages can only use points "." as decimal separators, and don't support any kind of thousands separators.

    Citation needed.

    Or just take out this ridiculous statement ( programming languages can and do use whatever they specify ), and specify what your kata uses.

    Note that JavaScript in recent versions ( optionally ) uses _ as a thousands separator ( there is a long history for that in other languages, but this one sprang to mind first ).

  • Custom User Avatar

    Fixed! Thanks for reporting the issue.

  • Custom User Avatar

    I'm sorry, could you please elaborate? The task is to modify the input given and convert it to a Numeric type, but I believe I don't understand you.

  • Loading more items...