simple java program for computing polynomials