home *** CD-ROM | disk | FTP | other *** search
- //
- // CalcEngine -- mem
- // A general C++ class that directly supports a calculator interface
- //
- // You may freely copy, distribute and reuse the code in this example.
- // NeXT disclaims any warranty of any kind, expressed or implied, as to
- // its fitness for any particular use.
- //
- // Created 8-21-90
- //
-
- enum ops {
- DIVIDE = 20,
- MULTIPLY = 21,
- SUBTRACT = 22,
- ADD = 23
- };
-
- class CalcEngine
- {
- enum ops op;
- double accumulator; // result of the mathematics
-
- public:
- CalcEngine(); // C++ constructor
- void clear();
- void setOperation(int whichOp);
- double equalsKey(double secondNum);
- double operationKeys(int whichOp, double firstNum);
- };
-
-