home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NeXTSTEP 3.2 (Developer)
/
NS_dev_3.2.iso
/
NextDeveloper
/
Examples
/
AppKit
/
CalculatorLab++
/
CalcEngine.h
< prev
next >
Wrap
C/C++ Source or Header
|
1990-10-28
|
681b
|
32 lines
//
// 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);
};