assignment 02 - done in Java