logo CodeStepByStep logo

ParameterMysteryExam1

Language/Type: C# parameters return

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

public class ParameterMysteryExam1
{
    public static void Main()
    {
        string x = "csharp";
        string y = "tyler";
        string z = "tv";
        string rugby = "hamburger";
        string csharp = "donnie";

        Hamburger(x, y, z);
        Hamburger(z, x, y);
        Hamburger("rugby", z, csharp);
        y = Hamburger(y, rugby, "x");
        Hamburger(y, y, "csharp");
    }

    public static string Hamburger(string y, string z, string x)
    {
        Console.WriteLine(z + " and " + x + " like " + y);
        return z;
    }
}
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.