smithers.calculator
Class Calculator

java.lang.Object
  extended by smithers.calculator.Calculator

public class Calculator
extends java.lang.Object

A calculator.


Constructor Summary
Calculator()
           
 
Method Summary
static void main(java.lang.String[] args)
          Runs the calculator program.
 java.lang.String parse(java.lang.String input)
          Parses the given expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Calculator

public Calculator()
Method Detail

parse

public java.lang.String parse(java.lang.String input)
Parses the given expression.

Parameters:
input - the expression to evaluate
Returns:
the result of the evaluation

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Runs the calculator program. If arguments are given, they are each evaluated in turn. Otherwise the program reads expressions from standard input until a blank line is read.

Parameters:
args - the arguments, if any
Throws:
java.lang.Exception