Practice ยท 3 of 3
Injection Seam
Write makeGreeter(clock) โ clock is () => integer hour (0โ23). Returns greet(name): before 12 => "Good morning, NAME", 12โ17 => "Good afternoon, NAME", otherwise "Good evening, NAME". The point: behavior depends on time, so time MUST arrive by injection โ greet must produce all three outcomes with a controlled clock.
Difficulty: intermediate
Press Submit to check your solution.
Back to lesson: Practice: Seams & Doubles โ Practice