File:  [NeXTSTEP 3.3 examples] / Examples / AppKit / CalculatorLab++ / CalcEngine.h
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:48:40 2018 UTC (8 years, 1 month ago) by root
Branches: NeXT, MAIN
CVS tags: NeXTSTEP33, HEAD
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);
};


unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.