Challenge: Array Statistics
Swipe to start coding
Write two methods to calculate statistics for an array of integers. The first method should return the sum of all elements in the array. The second method should return the average value of the array as a double.
- The
CalculateSummethod must return the sum of all elements in thenumbersarray. - The
CalculateAveragemethod must return the average of the elements in thenumbersarray as a double. - If the
numbersarray is empty,CalculateAveragemust return0.0.
Solução
Obrigado pelo seu feedback!
single
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo
Can you explain this in simpler terms?
What are the main benefits or drawbacks?
Can you give me a real-world example?
Incrível!
Completion taxa melhorada para 8.33
Challenge: Array Statistics
Deslize para mostrar o menu
Swipe to start coding
Write two methods to calculate statistics for an array of integers. The first method should return the sum of all elements in the array. The second method should return the average value of the array as a double.
- The
CalculateSummethod must return the sum of all elements in thenumbersarray. - The
CalculateAveragemethod must return the average of the elements in thenumbersarray as a double. - If the
numbersarray is empty,CalculateAveragemust return0.0.
Solução
Obrigado pelo seu feedback!
single