I'm not sure what might be wrong.
Some of the variable names in your flow chart are ambiguous and appear in some of the modules, but not in others, so without actually seeing some of the code I can't be sure where the error might be located.
If you could provide some code that would be appreciated, remember to surround code with code tags
I'll be happy to look over the code for any logic errors, remember that TSF does not write your code for you.
Especially for educational assignments, we prefer to help you identify your problem and give you a chance to solve it on your own.
The programing language does not matter; there are enough helpers around the programing forum that someone will know the language