Practice Lab 11.20
Practice Lab 11.20 — Expanded Lab 11 Skills Check
Name: Date:
Instructions
Complete this full practice in Bash using safe, short tests. Record code, output, and a trace for every loop. Verify termination logic before running.
- Write the
carryon=Yuser-controlledwhileloop, including prompt/read in the body and final message. Test several responses. - Write a
whilecounter to 10 and anuntilcounter to 25; compare behavior and trace first/last iterations. - Create weekday guessing loop using
date +%a; describe command substitution and locale/time variance. - Compare print-before-update and update-before-print counter loops; state which boundaries are shown.
- Write a loop counting 0 to 20 by 2; explain initialization, condition, increment, output.
- Write countdown 100 to 0 and a multiply-by-three sequence to 243. Trace start/end and demonstrate termination.
- Create one additional safe sequence of your own; state start, target, step/update, condition, and predicted values before running.
- Explain how to debug nonprogress, off-by-one errors, and targets skipped by an update.
Reflection: What is your checklist for proving a loop will terminate?