https://rentry.org/PPP2_calculator_cli

// 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;
}

Calculator.hCalculator.cppcalc_util.hcalc_util.cpp

Edit
Pub: 09 Mar 2023 04:57 UTC
Edit: 03 May 2023 10:39 UTC
Views: 430