Beruflich Dokumente
Kultur Dokumente
Tuesday Night
7/15/2014
Unit 5 Labs
Lab 5.1
The Condition
attAverage >= verizonAverage
tmobileAverage == 868
verizonAverage < sprintAverage
sprintAverage != attAverage
True or False
True
True
False
True
Lab 5.2
The Condition
If tmobileAverage > 800 AND
verizonAverage
>800 Then
Display Both have average
download rates over 800
Else
Display One or both of the
averages are less
End If
If sprintAverage == 800 Then
Display Sprints download rate is
800
End If
If attAverage >= 1300 OR
tmobileAverage >=900
Display Select either carrier
End If
Expected output
Both have average download rates
over 800.
Lab 5.3
Main Module()
//Declare variables on the next 3 lines
End Module
Module displayInfo(Integer testScore, String Category, String interview)
//Display the three variables
//Display testScore
//Display category
//Display interview
End Module
Lab 5.4
Lab 5.5
Module Module1
Sub Main()
'declare your 3 variables similar format such as
'Dim variableName As DataType = 0 (or " " if it's a string)
Dim testScore As Integer = 0
Dim category As String = " "
Dim Interview As String = " "
'call your 4 modules and pass necessary variables similar
'fromat such as
'moduleName(arguments)
getScore(testScore)
employCat(testScore, category)
interviewPoss(testScore, interview)
displayInfo(testScore, category, interview)
'add this cause a pause
Console.WriteLine("Press enter to continue...")
Console.ReadLine()
End Sub
Sub getScore(ByRef testScore As Integer)
'add the code to input testScore
Console.WriteLine("Put your test score here:" & testScore)
testScore = Console.ReadLine
End Sub
Sub employCat(ByVal testScore As Integer, ByRef category As String)
'add the code to evaluate conditions
If testScore < 60 Then
category = "No"
ElseIf testScore < 70 Then
category = "Maybe"
ElseIf testScore < 85 Then
category = "Likely"
Else
category = "Definite"
End If
End Sub
Sub interviewPoss(ByVal testScore As Integer, ByRef interview As String)
If testScore < 60 Then
interview = "No"
ElseIf testScore > 60 Then
interview = "Yes"
End If
End Sub
Sub displayInfo(ByVal testScore As Integer, ByRef category As String,
ByRef interview As String)
Console.Writeline("Your test score is:" & testScore)
Console.Writeline("Your category is:" & category)
Console.Writeline("Your interview is:" & interview)
End Sub
End Module