• Post Reply Bookmark Topic Watch Topic
  • New Topic

Counting averge using Arrays error  RSS feed

 
Elias Gomersen
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey, why do I get error when I am trying to count the averge? here is the code and below I am showing where the error is



Here is a screenshot of the code! https://gyazo.com/56b674b3a34bbd39d5548bea94b40858
 
Junilu Lacar
Sheriff
Posts: 11494
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you keep calling the method to get integers from the input? you should call that once, then use the myint array reference instead.
 
Carey Brown
Saloon Keeper
Posts: 3329
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your getAverage() method is OK.
On line 9 your call to getIntergers needs an argument:  getIntergers(myint) <-- my mistake
On line 9 call getAverage needds an int[] argument like getAverage(myint)
Lines 6-8 don't make any sense.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!