Just working on translating a C++ homework to JAVA for practice