LAB Questions
LAB Questions
Problem Statement:
Create a Java program to implement a basic banking system with the
following features:
Input Example:
Copy
Create Account:
Name: Alice Smith
Account Number: 67890
Initial Balance: 2000
Deposit: 1000
Withdraw: 2500
Output Example:
Copy
Account Created Successfully!
Name: Alice Smith
Account Number: 67890
Initial Balance: 2000
Chapter 2 :
Problem Statement:
Design a university management system using Java with the following
features:
Use an abstract class Person with attributes name, age, and methods
like displayDetails().
Create derived classes Student and Professor to
override displayDetails() and add unique attributes like studentId for
students and department for professors.
Add a method to calculate the years of experience for professors based
on their joining year.
Input Example:
Copy
Add Student:
Name: Alice
Age: 20
Student ID: S101
Add Professor:
Name: Dr. Smith
Age: 45
Department: Computer Science
Joining Year: 2005
Output Example:
Copy
Student Details:
Name: Alice
Age: 20
Student ID: S101
Professor Details:
Name: Dr. Smith
Age: 45
Department: Computer Science
Years of Experience: 18
Chapter 3 :
Problem Statement:
Create a Java program for a job application system with custom exception
handling. The program should:
Input Example:
Copy
Apply for Job: Software Engineer
Required Experience: 3 years
Candidate Experience: 2 years
Required Skills: Java, Python
Candidate Skills: Java, C++
Output Example:
Copy
Error: ExperienceNotMetException - Minimum 3 years of experience required.
Error: SkillMismatchException - Required skills: Java, Python.
Chapter 4 :
Problem Statement:
Create a Java program to manage a deck of playing cards using
the Collection interface. The program should:
Allow users to add cards to the deck (each card has a symbol and
value).
Group all cards by their symbol and display them.
Allow users to search for all cards of a given symbol.
Input Example:
Copy
Add Card:
Symbol: Hearts
Value: Ace
Add Card:
Symbol: Hearts
Value: King
Add Card:
Symbol: Spades
Value: Queen
Search Cards:
Symbol: Hearts
Output Example:
Copy
Cards in Deck:
Hearts: [Ace, King]
Spades: [Queen]