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.
Done!
It would be great if you add some random test cases.
Good kata!
Note that you're rounding the number
n
when you shouldn't do that, instead you should use the Math.floor function to get the nearest number of n which, if n would be 7.1, the nearest number will be -> 7.Hello pitieu,
The sentence means, that the method/function can receive decimal numbers and if that would be the case then, it should return true only if the number (the decimal number that the method/function has received) is equal to its integer part and that integer part is odd.
About your other question with the decimal number, this should be the returned value of the method:
1.1 ->
false
7.7 ->
false
7.77 ->
false
1.01 ->
false
1.10 ->
false
1.12 ->
false
7.17 ->
false
This will return
true
1.0
-5.0
-9.00
Hope the answer could help you!
Have a good day.
Java Translation added ;)
Check it out!
Hello bkaes,
Thanks for the feedback. It's now fixed, the random test cases does not appear in the test cases just when the warrior make the final submit.
@Darnor, I thought that both test cases should be the same.
Hello Chobbes,
As Darnor wrote, the description specify that if the method recieve an empty string or null, it should return
"Invalid String!"
, that's why you should validate against null or empty strings.Hello Darnor,
the test case for
null
orempty
is already added.In addition, I add some random test cases and other little changes to initial code. ;)
Hello great warrior, thanks for the feedback.
Great question, but if the warrior which has decided to complete this kata use any of the sorting java methods, it would do the job by itself.
Otherwise, if any of the warriors decide to do it manually then all
non-letter
characters have a number in the ASCII code, which mean they should make a comparison on whichnon-letter
character has the greater number.If you have any other question, please ask.
Have a good day.
Hello laoris,
thanks for the feedback.
You're right, the method wasn't static yet because I made the changes in wrong place.
But, it's fixed already ;) Thank you!
Hello Darnor,
Thank you for the feedback.
I already fixed the method name, I really forgot fix it when I was creating this kata because at the beginning I thought to name it 'order' instead of 'orderWord'. But, it's already fixed ;)
About the (
e
befored
, you're wrong because according with natural ordering, it should be like in the test. For i.e.:Ordering.orderWord("rude")
should return =>deru
).I'm working on more tests for the kata, thanks anyway.