VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



average temperature

by RATTA (1 Submission)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 30th June 2008
Date Added: Mon 8th February 2021
Rating: (1 Votes)

average temperature

Rate average temperature



Dim intNbrToEnter As Integer
Dim intX As Integer
Dim lngTotTemp As Long
Dim dblAvgTemp As Double
intNbrToEnter = Val(InputBox("Number of temperatures to be entered:"))
If intNbrToEnter = 0 Then Exit Sub
ReDim aintTemperatures(1 To intNbrToEnter)
For intX = 1 To intNbrToEnter
aintTemperatures(intX) = Val(InputBox("Temperature #" & intX & ":"))
Print "Temperature #" & intX & ": " & aintTemperatures(intX)
lngTotTemp = lngTotTemp + aintTemperatures(intX)
Next
dblAvgTemp = lngTotTemp / intNbrToEnter
Print "The average temperature entered is " & Format$(dblAvgTemp, [format]vb,
"Fixed")


Download this snippet    Add to My Saved Code

average temperature Comments

No comments have been posted about average temperature. Why not be the first to post a comment about average temperature.

Post your comment

Subject:
Message:
0/1000 characters