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