Hi, i m serious freelancer with 100% completion rate and i believe i can help you. This is very simple assignment and i already solved both part A and part B. If you are interested just pm me and i will send you both part solved, so you can take a look if that is exactly what you need. As i said i m serious freelancer and i've never took a single dollar unless my solution was perfect.
Edit: Both parts are solved using closures, exactly as specified.
Thanks, Milan