title: Java: Simultaneous equations
body: <p>I've got this equation that I want to solve with a java application.</p>
  
  <p>It looks like this</p>
  
  <pre><code>y*n-1 = y*n-2 + 1035 + [(n-1)^2 + (n-3)] * y
  y*n   = y*n-1 + (n^2 * y)
  </code></pre>
  
  <p>So the user should input N and then the Java application should calculate how much Y is.
  Is that somehow possible to do and if so, how?</p>
  
  <p>Thanks in advance,
  Michael.</p>
  
  <p>EDIT:</p>
  
  <p>Thanks to mprabhat, it looks like this right now but I'm still doing it wrong somehow..</p>
  
  <pre><code>   public class equation
     {
  
  
  private static double solveFirstEquation(double n){
      double y =0;
      if(n &gt; 0) {
          y = ((n -1) + Math.pow( n , 2))/ n;
      }
      return y;
  }
  
  private static double solveSecondEquation(double n){
      double y = 0;
      if(n &gt; 1) {
          y = ((n-2)+ (Math.pow(n-1, 2) + n-3) + 1035)/(n-1);
      }
      return y;
  
  
  }
  public static void main(String args[])
  {
  System.out.println("How much is n?");
  int n = 0;
  n = Keyboard.readInt();
  }
      }
  </code></pre>
  
  <p>I tried to put the "void main String args" in the top but that wouldn't let me run the application.</p>