#include #include "DerivedException.hpp" using namespace std; int main() { try { int option; cout << "Enter option (1-2): "; cin >> option; BaseException bex(-2); DerivedException dex(4,5); switch(option) { case 1: throw bex; break; case 2: throw dex; break; } } catch(BaseException &ex) { cout << ex.message(); } catch(DerivedException &ex) { cout << ex.message(); } return 0; }