Homework

Homework — your menu with input

YOUR app becomes interactive today — the first of the course's three milestones (runs → holds many → saves).

Requirements:

  1. A menu loop — for + switch, repeating until "q".
  2. At least 3 meaningful branches for your theme (e.g. movies: show / set title / mark watched) + q.
  3. A default branch for a bad choice — the program never crashes.
  4. Read input correctly. Use readLine() (bufio.Scanner), not fmt.Scanln, so a multi-word title (e.g. "The Lord of the Rings") is read in full.
  5. A retry loop for number input. Use readInt(): on "abc", the program asks again instead of crashing or kicking back to the menu.
  6. gofmt + a working go run.

Extra (for those who want more): add a "confirm" action — before marking or clearing a record, ask "Are you sure? (y/n)" and read the answer with readLine().

To submit: the code file + a terminal transcript showing: (1) a multi-word title read in full, (2) a bad number rejected with a re-prompt, (3) quitting with "q".

Tip. You now read input correctly — and that stays for the whole course. Next lesson: types in depth. Inside readInt hides strconv.Atoi (text → number) — we'll open it up and see how to check bounds, and why 190/380 can wrongly give 0.