JAVA looping and generating output for each value within the condition
<p>I have a range from a min to a maximum.
I want to generate a set of information via calculation for each of these values.
I want to output this information via print.</p>

<p>How do I generate this output given a loop will only output information for 1 value of the range at a time?</p>

<p>Programming experience - absolute beginner. </p>

<p>Here's the code:
Basically, if the user enters 1, I output information for all values of min2. 
else, I output only the set of min2 and their information whose probB is 1/2.
Also, can I just use min1 (which comes from user input) without assigning it to min2?</p>

<pre><code>int prompt = Integer.parseInt(input);   // user input
int min2 = 0;
double probB = 0;
for (min2 = min1; min2 &lt; max1; min2++) // for loop
{
  if (prompt==1){
    int R = 0;
    double Rlow = 0;
    double Rhigh = 0;
    R = (int) (Math.sqrt(2) + 1)*min2;
    Rlow = (Math.sqrt(2)+1)*min2+ 1;
    Rhigh = (Math.sqrt(2)+1)*min2;
    System.out.println(min2);
    System.out.print(""+Rlow+""+Rhigh);
    System.out.println(R);
    probB = (R/R+min2)*(R-1/R+min2-1);
    System.out.println(probB);
  }
  else {
    int R = 0;
    double Rlow = 0;
    double Rhigh = 0;
    R = (int) (Math.sqrt(2) + 1)*min2;
    Rlow = (Math.sqrt(2)+1)*min2+ 1;
    Rhigh = (Math.sqrt(2)+1)*min2;
    probB = (R/R+min2)*(R-1/R+min2-1);

    if (probB == 1/2){
      System.out.println(min2);
      System.out.println(""+Rlow+""+Rhigh);
      System.out.println(R);
      System.out.println(probB);
    }
  }
}
</code></pre>
