Exercise:



Solution: (one of many for the circuit diagram)



Some comments on the solutions I saw: