BCA (AI/DL)
2024 -2027 batch
II Semester
Programming with Java Lab Questions
1. A hotel management system is required to manage the hotel's rooms, guests, and staff. Th
e system should have the following features:
Room management: The system should be able to manage different types of rooms,
including single, double, and suite rooms. Each room should have a unique room number,
room type, and rate.
Guest management: The system should be able to manage guest information, including name,
contact details, and room assignment.
Staff management: The system should be able to manage staff information, including
name, role, and contact details.
Booking management: The system should be able to manage room bookings, including
booking dates, room type, and guest information.
Create a Java program to implement the hotel management system using classes and ob
jects.
[Link] an Employee Management System that uses constructors to initialize employee obj
ects. The system should have the following features:
Employee class: The Employee class should have attributes like employee ID, name,
department, and salary.
Constructor: The Employee class should have a constructor that initializes the employee
object with the given attributes.
Methods: The Employee class should have methods to display employee details and
calculate salary.
[Link] a Shape Calculator program that uses method overloading to calculate the area
and perimeter of different shapes. The program should have the following features:
Shape class: The Shape class should have methods to calculate the area and
perimeter of different shapes (circle, rectangle, triangle).
BCA II semester (AIDL) - EVEN 2024 - 2025
Method overloading: The Shape class should use method overloading to
calculate area and perimeter based on different parameters (shape type,
dimensions).
[Link] a University Management System that uses method overloading to calculate th
e fees for different types of students. The system should have the following features:
Student class: The Student class should have methods to calculate fees for
different types of students (undergraduate, graduate, international).
Method overloading: The Student class should use method overloading to
calculate fees based on different parameters (student type, number of credits,
tuition rate).
[Link] a Vehicle Management System that uses single inheritance to manage different
types of vehicles. The system should have the following features:
Vehicle class: The Vehicle class should be the parent class and have attributes
like vehicle ID, make, and model.
Car class: The Car class should be the child class and inherit from the Vehicle
class. It should have additional attributes like number of doors and transmission
type.
Methods: The Vehicle class should have methods to display vehicle details, and
the Car class should have methods to display car-specific details.
[Link] an Employee Management System that uses single inheritance to manage
different types of employees. The system should have the following features:
Employee class: The Employee class should be the parent class and have
attributes like employee ID, name, and department.
Manager class: The Manager class should be the child class and inherit from the
Employee class. It should have additional attributes like team size and
department.
Methods: The Employee class should have methods to display employee details,
and the Manager class should have methods to display manager-specific details.
[Link] a Vehicle Management System that uses multilevel inheritance to manage diffe
rent types of vehicles. The system should have the following features:
Vehicle class: The Vehicle class should be the grandparent class and have
attributes like vehicle ID, make, and model.
BCA II semester (AIDL) - EVEN 2024 - 2025
MotorizedVehicle class: The MotorizedVehicle class should be the parent class
and inherit from the Vehicle class. It should have additional attributes like
engine capacity and fuel type.
Car class: The Car class should be the child class and inherit from the
MotorizedVehicle class. It should have additional attributes like number of
doors and transmission type.
ElectricCar: The ElectricCar class should be the child class and inherit from the
Car class. It should have additional attributes like batteryCapacity and range
8. Create a Bank Account Management System that uses hierarchical inheritance to
manage different types of bank accounts. The system should have the following features:
Account class: The Account class should be the parent class and have attributes
like account number, account holder's name, and balance.
SavingsAccount class: The SavingsAccount class should be a child class and
inherit from the Account class. It should have additional attributes like interest
rate.
CheckingAccount class: The CheckingAccount class should be another child
class and inherit from the Account class. It should have additional attributes like
overdraft limit.
[Link] a university management system that uses hybrid inheritance to manage differ
ent types of personnel. The system should have the following features:
Person class: The Person class should be the base class and have attributes like
name, age, and address.
Student class: The Student class should inherit from the Person class and have
additional attributes like student ID, course, and GPA.
Teacher class: The Teacher class should also inherit from the Person class and
have additional attributes like teacher ID, department, and salary.
TeachingAssistant class: The TeachingAssistant class should inherit from both
the Student and Teacher classes, combining the attributes and methods of both
classes.
BCA II semester (AIDL) - EVEN 2024 - 2025
[Link] a student management system that uses abstract classes and methods to calcul
ate the GPA of undergraduate and graduate students. The system should have the follo
wing features:
Student abstract class: The Student class should be an abstract class with
attributes like student ID, name, and courses. It should have an abstract method
calculateGPA() that calculates the GPA of a student.
UndergraduateStudent class: The UndergraduateStudent class should extend the
Student class and implement the calculateGPA() method. Undergraduate
students have a GPA calculation formula based on their course grades.
GraduateStudent class: The GraduateStudent class should also extend the
Student class and implement the calculateGPA() method. Graduate students
have a different GPA calculation formula based on their course grades and
research work.
[Link] a vehicle management system that uses interfaces to calculate fuel efficiency
and display details of cars and trucks. The system should have the following features:
Vehicle interface: The Vehicle interface should have two methods:
calculateFuelEfficiency() and displayDetails(). The calculateFuelEfficiency() method
calculates the fuel efficiency of a vehicle based on its fuel consumption and distance
traveled. The displayDetails() method displays the details of a vehicle.
o Car class: The Car class should implement the Vehicle interface. Cars have
attributes like make, model, fuel capacity, and fuel consumption.
o Truck class: The Truck class should also implement the Vehicle interface.
Trucks have attributes like make, model, fuel capacity, fuel consumption, and
payload capacity.
[Link] an inventory management system that uses an array to store and manage pro
duct information. The system should have the following features:
Product class: The Product class should have attributes like product ID, product
name, quantity, and price.
Inventory class: The Inventory class should have methods to add, remove,
update, and display products in the inventory.
The system should be able to handle a maximum of 100 products.
BCA II semester (AIDL) - EVEN 2024 - 2025
[Link] a banking system that simulates multiple bank transactions concurrently usin
g multi-threading. The system should have the following features:
Account class: The Account class should have attributes like account number,
account holder's name, and balance. It should have methods to deposit and
withdraw money.
Transaction class: The Transaction class should implement the Runnable
interface and represent a single transaction. It should have attributes like
transaction type (deposit or withdrawal), amount, and account.
The system should be able to handle multiple transactions concurrently.
[Link] a user authentication system that handles exceptions during the login process.
The system should have the following features:
User class: The User class should have attributes like username and password.
AuthenticationSystem class: The AuthenticationSystem class should have
methods to register users, login users, and handle exceptions during the login
process.
The system should throw exceptions for invalid username or password.
[Link] and develop an applet-based digital clock application that displays the current
time in hours, minutes, and seconds. The clock should update in real-time and provide a
visually appealing interface.
The digital clock should display the current time in the format HH:mm:ss.
The clock should update every second to reflect the current time.
The applet should have a clean and simple design that makes it easy to read the
time.
The clock should be displayed in a large font size to make it easily readable.
[Link] and develop a GUI application with multiple buttons that perform different a
ctions when clicked. The application should have buttons to calculate the area of a recta
ngle, calculate the area of a circle, and exit the application. The application should also
display the results of the calculations.
The application should have a GUI with multiple buttons.
Each button should perform a different action when clicked.
The application should calculate the area of a rectangle and a circle based on
user input.
BCA II semester (AIDL) - EVEN 2024 - 2025
The application should display the results of the calculations.
The application should have an exit button to close the application
BCA II semester (AIDL) - EVEN 2024 - 2025