+ 1

Why is my code wrong according to sololearn

Task: The given code declares an array that holds the monthly revenues for a company for a year. You need to calculate the average monthly revenue for the year For that, calculate the sum of the revenue for all the months and divide it by the number of items in the array. https://code.sololearn.com/cmWooDC9s30e/?ref=app

3rd Jan 2023, 4:56 PM
Karim Kandil
5 Answers
+ 3
I got no issues when I run the code
3rd Jan 2023, 5:09 PM
Sokkai
Sokkai - avatar
+ 2
Can you task number Or link..?
3rd Jan 2023, 5:07 PM
Jayakrishna 🇮🇳
+ 1
Jayakrishna🇮🇳 YIPMONG Jr The given code declares an array that holds the monthly revenues for a company for a year. You need to calculate the average monthly revenue for the year For that, calculate the sum of the revenue for all the months and divide it by the number of items in the array. This is the task, when I run the code, I get a "false test case hidden" . The task can be found in the java for beginners "looping over arrays " "anual revenue "exercise ". (I don't know how to link the exercise, maybe because I am using a tablet?)
3rd Jan 2023, 5:26 PM
Karim Kandil
+ 1
Ahhh,I used int instead of double, that was the problem, it works now. Thank you
3rd Jan 2023, 5:28 PM
Karim Kandil
0
Oh great Karim
3rd Jan 2023, 5:30 PM
Sokkai
Sokkai - avatar