pw.println("<b><font size=\"3\" face=\"Arial\">" + message + "</font></b>");
}
private void WriteExercises(PolynomialExpression p[], boolean printSolutions, PrintWriter pw, PolynomialConfig pc, ReportConfig rc) {
int i;
ExpressionParser ep = new ExpressionParser();
StartTable(pw);
pw.write("Test # " + pc.getRandom().getSeed());
if (printSolutions) {
WriteKeyInTitle(pw);
}
switch (rc.getReportMode()) {
case ExpandedToSimplified:
WriteBreak(pw);
WriteMessage("Simplify these polynomials.", pw);
break;
case SimplifiedToExpanded:
WriteBreak(pw);
WriteMessage("Expand these polynomials.", pw);
break;
}
WriteBreak(pw);
for (i = 0; i < rc.getTotalProblems(); i++) {
StartRow(pw);
WriteIndexColumn(i + 1, pw);
StartLeftColumn(pw);
switch (rc.getReportMode()) {
case ExpandedToSimplified:
pw.write(ep.parseString(p[i].toString()));
break;
case SimplifiedToExpanded:
pw.write(ep.parseString(p[i].Simplify().toString()));
break;
}
StopColumn(pw);
StartRightColumn(pw);
if (printSolutions == true) {
switch (rc.getReportMode()) {
case ExpandedToSimplified:
pw.write(ep.parseString(p[i].Simplify().toString()));
break;
case SimplifiedToExpanded:
pw.write(ep.parseString(p[i].toString()));
break;
}
} else {
pw.write(" ");
}