Imports System.Math Imports System.IO Module Module1 Sub Main() Dim a(14) As Long Dim dose As Double = 0.01 Dim g(1001) As Double Dim i, j As Long Dim mz(1001) As Double Dim Xso(1001) As Double Dim n As Double = 19 Dim nz(1001) As Double Dim p As Double = 1300 Dim pot(1000000) As Double Dim pmean As Double Dim potency As Double = 0 Dim pt As Double = 0 Dim r(1001) As Double Dim rs As Double Dim rsd As Double Dim rt As Double = 0 Dim s As Double Dim t As Long = 100000 Dim vz(1001) As Double For i = 1 To 14 a(i) = 0 Next i Dim realps As StreamReader realps = My.Computer.FileSystem.OpenTextFileReader( "C:\Users\Kevin C. Johnson\realpsj.txt") Dim file As StreamWriter file = My.Computer.FileSystem.OpenTextFileWriter( "C:\Users\Kevin C. Johnson\cureal.txt", False) For i = 1 To n r(i) = realps.ReadLine() / 20000 Xso(i) = realps.ReadLine() / 100 * dose vz(i) = 4 / 3 * PI * r(i) ^ 3 mz(i) = vz(i) * p nz(i) = Xso(i) / mz(i) g(i) = 0 Next i For j = 1 To t For i = 1 To n If nz(i) > 1 Then potency = potency + nz(i) * mz(i) If nz(i) < 1 Then g(i) = g(i) + nz(i) If g(i) > 1 Then potency = potency + mz(i) If g(i) > 1 Then g(i) = 0 Next i pot(j) = potency / dose * 100 potency = 0 pt = pt + pot(j) If pot(j) > 0 And pot(j) < 75 Then a(1) = a(1) + 1 If pot(j) > 75 And pot(j) < 85 Then a(2) = a(2) + 1 If pot(j) > 85 And pot(j) < 90 Then a(3) = a(3) + 1 If pot(j) > 90 And pot(j) < 95 Then a(4) = a(4) + 1 If pot(j) > 95 And pot(j) < 99 Then a(5) = a(5) + 1 If pot(j) > 99 And pot(j) < 101 Then a(6) = a(6) + 1 If pot(j) > 101 And pot(j) < 105 Then a(7) = a(7) + 1 If pot(j) > 105 And pot(j) < 110 Then a(8) = a(8) + 1 If pot(j) > 110 And pot(j) < 115 Then a(9) = a(9) + 1 If pot(j) > 115 And pot(j) < 125 Then a(10) = a(10) + 1 If pot(j) > 125 And pot(j) < 150 Then a(11) = a(11) + 1 If pot(j) > 150 And pot(j) < 175 Then a(12) = a(12) + 1 If pot(j) > 175 And pot(j) < 200 Then a(13) = a(13) + 1 If pot(j) > 200 Then a(14) = a(14) + 1 Next j file.Write("0-75% = ") : file.WriteLine(a(1) / t * 100) file.Write("75-85% = ") : file.WriteLine(a(2) / t * 100) file.Write("85-90% = ") : file.WriteLine(a(3) / t * 100) file.Write("90-95% = ") : file.WriteLine(a(4) / t * 100) file.Write("95-99% = ") : file.WriteLine(a(5) / t * 100) file.Write("99-101% = ") : file.WriteLine(a(6) / t * 100) file.Write("101-105% = ") : file.WriteLine(a(7) / t * 100) file.Write("105-110% = ") : file.WriteLine(a(8) / t * 100) file.Write("110-115% = ") : file.WriteLine(a(9) / t * 100) file.Write("115-125% = ") : file.WriteLine(a(10) / t * 100) file.Write("125-150% = ") : file.WriteLine(a(11) / t * 100) file.Write("150-175% = ") : file.WriteLine(a(12) / t * 100) file.Write("175-200% = ") : file.WriteLine(a(13) / t * 100) file.Write(">200% = ") : file.WriteLine(a(14) / t * 100) pmean = pt / t For j = 1 To t rs = (pot(j) - pmean) ^ 2 rt = rt + rs Next j s = Sqrt(rt / (t - 1)) rsd = 100 * s / pmean file.Close() End Sub End Module