Introduction to Algorithms, Programming, and Compilers FRQ Practice

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

Question 1 of 5

A student must assemble one science-fair display. A poster board and a caption card must both be placed on the table before a protective cloth is draped over them. The cloth must be draped before a "Do not touch" sign is taped to the front of the table. (a) Write an ordered list of steps to assemble the display. (b) Identify one pair of steps whose order matters and explain why. Use everyday language; Java code is not required.

Question 2 of 5

Four labeled cups sit in a line from left to right: P, Q, R, S. Follow these steps once, in order: (1) swap the leftmost cup with the rightmost cup; (2) move the new leftmost cup to the far right. (a) Show the line after step 1. (b) Show the line after step 2. (c) Explain what sequencing means in this example.

Question 3 of 5

During study hall, a student types Java source on a library Chromebook in a plain text editor, then copies the file to a lab computer. The lab compiler reports a missing required semicolon and does not produce a successful new build. (a) Explain what the student should do before running this new program. (b) After the program compiles, explain why the student should still test it with at least one planned input and expected output. (c) Explain whether the student was required to use an IDE for this work.

Question 4 of 5

A classmate claims that once a greenhouse-sensor program compiles, the programmer can skip choosing test cases. (a) Explain what successful compilation does and does not establish. (b) Describe one concrete test the classmate should still perform. (c) Explain one way an IDE can help during this process without claiming that the IDE guarantees a correct algorithm.

Question 5 of 5

A lab assistant recorded three independent Java programs. For every row, name the error as syntax, logic, or run-time, and justify the name by saying when the problem shows up or how the program behaves.

Program Observation
W The compiler rejects a statement because a required closing quotation mark is missing.
X The program finishes normally, but it was supposed to report the older sibling's age and instead reports the younger sibling's age.
Y The program compiles, then stops during execution when an unhandled exception occurs while reading a missing configuration file.