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.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
No. If you initialise sum with the value 0.0 and the array is empty then your program will just return 0.0. The for used here is a for each, so if there is nothing in the array it won't do anything.
It's good, but I would also recommend inserting "return new int[] ..." after each "if statement" so that the computer does't have to check the remaining "else if" e.g. humanYears == 1, computer checks the first "if" and then program terminates.
What's more, remember about error handling - in case user gives humanYears < 1.
Why?
Cuál es la pregunta?
why
it's more proper way to use stringbuilder in that case
soy retrasado