title: implementation of simple calculator
body: <p>Create a program which simulates a very simple calculator</p>
  
  <p>So I have been asked to implement an abstract class that represents binary (having 2 arguments) arithmetic expression </p>
  
  <pre><code>abstract class ArithmeticExpression {
  
      double binary1;
      double binary2;
  
      public abstract void evaluate ();
  
      public abstract void display ();
  
  }
  </code></pre>
  
  <p>so then I created sub classes add, multiply, subtract, and divide. In subtract I have:</p>
  
  <pre><code>public class subtract extends ArithmeticExpression {
      // private double result;
      double binary1;
      double binary2;
  
      public subtract (double x, double y) {
          this.binary1 = x;
          this.binary2 = y;
      }
  
      public  void evaluate () {
  
          System.out.println("Expression: " + getsubX() + " - " + getsubY() + " = ");
  
          // return result;
      }
  
      public  void display () {
  
      }
  
      public double getsubX() {
  
      }
  
      public double getsubY() {
  
      }
  </code></pre>
  
  <p>Using the classes I should be able to represent any arbitrary expression, with no hard coding.</p>
  
  <p>It is also said evaluate should return the result as double and display method should print the expression out in string. Am I on the right track? What am I missing here? The part I do not understand how it is able to represent any expression?</p>