update program ex 7
complete program ex 8