Trying to format so that my values from the xValue and yValue arrays appear with three decimal places. This is my attempt although java seems to not be accepting it :(
double[] xValues = new double[arrayAmount];
double[] yValues = new double[arrayAmount];
xValues[0] = minimumValue;
System.out.println("Values");
for (int index = 0; index<arrayAmount; index++)
{
yValues[index] = 20.0 * Math.abs((Math.sin(xValues[index])));
System.out.printf("x: " + (%1.3f, xValues[index]) + "," + "y: " + (%1.3f, yValues[index]); // compiler error
xValues[index+1] = xValues[index] + increment;
}
printf
expects aString
as its first argument, your current argument is a badly formed expression. You could do