AdozenBABYdogs
  • AdozenBABYdogs
A for statement isn't running inside of my document
Computer Science
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
katieb
  • katieb
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
AdozenBABYdogs
  • AdozenBABYdogs
package polyDiv; import java.util.*; public class polyDivide { @SuppressWarnings("resource") public static void main(String[] args) { //Initialization and decoration// Scanner in = new Scanner(System.in); float r, b, d, p; int i, j; float[] a, c, n, m; //Introduction// System.out.println("Welcome to the Polynomial Divider!"); System.out.println("Divide things like X^2 and so on!"); System.out.println(""); //loopidy loop// while (true) { System.out.print("Please input the number of the highest exponent: "); i = in.nextInt(); n = new float[i]; m = new float[i]; a = new float[i]; c = new float[i]; for (j = 0; j > i; j++) { System.out.print("Please input a when a is aX^" + (i-j) + ": "); a[i-j] = in.nextFloat(); } for (j = 0; j > i; j++) { System.out.print("Please input c when c is cX^" + (i-j) + ": "); c[i-j] = in.nextFloat(); } } } }
mathmate
  • mathmate
the second parameter of your for-loops is playing a trick on you. Read up: https://docs.oracle.com/javase/tutorial/java/nutsandbolts/for.html and note the definition: "When the termination expression evaluates to false, the loop terminates." since j=0 to start, j>i is already false, so the loop never got executed.

Looking for something else?

Not the answer you are looking for? Search for more explanations.