I have a Java program that does a bunch of calculations from some user inputs and at the end it has to print the equation of the plane. Format of the equation of the plane is 6x-2y+3z-4=0.
To get the values 6, -2, 3, & -4 is from a bunch of calculations. So i was thinking to print out the equation is to
System.out.println("Equation is: " + aa + "x" + bb +
"y" + cc + "z" + gg + "=0");
Where aa, bb, cc , gg corresponds to the 4 integers above. But the output is
Equation is: 6x-2y3z-4=0
It seems to print the minus signs in there for the negative numbers but how can i have it print out a plus sign if the number is positive? Like in between -2y3z should be 6x-2y+3z-4=0