Algorithms with Selection and Repetition FRQ Practice

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

Question 1 of 5

A stage crew must prepare one music stand. The stand must be rolled into place before a score booklet is set on it. If the booklet is already on the stand, skip placing another; otherwise place one booklet. Keep sliding the clip until the pages stay shut. Then dim the stand light. (a) Write a valid ordered algorithm. (b) Identify the selection. (c) Identify the repetition. Use everyday language; Java code is not required.

Question 2 of 5

Four labeled stones sit left to right: J, K, L, M. Follow these steps in order. (1) If the rightmost stone is M, swap the two leftmost stones; otherwise move the rightmost stone to the far left. (2) Repeat "move the leftmost stone to the far right" until the leftmost stone is L. (a) Show the line after step 1. (b) Show each line produced while repeating step 2, and the final line. (c) Explain what sequencing means in this example.

Question 3 of 5

A compost volunteer processes one food-scrap bucket. The lid must be opened before any scraps are added. If the bucket already smells sour, add a layer of dry leaves; otherwise skip the leaves. Keep stirring until the scraps are mixed into the pile. Close the lid last. (a) Write the algorithm. (b) Explain what is wrong with the sequence "stir, add scraps, open lid, close lid." (c) Name one pair of steps whose order can be swapped only if the requirements still hold, or state that the listed constraints leave no free swap and justify that claim.

Question 4 of 5

A photo-booth attendant follows the table. The first print is too dark. The second print is acceptable. The booth starts with its curtain closed.

Step Instruction
1 If the curtain is closed, open it; otherwise leave it
2 Seat the guest
3 Press Capture and wait until a print drops
4 If the print is too dark, raise the lamp one notch and repeat from step 3 until the print is acceptable

(a) State whether step 1 opens the curtain. (b) How many times is Capture pressed? (c) Identify the selection steps and the repetition. (d) Explain why seating the guest must happen before Capture.

Question 5 of 5

A lab-goggle algorithm requires: pick up the goggles; if the lenses are fogged, wipe them, otherwise skip wiping; keep adjusting the strap until the goggles stay on without slipping; then enter the lab. A student instead enters the lab, then picks up the goggles, then wipes the lenses whether or not they are fogged, then pulls the strap once. (a) Identify two requirement violations in the student's version. (b) Rewrite a correct algorithm that uses selection and repetition. (c) Explain why entering the lab last is a sequencing requirement.