0% found this document useful (0 votes)
7 views1 page

OOP LAB 13 20122024 105203am

Uploaded by

usersn497
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

OOP LAB 13 20122024 105203am

Uploaded by

usersn497
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

s CSL-210: Object Oriented Programming Lab

Semester: Spring 2024


Lab Engineer: Syed Osama Ali

Lab13: Exception Handling

Designing and implementing Java programs that deal with:


1. Exceptions
2. Types of Exceptions

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.

Department of Computer Sciences 1/1 Semester: Spring 2024


CSL-210: Object Oriented Programming Lab Lab 04: Classes and Objects

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy