Add solution for assignment b.
Both solutions have very much in common, so it might be a good idea to
define a shared base class. But for now let's just finish this...