tdogg04
Nov 15th, 2006, 04:12 PM
This is the code for my calculator program, please help FAST!
Write a calculator class that accepts equations as input, e.g.
1 + 6 * 9 – 12 / 4 =
Rules:
- an equation is entered as in the example above
- the operators +, -, *, /, and = are to be known by the calculator
- all operands are numbers of type double
- operators and operands are entered separated by spaces
- the equals sign ends the input; pressing return causes the result to be displayed
- calculations are to be done following the rules of operator precedence
- input can be as long as desired as long as it follows the above rules
The program will consist of two parts: a class for the calculator with all methods and data needed to solve the problem, and a main program that uses the calculator class. Your program must follow the OOP paradigm and must implement (several) methods sensibly.
Write a calculator class that accepts equations as input, e.g.
1 + 6 * 9 – 12 / 4 =
Rules:
- an equation is entered as in the example above
- the operators +, -, *, /, and = are to be known by the calculator
- all operands are numbers of type double
- operators and operands are entered separated by spaces
- the equals sign ends the input; pressing return causes the result to be displayed
- calculations are to be done following the rules of operator precedence
- input can be as long as desired as long as it follows the above rules
The program will consist of two parts: a class for the calculator with all methods and data needed to solve the problem, and a main program that uses the calculator class. Your program must follow the OOP paradigm and must implement (several) methods sensibly.