Open in TheBrain

Practice Lab 11.10

Practice Lab 11.10 — Lab 11 Integrated Skills Check

Name: Date:

Instructions

Complete the full Bash loop skills check. Record code, traces, output, and explanation. Check every loop’s update and termination condition before running; test small ranges first.

  1. Create a sentinel-driven while loop that repeats for Y, prompting and reading within each iteration. Test multiple inputs and explain.
  2. Create counter-controlled while from 0 to 10; annotate initialization, test, body, increment, output, termination.
  3. Create until loop through 25 and compare to while.
  4. Create a weekday guessing script using date command substitution, prompt/read, and repeat-until-correct. Explain locale/time dependence.
  5. Analyze a loop that prints then increments; identify output range and boundary.
  6. Write and trace count-by-two 0–20, countdown 100–0, and multiply-by-three until 243. Include start/test/update/output order.
  7. Explain how to debug a non-progressing loop safely.
  8. Compare sentinel-controlled, counter-controlled, and sequence loops.

Reflection: Which trace evidence proves your loop reaches its intended endpoint and stops?