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.
- Build a
whileloop controlled by user responseY; ask/read each pass. Explain how updated input controls continuation. - Build numeric
whilecounter to 10 and equivalentuntilcounter to 25; compare conditions. - Build date-based weekday guess loop. Explain date capture, prompt, read, equality test, and locale-sensitive value.
- Trace an echo-before-update example and explain boundary output.
- Write loop to count 0–20 in steps of 2. List state per iteration and explain endpoint test.
- Write countdown 100–0; show decrement and final stop.
- Write sequence that multiplies by 3 to reach 243; explain initial value and stopping condition.
- 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?