SyntaxFix
Write A Post
Hire A Developer
Questions
Your assignments are all nested within your conditional if blocks which means that there is potential for them to never be assigned.
At the top of your class, initialise them to 0 or some other value