58
1
Imports System
2
Imports System.Linq
3
Imports System.Collections.Generic
4
5
6
Public Module Module1
7
Public Sub Main()
8
Dim studentList = New List(Of Student) From {
9
New Student() With {.StudentID = 1, .StudentName = "John", .Age = 13 },
10
New Student() With {.StudentID = 2, .StudentName = "Moin", .Age = 21 },
11
New Student() With {.StudentID = 3, .StudentName = "Bill", .Age = 18 },
12
New Student() With {.StudentID = 4, .StudentName = "Ram", .Age = 20 },
13
New Student() With {.StudentID = 5, .StudentName = "Ron", .Age = 15 }
14
}
15
16
17
Dim avgAge = Aggregate st In studentList Into Average(st.Age)
18
19
Console.WriteLine("Average Age of Student: {0}", avgAge)
20
21
End Sub
22
End Module
23
24
Public Class Student
Cached Result
zeit t/s: 1 2 3 4 5 6 7 8 9 10
H s/m: 4.905 19.62 44.145 78.48 122.625 176.58 240.345 313.92 397.305 490.5
H s/m: 4.905 19.62 44.145 78.48 122.625 176.58 240.345 313.92 397.305 490.5