Imports System
Imports System.Linq
Public Class Program
Public Shared Function calculate_dot_product(ByVal arr1 As Integer(), ByVal arr2 As Integer()) As Integer
Return arr1.Zip(arr2, Function(n1, n2) n1 * n2).Sum()
End Function
Public Shared Sub Main(ByVal args As String())
Dim arr1 As Integer() = New Integer() {1, 4, 8, 9, 6}
Dim arr2 As Integer() = New Integer() {0, 7, 1, 3, 40}
Console.Write("Dot product = {0:D}", calculate_dot_product(arr1, arr2))
End Sub
End Class
' run:
'
' Dot product = 303
'