I'm fairly new to Scala and have to write a program which calculates the average of given List of Integers.

However, I always get the error: 

> 
> foreach is not a member of Int. 
> 
> 
> 

Does anybody of you know how to solve this? Here is my code:

```
 var measureResults = List(100, 36, 54, 4, 22, 37, 86, 20, 3000)

 var averageResult = getAverage(measureResults)

 println(averageResult)

 def getAverage(measureResults: List[Int]): Double = {
    var entryList = listOfValidElements(measureResults)
    var average = entryList(0)
    for (element <- average){
      average =+ 1 
      var trueAverage = average/length(entryList)
      return trueAverage
   }
 }

```