Method Signatures FRQ Practice

Responses receive AI feedback against a rubric after submission. Scores are practice estimates.

Question 1 of 5

A kiln class includes this header:

public static boolean ready(int celsius, boolean lidShut)

(a) Write the method signature. (b) Explain whether ready(int, boolean) and ready(boolean, int) are the same signature. (c) A potter needs to know if the kiln at 900 degrees with the lid shut is ready. Explain which ordered types match that need.

Question 2 of 5

Use this kiln API.

Method Signature Purpose
heat heat(int) sets target Celsius
heat heat(int, int) sets target and hold minutes
glaze glaze(double) records thickness in mm
ready ready() returns whether at target

The potter only needs to store a glaze thickness of 1.5 mm. (a) Identify the method and write a legal call. (b) Explain why heat(int, int) does not match this need. (c) Explain how you used the parameter types, not the method name alone.

Question 3 of 5

The methods below are in the same class.

public static void cool(int temp)
{
    temp -= 50;
}
public static int coolAndReturn(int temp)
{
    temp -= 50;
    return temp;
}

State each displayed value and explain the difference. (a) int kiln = 900; cool(kiln); System.out.print(kiln); (b) int kiln = 900; kiln = coolAndReturn(kiln); System.out.print(kiln);

Question 4 of 5

The methods below are in the same class.

public static int mix(int parts)
{
    return parts + 2;
}
public static int mix(int parts, int water)
{
    return parts + water;
}

(a) What does System.out.print(mix(5)); display, and which overload runs? (b) What does System.out.print(mix(5, 8)); display, and which overload runs? (c) Explain why both methods may exist in one class.

Question 5 of 5

A student claims that calling a method permanently leaves the program inside that method.

public static void chime()
{
    System.out.print("K");
}

System.out.print("J");
chime();
System.out.print("L");

(a) State the displayed text. (b) Correct the student's claim about control flow. (c) Explain whether chime can be written as int x = chime();