logo CodeStepByStep logo


Language/Type: VB parameters return

The following console program uses parameters and produces four lines of output. What are they?

Public Module ParameterMysteryExam6
    Public Sub Main()
        Dim scarlett As String = "mustard"
        Dim suspect As String = "peacock"
        Dim lounge As String = "ballroom"
        Dim pipe As String = "study"
        Dim dagger As String = "pipe"
        Dim weapon As String = "dagger"

        Clue(weapon, suspect, pipe)
        Clue(scarlett, pipe, suspect)
        dagger = Clue(dagger, "lounge", scarlett)
        Clue(dagger, lounge, "dagger")
    End Sub

    Public Function Clue(suspect As String, room As String, weapon As String)
        Console.WriteLine(room & " in the " & weapon & " with the " & suspect)
        Return room
    End Function
End Module
line 1
line 2
line 3
line 4

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.