homework of CMPT270 - A3