Thursday 6/5/2008. 30 points.
http://www.cs.nyu.edu/courses/summer08/G22.3033-002/
These are example solutions. Please keep in mind that often, there is not just one correct solution to a question. If you come up with different answers, then it may be that both your answers and these answers here are correct. Of course, these answers here may also contain mistakes. If you spot a mistake, please let me know so I can correct it.
Function geometricMean(arr() As Double) As Double
Dim i As Integer, n As Integer
geometricMean = 1
For i = LBound(arr) To UBound(arr)
geometricMean = geometricMean * arr(i)
Next i
n = 1 + UBound(arr) - LBound(arr)
geometricMean = geometricMean ^ (1.0 / n)
End Function
Sub main()
Dim A(1) As Double
A(0) = 1: A(1) = 2
Debug.Print geometricMean(A)
End Sub
$x = ($y = ((3 ** (3 ** 3)) * 2))
_E in the form's code sheet.