Update Project1.java

Finished the method all working as far as I can see can go through it if you like.
Merge pull request #3 from CianBolster/patch-1

Method finished