School project in java programming