sdt chapter 3 solutions for review

validation before use in code, better than mine