Practice code for chapter4.