Ad
  • Custom User Avatar

    Provide the user with unit test suite based on the examples. E.g.:

    Test.assertEquals(number2words(0), "zero");
    Test.assertEquals(number2words(1), "one");
    Test.assertEquals(number2words(9), "nine");
    Test.assertEquals(number2words(10), "ten");
    Test.assertEquals(number2words(17), "seventeen");
    Test.assertEquals(number2words(20), "twenty");
    Test.assertEquals(number2words(21), "twenty-one");
    Test.assertEquals(number2words(45), "forty-five");
    Test.assertEquals(number2words(80), "eighty");
    Test.assertEquals(number2words(99), "ninety-nine");
    Test.assertEquals(number2words(100), "one hundred");
    Test.assertEquals(number2words(301), "three hundred one");
    Test.assertEquals(number2words(799), "seven hundred ninety-nine");
    Test.assertEquals(number2words(800), "eight hundred");
    Test.assertEquals(number2words(950), "nine hundred fifty");
    Test.assertEquals(number2words(1000), "one thousand");
    Test.assertEquals(number2words(1002), "one thousand two");
    Test.assertEquals(number2words(3051), "three thousand fifty-one");
    Test.assertEquals(number2words(7200), "seven thousand two hundred");
    Test.assertEquals(number2words(7219), "seven thousand two hundred nineteen");
    Test.assertEquals(number2words(8330), "eight thousand three hundred thirty");
    Test.assertEquals(number2words(99999), "ninety-nine thousand nine hundred ninety-nine");
    Test.assertEquals(number2words(888888), "eight hundred eighty-eight thousand eight hundred eighty-eight");
    
  • Custom User Avatar

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