All pastes #487907 Raw Edit

Stuff

public java v1 · immutable
·published 2007-05-14 18:48 UTC
rendered paste body
public class Poly	{	private String variableName;	private long [] coeffs;	private long denominator;// Constructorspublic Poly ( String polyVariableName, long [] polyCoeffs, long polyDenominator )	{		variableName = polyVariableName;		coeffs = polyCoeffs;		denominator = polyDenominator;	}// Debug quality printing.  Takes a polynomial and displays its coefficents.public String debugPrint ()	{		String returnValue = "(";		returnValue = returnValue + coeffs [0] + "*" + variableName + "^0";				for (int i = 1; i < coeffs.length; i++)			{ returnValue = returnValue + " + " + coeffs [i] + "*" + variableName + "^" + i; };		returnValue = returnValue + ")/";		returnValue = returnValue + denominator;		return returnValue;	}// Start of Main methodpublic static void main(String[] args)	{		String a = x;		long[] b = {1,2,3};		long c = 4;		Poly test = new Poly(a,b,c);		System.out.printf("Polynomial is %d", debugPrint(test));	}	}