title: How to write a program that reverses a number a user inputs
body: <p>The homework problem is the user enters a number. Then you have to write a program that reverses that order. So if the user enters 7364 you have to write a program that presents 4637 on the next line. I think I've figured out the solution but I'm not sure how to write it. <br/></p>
  
  <p>Since the last number is the first number in reverse order that means that if someone enters 7364 that means i want to get 4637. I have to write a program that multiplies 4 by 1000, 6 by 100, 3 by 10 and 7 by 1 then add those up to get 4637. I'm not not 100% sure how to do it. What's messing me up is how to multiply one number by 1000, the next by 100, the next by 10 and the next by 1 then add those up. </p>
  
  <pre><code>import acm.program.*;
  public class ReverseNumber extends ConsoleProgram{
      public void run(){
  
      int n = readInt("please enter any positive number: ");
  
      int total = 0;
  
  
      while ( n &gt; 0){
      total = total + n % 10;    &lt;----?
      n = n * 1000;         &lt;----?
        }
      println("the reverse order is" + total); 
  
     }
  
    }
  </code></pre>