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.
- Create a sentinel-driven
whileloop that repeats forY, prompting and reading within each iteration. Test multiple inputs and explain. - Create counter-controlled
whilefrom 0 to 10; annotate initialization, test, body, increment, output, termination. - Create
untilloop through 25 and compare towhile. - Create a weekday guessing script using date command substitution, prompt/read, and repeat-until-correct. Explain locale/time dependence.
- Analyze a loop that prints then increments; identify output range and boundary.
- Write and trace count-by-two 0–20, countdown 100–0, and multiply-by-three until 243. Include start/test/update/output order.
- Explain how to debug a non-progressing loop safely.
- Compare sentinel-controlled, counter-controlled, and sequence loops.
Reflection: Which trace evidence proves your loop reaches its intended endpoint and stops?