Professional Documents
Culture Documents
Lab 8
Lab 8
Step 6 this for loop it writes the number on the screen but only counts up by 2 so
the numbers\
Would be 0, 2 ,4, 6, 8, and 10
Step 7 constant integer max_value = 200
Declare counter
Step 11 this for loop displays the total of the sum of the 5 numbers that are
inputted
Step 12 declare integer counter
Declare integer totalage = 0
Declare real age = 0
Declare integer age
8.3
Module Module1
Sub Main()
Dim anotherDay As String = "yes"
While anotherDay = "yes"
Dim totalSpeed As Integer = 0
Dim averageSpeed As Integer = 0
Call enterSpeeds(totalSpeed)
Call calcAverage(totalSpeed, averageSpeed)
Call displayAverage(averageSpeed)
Console.WriteLine("Enter yes if you wnat to calculate another day:")
anotherDay = Console.ReadLine
End While
End Sub
Sub enterSpeeds(ByRef totalSpeed As Integer)
Dim networkSpeed As Double = 0
Dim counter As Integer = 1
For counter = 1 To 8
networkSpeed = Console.ReadLine
totalSpeed = totalSpeed + networkSpeed
Next
End Sub
Sub calcAverage(ByVal totalSpeed As Double, ByRef averageSpeed As Double)
averageSpeed = totalSpeed / 8
End Sub
Sub displayAverage(ByVal averageSpeed As Double)
Console.Write("The average network speed for the day is" & averageSpeed)
Console.ReadLine()
End Sub
End Module