A community for students.
Here's the question you clicked on:
 0 viewing
AdozenBABYdogs
 one year ago
A for statement isn't running inside of my document
AdozenBABYdogs
 one year ago
A for statement isn't running inside of my document

This Question is Closed

AdozenBABYdogs
 one year ago
Best ResponseYou've already chosen the best response.0package 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^" + (ij) + ": "); a[ij] = in.nextFloat(); } for (j = 0; j > i; j++) { System.out.print("Please input c when c is cX^" + (ij) + ": "); c[ij] = in.nextFloat(); } } } }

mathmate
 one year ago
Best ResponseYou've already chosen the best response.0the second parameter of your forloops 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.
Ask your own question
Sign UpFind more explanations on OpenStudy
Your question is ready. Sign up for free to start getting answers.
spraguer
(Moderator)
5
→ View Detailed Profile
is replying to Can someone tell me what button the professor is hitting...
23
 Teamwork 19 Teammate
 Problem Solving 19 Hero
 Engagement 19 Mad Hatter
 You have blocked this person.
 ✔ You're a fan Checking fan status...
Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.