Jan-06-2019, 04:43 PM
I didn't read through that whole thing but it looks like you just copy-pasted your homework. We're not going to do it for you, but we would love to help. What you need to do is give it a try, and then when you get stuck, post your code (in code tags) along expected vs. actual output (hard-coded any relevant inputs). Usually no more than 5-10 lines are needed to demonstrate a problem, even for large code. The more simplified your question, the more likely you'll get a speedy and helpful reply.