Programming assignment 4 (代码格式可作为示范)