Practice Lab 11.5
Practice Lab 11.5 — Full while/until Practice Lab
Name: Date:
Instructions
Use Bash and the course shell conventions. Trace before running. If a loop appears stuck, stop it using the instructor-approved method and inspect its condition/update. Record code, output, and explanations.
- Create a user-input loop that continues for
Y; include prompts andreadinside body. Test two repeats and a stopping response. - Implement a counter loop using
while, starting 0 and ending at 10. Explain each line. - Implement the same count using
untiland end at 25. Explain why its condition reads differently. - Write a weekday guessing loop based on
date +%a; prompt until match. Note case/locale and explain variable assignment by command substitution. - Trace print-before-increment loop and explain the visible range.
- Create scripts counting 0–20 by 2, 100 down to 0, and multiplying by 3 until 243. For each, record test, update, output order and why it terminates.
- Compare list iteration from Lab 10 with condition-controlled loops here.
Reflection: Which loop required the most careful boundary planning?