Build a BankOverdraftException workflow

Hard Exception Handling in OOP PRO
🔒 Login to Unlock

Problem Statement

Create a `BankOverdraftException` that stores the `deficit` amount. In `BankAccount.withdraw(amount)`, if the withdrawal exceeds the balance, raise the exception with the deficit. Catch it and print ‘Overdraft of [deficit]’. If successful, print ‘Remaining: [balance]’.

Input Format

Two space-separated integers: balance and withdrawal.

Output Format

Print the remaining balance or the overdraft deficit.

Constraints

None

Sample Input

100 150

Sample Output

Overdraft of 50

Explanation

This demonstrates a complete workflow combining custom exceptions, state protection, and robust error handling.

Starter Code

class BankOverdraftException(Exception):
    # Store deficit
    pass

class BankAccount:
    def __init__(self, balance):
        self.balance = balance
    # Implement withdraw

if __name__ == '__main__':
    b, w = map(int, input().split())
    # Execute and handle
    pass

Limits

  • Time Limit: 1s
  • Memory Limit: 256MB

Embedded C Programming

Updated: March 15, 2026
Intermediate

Embedded systems rely on efficient low-level programming to interact directly with hardware. In this course, you will learn how to write practical Embedded C programs used in real microcontroller-based systems. Rather than focusing only on theory, this course follows a practice-driven approach. Each lesson includes hands-on coding exercises that simulate real firmware development tasks used