|
|
Sample Programs from NeXSTEP 3.3
//
// 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);
};
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.