chapter 5 problem 6 | ScratchStats