solved sheet 4 programming assignments