@Niels van Ee, please keep in mind dates the dates on threads - this one in particular is around a 1 1/2 years old, which is an eternity in internet and forum time (and in homework time, way too late...
Type: Posts; User: copeg
@Niels van Ee, please keep in mind dates the dates on threads - this one in particular is around a 1 1/2 years old, which is an eternity in internet and forum time (and in homework time, way too late...
Break the problem down...how would you do this by hand? Write it out on paper...that's your logic/algorithm. Then convert that to code.
Suggested reading:...
What did you try? Where are you stuck? We are not a homework service, but we will try and help if you actually show an effort.