Open in TheBrain

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.

  1. Build user-controlled Y loop with prompt/read and exit message. Test continuation, unexpected input, and stopping response.
  2. Build numeric while counter from 0 to 10; write a line-by-line explanation.
  3. Rewrite as until through 25; compare test truth and ending condition.
  4. Build weekday guessing loop from date command output; explain date abbreviation and locale.
  5. Analyze output order for a loop that echoes before incrementing.
  6. Write loops for 0–20 by twos, countdown 100–0, and powers of three to 243. Include trace tables and boundary rationale.
  7. Change one increment/decrement on paper and predict effect; explain why mismatched test may skip boundary or fail to stop.
  8. Describe safe debugging for infinite loops.

Reflection: How do initialization and condition jointly determine which values appear?