Program for Physics (Chapter on Potential)

I wrote a quick program for my physics class in order to solve a question on the homework and I did not want to make a mistake. The program is below, I believe I did everything correctly. The Energy Required to Group Charges in a Rectangle View the code on Gist.