Midterm 1, Section 02, Problem 2: Process States¶
Midterm 1, Section 02, problem 2 of 5 · Length: 10:02 · Exercises: 05r_enums_match (Week 3) · Exam: Section 02 (PDF) · Answer key: Solutions (PDF)
Three parts, worked on pages 4 and 5: (a) a sequence of events traced through apply and next_state, with whether each one was ignored; (b) a new event, Kill: what goes in its arm's two boxes, and what that arm does below the catch-all; (c) a new state, Stopped, with Stop and Continue: which match fails to compile, whether a stopped process can run, and the two arms next_state needs. The answer key's handwriting is written onto the exam page as each step is worked.
Download the video (MP4, 18 MB) · Captions (WebVTT) · All five problems