Despite the name, this calculator reads in any text file containing infix formulas and evaluates them. My program includes these supported operators: +,-,*,/,%,^,<,>,=,&,|,!. For my program the spacing of the equations does not matter. In addition, floating point numbers are also allowed.
You can run the program by first compiling it and then running the following command:
./Main input.txt result.txt
This will read in the equations in input.txt
and output the results in result.txt
.
- Supported Operators: +,-,*,/,%,^,<,>,=,&,|,!
- Supported type of numbers: Integer, Double
- Spacing does not matter
- Error handling for wrong input.
Calculator.java
-- Class which translates and evaluates infix expressions.DoubleLinkedList.java
-- Class implementing aDoublyLinkedList
.DoubleNode.java
-- Class representing the Node for aDoublyLinkedList
.DoublyLinkedList.java
-- Interface of aDoublyLinkedList
.LinkedList.java
-- Class implementing aSimpleLinkedList
.Node.java
-- Class representing the Node for aLinkedList
.SimpleLinkedList.java
-- Interface of aSimpleLinkedList
.Queue.java
-- Class implementing the Queue interface.QueueInterface.java
-- Queue Interface.Stack.java
-- Class implementing the Stack interface.StackInterface.java
- Stack Interface.Main.java
-- I/O part of the program. Reads in file and outputs results in another.OUTPUT.txt
-- Copy & Paste of console output.infix_expr_short.txt
-- Input text file for the program.