Expressions and Output FRQ Practice

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

Question 1 of 5

State the exact console text produced by the fragment, ignoring a final trailing newline. Explain why the two words are or are not on the same line. Then rewrite the fragment so it displays DockBay on one line with no space.

System.out.println("Dock");
System.out.print("Bay");

Question 2 of 5

State the exact console text produced by the fragment, ignoring a final trailing newline. Explain how the mix of print and println produces that layout. Then rewrite the fragment so Q, R, and S each appear on a separate line.

System.out.print("Q");
System.out.print("R");
System.out.println("S");

Question 3 of 5

Write one Java print statement whose displayed text is exactly the two lines below, including the quotation marks and the backslash. Ignore a final trailing newline.

file: "notes"
dir \tmp

Then name the escape sequences you used and what each one contributes to the displayed text.

Question 4 of 5

Evaluate each expression in the table. Then explain how integer division, remainder, and a double operand produce those results.

Expression
36 / 8
36 % 8
36 / 8.0

Question 5 of 5

Evaluate 5 + 12 / 4 * 2 and (5 + 12) / 4 * 2. Show the left-to-right grouping of / and * in each expression.