Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I didn't know you can put a function there! So cool.
Elegant solution.
The testcase Test.assertEquals(splitTheBill(100, 2, 2), 50,); should be
Test.assertEquals(splitTheBill(100, 2, 2), 50);
, without the,
after50
.Add some edge cases tests.
Add random tests.
I'm new to this - can you let me know how you think they should be improved? Thanks!
Thank you for pointing this out! It should be 'round' and I will amend it shortly.
poor tests
How to keep 2 decimal places? round, floor, or ceil?
I used ceil, because in testcase1:
I got two decimal numbers:
But I failed at testcase3:
I got two decimal numbers: