Open in TheBrain

Practice Lab 11.13

Practice Lab 11.13 — Complete Loop Logic Lab

Name: Date:

Instructions

Use the assigned shell and work carefully. Record scripts and outputs; include a written trace before execution. Check progress conditions to avoid an endless loop.

  1. Build a while loop controlled by user response Y; ask/read each pass. Explain how updated input controls continuation.
  2. Build numeric while counter to 10 and equivalent until counter to 25; compare conditions.
  3. Build date-based weekday guess loop. Explain date capture, prompt, read, equality test, and locale-sensitive value.
  4. Trace an echo-before-update example and explain boundary output.
  5. Write loop to count 0–20 in steps of 2. List state per iteration and explain endpoint test.
  6. Write countdown 100–0; show decrement and final stop.
  7. Write sequence that multiplies by 3 to reach 243; explain initial value and stopping condition.
  8. Compare all loop types and identify what changes control flow in each.

Reflection: Which loop relies on a human response, and which uses an automatic update?