Practice Lab 11.19
Practice Lab 11.19 — Conditions, Counters, and Multiplication
Name: Date:
Instructions
Complete the integrated worksheet in Bash. Record scripts and trace values, use small tests, and ensure each update progresses toward termination.
- Build user-controlled
Yloop with prompt/read and exit message. Test continuation, unexpected input, and stopping response. - Build numeric
whilecounter from 0 to 10; write a line-by-line explanation. - Rewrite as
untilthrough 25; compare test truth and ending condition. - Build weekday guessing loop from date command output; explain date abbreviation and locale.
- Analyze output order for a loop that echoes before incrementing.
- Write loops for 0–20 by twos, countdown 100–0, and powers of three to 243. Include trace tables and boundary rationale.
- Change one increment/decrement on paper and predict effect; explain why mismatched test may skip boundary or fail to stop.
- Describe safe debugging for infinite loops.
Reflection: How do initialization and condition jointly determine which values appear?