logo CodeStepByStep logo

ParameterMysteryExam2

Language/Type: VB parameters return

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

Public Module ParameterMysteryExam2
    Public Sub Main()
        Dim x As String = "happy"
        Dim y As String = "pumpkin"
        Dim z As String = "Orange"
        Dim pumpkin As String = "sleepy"
        Dim orange As String = "vampire"

        Orange(y, x, z)
        x = Orange(x, z, y)
        Orange(pumpkin, z, "y")
        z = "green"
        Orange("x", "pumpkin", z)
        Orange(x, z, orange)
    End Sub

    Public Function Orange(z As String, y As String, x As String)
        Console.WriteLine(y & " and " & z & " were " & x)
        Return x + y + z
    End Function
End Module
line 1
line 2
line 3
line 4
line 5

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.