Parameter Mystery
Category: Parameter Mystery
Author: Jessica Miller
Book Chapter: 3.1
Problem: Parameter Mystery
At the bottom of the page, write the output produced by the following program, as it would appear on the console.
public class ParameterMystery {
public static void main(String[] args) {
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);
clue(dagger, "lounge", scarlett);
clue(lounge, dagger, "dagger");
clue(pipe, "miss " + scarlett, lounge);
}
public static void clue(String suspect, String room, String weapon) {
System.out.println(room + " in the " + weapon + " with the " + suspect);
}
}
1) clue(weapon, suspect, pipe);
2) clue(scarlett, pipe, suspect);
3) clue(dagger, "lounge", scarlett);
4) clue(lounge, dagger, "dagger");
5) clue(pipe, "miss " + scarlett, lounge);