https://rentry.org/PPP2_calculator_cli ⎗ ✓ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47// Code derived from Stroustrup's PPP2 book // From Chs. 6 & 7, The Calculator Project - CLI edition // -and beginning on p 174 /* Usage examples: > 1+2; = 3 > 5%8; = 5 > 2*(3/4-5); = -8.5 > let forty = 6; = 6 > let two = 9; = 9 > (forty*two) - 12; = 42 */ #include <iostream> #include <stdexcept> #include "Calculator.h" using std::cerr; using std::exception; int main() try { Calculator calc{}; calc.run(); } catch (exception const& e) { cerr << e.what() << '\n'; return 1; } catch (...) { cerr << "exception \n"; return 2; } sauce: Bjarne Stroustrup's PPP2 textbook /robowaifu/'s official C++ learning textbook thread Calculator.h • Calculator.cpp • calc_util.h • calc_util.cpp