OOPS LAB : EX NO 11: EXCEPTION HANDLING
USER DEFINED EXCEPTIONS Case Study 1: Online Banking System (R NO :1 - 5) Scenario: A bank application must prevent invalid withdrawals. Step-by-step Questions: Define a class InsufficientBalanceException derived from exception. Create a BankAccount class with balance as a private member. Write a method withdraw(amount) that: Throws exception if amount > balance. Display a meaningful error message using what(). Write a main() function to: Accept withdrawal amount from user Handle exception using try-catch Extend: Add another exception for minimum balance violation. Case Study 2: Student Result Processing System (R NO :6 - 10) Scenario: Marks entered should be within valid range. Step-by-step Questions: Create a user-defined except...