rt。准备这样组织文件:
UltraCalc Project
|--UC.cpp: user interface&main
|--void interface(void)
|--void inputEquation(void)
|--bool checkForErrors(void)
|--void solve(void)
|--CCalc.h: expression calculator
|--CCalc.cpp
|--class CCalc
|--double calc(string)
|--CFraction.h: fraction, replace double
|--CFraction.cpp
|--class CFraction
|--double numerator
|--double denominator
|--void reduce(void)
|--CFraction& add(CFraction&)
|--CFraction& minus(CFraction&)
|--CFraction& mult(CFraction&)
|--CFraction& div(CFraction&)
|--double value(void)
|--CTerm.h: term, constant+unknown
|--CTerm.cpp
|--class CTerm
|--CFraction factor
|--char unknown
|--bool isconstant
|--CTerm& add(CTerm&)
|--CTerm& minus(CTerm&)
|--CTerm& mult(CTerm&)
|--CTerm& div(CTerm&)
|--CExpr.h: expression
|--vector<CTerm> terms
|--void combine(void)
|--void erase(CTerm&)
|--void add(CTerm&)
|--CEquation.h: equation
|--CEquation.cpp
|--class CEquation
|--CExpr left, right
|--void init(string)
|--void removeDenominators(void)
|--void removeBrackets(void)
|--void moveTerms(void)
UltraCalc Project
|--UC.cpp: user interface&main
|--void interface(void)
|--void inputEquation(void)
|--bool checkForErrors(void)
|--void solve(void)
|--CCalc.h: expression calculator
|--CCalc.cpp
|--class CCalc
|--double calc(string)
|--CFraction.h: fraction, replace double
|--CFraction.cpp
|--class CFraction
|--double numerator
|--double denominator
|--void reduce(void)
|--CFraction& add(CFraction&)
|--CFraction& minus(CFraction&)
|--CFraction& mult(CFraction&)
|--CFraction& div(CFraction&)
|--double value(void)
|--CTerm.h: term, constant+unknown
|--CTerm.cpp
|--class CTerm
|--CFraction factor
|--char unknown
|--bool isconstant
|--CTerm& add(CTerm&)
|--CTerm& minus(CTerm&)
|--CTerm& mult(CTerm&)
|--CTerm& div(CTerm&)
|--CExpr.h: expression
|--vector<CTerm> terms
|--void combine(void)
|--void erase(CTerm&)
|--void add(CTerm&)
|--CEquation.h: equation
|--CEquation.cpp
|--class CEquation
|--CExpr left, right
|--void init(string)
|--void removeDenominators(void)
|--void removeBrackets(void)
|--void moveTerms(void)