title: Repeat the number conversion of the user input
body: <p>I'm trying to repeat a certain amount of print that prints out &quot;Conversion #1&quot;
  but goes up base on the user input, so if the user enters that they want 3 different conversions it'll be:</p>
  <blockquote>
  <p>Conversion#1</p>
  <p>code....</p>
  <p>Conversion#2</p>
  <p>code...</p>
  <p>Conversion#3</p>
  <p>code...</p>
  </blockquote>
  <p>This is my code:</p>
  <pre><code>import java.util.Scanner;
  import java.text.DecimalFormat;
      public class TempConverter {
  
          public static void main(String[] args){
  
  
              DecimalFormat df = new DecimalFormat(&quot;#,###.0&quot;);
              System.out.println(&quot;Temperature Converter&quot;);
              System.out.println(&quot;---------------------&quot;);
  
               Scanner input = new Scanner(System.in);
  
                 //this is the conversion promt
                System.out.print(&quot;How many conversions would you like to make: &quot;);
                int conversions=input.nextInt();
                for(int i = 0; i &lt; conversions; i++);
                System.out.println(&quot;Conversion # &quot; + i++);
               
                System.out.println (&quot;To convert from celsius to fahrenheit type 1 &quot;);
                System.out.print (&quot;To convert from fahrenheit to celsius type 2: &quot;);
                int choice=input.nextInt();
  
  
                  System.out.print (&quot;Enter temperature: &quot;);
                double temp=input.nextDouble();
                double result=tempChanger(choice,temp);
                  if (choice == 1)
                       System.out.println (&quot;The conversion of &quot;+temp+&quot; from celcius to fahrenheit is &quot;+df.format(result) );
                  else if (choice == 2)
                       System.out.println (&quot;The conversion of &quot;+temp+&quot; from fahrenheit to celcius is &quot;+df.format(result) );
                  else
                       System.out.println (&quot;Not a valid choice, try agiain&quot;);
  
  
  
  
              }
  
              public static double tempChanger(int choice, double temp)
              {
  
               double converted=0.0;
              if (choice == 1)
                     converted=9.0/5.0*temp+32;
                else
                    converted=5.0/9.0*(temp -32);
  
                return converted;
                }
              }
  </code></pre>