java - I am getting a not a statement error -


i need figuring out doing wrong. here coding far. trying plot coordinates on circle. not statement error.

public class mathclass {      public static void main (string [] args)     {      double y1;     double y2;     system.out.println("points on circle of radius 1.0");     system.out.printf ( "%6s" , "x1", "y1", "x1" , "y2");     system.out.println ("----------------------------------");     (double x1 = 1.00; x1> -1.10; x1 + -0.10)     {         double x1sq= math.pow(x1,2);         double r = 1;         double y1sq = r- x1sq;         y1= math.sqrt(y1sq);         system.out.printf( "%.2f", x1, "   ", y1);      }  } 

your problem on line 10 of code posted. issue x1 + -0.10 expression, not statement (hence "not statement" error you're getting). want x1 += -0.10 instead. or, more clear it, use -= instead of adding negative, whole loop condition looks this:

for (double x1 = 1.00; x1 > -1.10; x1 -= 0.10) { ... } 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -