Option Strict On
Module Module1

    Sub Main()
        Dim v, h, w, denomsum, a, b, k, T, numsum, eps, Tmax, Tmin, dT As Double
        h = 0.0000000000000001986
        w = 10
        k = 0.0000000000000001381
        Tmin = 100
        Tmax = 2000
        dT = 100
        eps = 0.000001
        For i As Integer = 0 To CInt((Tmax - Tmin) / dT)
            T = Tmin + i * dT
            denomsum = 0
            v = 0
            numsum = 0
            Do
                denomsum = denomsum + Math.Exp(-(v + 0.5) * h * w / k / T)
                numsum = numsum + (v + 0.5) * h * w * Math.Exp(-(v + 0.5) * h * w / k / T)
                v = v + 1
            Loop Until (Math.Exp(-(v + 0.5) * h * w / k / T)) < eps
            Console.WriteLine("{0,6} | {1,8:f4} | {2:E8}", T, denomsum, ((numsum / denomsum) / h))
        Next i
        Console.ReadLine()
    End Sub

End Module
