OOP LAB 13 20122024 105203am
OOP LAB 13 20122024 105203am
Exercises
Exercise 1
Design a Java application that constructs a simple bank account system. Compose a program
where users can deposit and withdraw money. Build exception handling mechanisms to ensure
the following:
1. Initiate an exception if the user attempts to withdraw more money than the available
balance, displaying an appropriate error message.
2. Create an exception for invalid deposit amounts (e.g., negative values) and notify the
user to input a valid amount.
3. Compose a final block to always display the current balance after any operation,
regardless of success or failure.
Arrange the code to include multiple custom exceptions where necessary and design it to ensure
seamless user interaction.