This stack is for a Code Review (looking for improvements in style, efficiency, design, etc.) of
working code. Since your code doesn't work, it needs to be posted on Stackoverflow which is designed to help you find where it's falling apart. When you post it there, please be
very specific about
exactly what "having problems" means. Are you getting error messages? Is it not calculating the right result? What "problem" are you having. In the meantime, expect this to be closed since it's not on-topic. —
FreeMan 27 secs ago