That's why it spit "can't divide by zero" at me! I'll change it to =1 and get rid of that nasty looking booleon to boot! And if I cut down the amount of calculations by restricting the while loop for divisors, I get a more elegant piece of code
I also figured out I don't need an else statement, and that Divisors++ shouldn't be part of the if statement, but part of the While loop for divisors. What a simple mistake, with such a big consequence!
Here's the finished code!
Thanks for the help, I learned a lot about
Java loops on this program!