logo CodeStepByStep logo

ParameterMysteryExam6

Language/Type: C# parameters return

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

public class ParameterMysteryExam6
{
    public static void Main()
    {
        string scarlett = "mustard";
        string suspect = "peacock";
        string lounge = "ballroom";
        string pipe = "study";
        string dagger = "pipe";
        string weapon = "dagger";

        Clue(weapon, suspect, pipe);
        Clue(scarlett, pipe, suspect);
        dagger = Clue(dagger, "lounge", scarlett);
        Clue(dagger, lounge, "dagger");
    }

    public static string Clue(string suspect, string room, string weapon)
    {
        Console.WriteLine(room + " in the " + weapon + " with the " + suspect);
        return room;
    }
}
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.