Assignment 1 Java Code