AJP_Micro
AJP_Micro
of Engineering Nepti,
Ahmednagar
DEPARTMENT OF COMPUTER
ENGINEERING
MICRO
PROJECT
REPORT
ON
Advanced Java Programming(AJP)
FOR
2024-2025
1|P age
Shri Chhatrapati Shivaji Maharaj College
of Engineering Nepti,
Ahmednagar
CERTIFICATE
This is to certify
Student,
have successfully completed the Project work entitled “Hotel Management System” under my
supervision, in the partial fulfillment of the requirements for the TY Diploma in subject Advanced
Java Programming and the report submitted to Prof. Sayali Chitale for academic year 2024-2025.
Date :
2|P age
ACKNOWLEDGMENT
It is my great pleasure to present the honor and sincere gratitude to my guide Prof.Sayali Chitale Shri
Chhatrapati Shivaji Maharaj College Of Engineering A.nagar helped in joining the hands in developing
each and every steps of this project and for valuable guidance and constant encouragement during
completion of project work. It was my privilege and pleasure to work under his valuable guidance. I
am indeedgratefully to him for providing me helpful suggestions. Due to his constant encouragement
andinspiration I could complete my project work. I am very thankful to Principal, Shri Chhatrapati Shivaji
Maharaj College Of Engineering A.nagar
My grateful thanks to Prof.Jagtap.V.V Head of Computer Department, for their valuable
guidance,support and constant encouragement.
I express thanks to my family and friends for their support and encouragement at every stage of successful
completion of this project work.
My sincere thanks to all those who have directly or indirectly helped me to carry out this work.
Akash Khurd
Prathmesh Bhapkar
Onkar Maheshan
3|P age
INDEX
Sr. No Title Page No.
1. Introduction 5
2. Aim 6
3. Literature Review 6
3. Outcomes 6
4. Program 7-11
5. Output 12-15
6. References 15
7. Conclusion 16
4|P age
Introduction
Book Rooms: Guests can enter their details to check availability and reserve rooms,
with real-time updates on room status.
Check Availability: Users can view available rooms instantly, enhancing the booking
experience.
Order Food: Guests can select multiple food items from a menu using a multi-
select list, specifying quantities for their orders.
Calculate Total Cost: The application computes the total cost of food orders and
displays it in a dialog box for clarity.
This system effectively supports hotel operations, making it easy for staff and guests to
manage bookings and dining needs efficiently.
5|P age
Aim / Benefits of the micro-project
The primary aim of the Hotel Management System is to simplify and automate the
process of managing hotel room bookings and food ordering. By providing a user-
friendly interface, the system seeks to enhance the overall guest experience and
streamline hotel operations. The application is designed to minimize manual errors,
improve efficiency, and facilitate better communication between guests and hotel staff.
The Hotel Management System aims to provide a seamless and efficient solution for
hotel management, benefiting both guests and hotel staff through improved processes
and enhanced experiences.
Literature Review
The development of a Hotel Management System (HMS) with integrated food ordering
capabilities draws upon various concepts, methodologies, and technologies discussed
in existing literature. This review highlights key areas relevant to the system's design
and implementation, including hotel management systems, user interface design, food
ordering systems, and software development methodologies.
Outcomes
Enhanced Efficiency: Streamlined operations reduce staff workload and expedite
service.
Increased Guest Satisfaction: User-friendly interface improves the booking and dining
experience.
Higher Revenue: Easier food ordering encourages additional purchases from guests.
Real-Time Information: Instant updates on room availability and order status
enhance transparency.
Data Insights: Collection of guest preferences informs service improvements and
marketing strategies.
6|P age
Program
import
javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import
java.awt.event.ActionListener;
import java.util.ArrayList;
// Food prices
private final double[] foodPrices = {100, 80, 120, 50, 20}; // Prices for Pizza,
Burger, Pasta, Salad, Soda
public HotelManagementSystem() {
// Initialize room availability
roomAvailability = new ArrayList<>(TOTAL_ROOMS);
for (int i = 0; i < TOTAL_ROOMS; i++) {
roomAvailability.add(true); // All rooms are initially available
7|P age
}
// Frame settings
8|P age
setTitle("Hotel Management System");
setSize(400, 400);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setLayout(new BorderLayout());
add(inputPanel, BorderLayout.NORTH);
// Output area
outputArea = new JTextArea();
outputArea.setEditable(false);
add(new JScrollPane(outputArea), BorderLayout.CENTER);
9|P age
foodPanel.add(new JLabel("Select Food:"), BorderLayout.NORTH);
foodMenu.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTI
ON);
foodMenu.setVisibleRowCount(4); // Display 4 rows at a time
JScrollPane foodScrollPane = new JScrollPane(foodMenu);
foodPanel.add(foodScrollPane, BorderLayout.CENTER);
foodPanel.add(quantityPanel, BorderLayout.SOUTH);
add(foodPanel, BorderLayout.SOUTH);
}
@Override
public void actionPerformed(ActionEvent e)
{ String command =
e.getActionCommand(); if
(command.equals("Book Room")) {
String name = nameField.getText();
int roomNumber = Integer.parseInt(roomField.getText()) - 1; // Convert to
0- based index
10 | P a g e
if (roomNumber < 0 || roomNumber >= TOTAL_ROOMS) {
11 | P a g e
outputArea.append("Invalid room number. Please choose between 1 and " +
TOTAL_ROOMS + ".\n");
} else if (roomAvailability.get(roomNumber)) {
roomAvailability.set(roomNumber, false); // Mark the room as booked
outputArea.append("Room " + (roomNumber + 1) + " booked for " + name +
".\
n"); } else {
outputArea.append("Room " + (roomNumber + 1) + " is already booked.\n");
}
} else if (command.equals("Check Availability")) {
StringBuilder availableRooms = new StringBuilder("Available Rooms: ");
for (int i = 0; i < TOTAL_ROOMS; i++) {
if (roomAvailability.get(i)) {
availableRooms.append(i + 1).append(" "); // Convert to 1-based index
}
}
outputArea.append(availableRooms.toString() + "\n");
} else if (command.equals("Order Food")) {
StringBuilder orderedItems = new StringBuilder("Ordered: ");
int[] selectedIndices = foodMenu.getSelectedIndices();
String quantityText = quantityField.getText();
int quantity;
// Validate quantity
input try {
quantity = Integer.parseInt(quantityText);
if (quantity <= 0) {
JOptionPane.showMessageDialog(this, "Quantity must be a positive
number.", "Invalid Input", JOptionPane.ERROR_MESSAGE);
return;
}
} catch (NumberFormatException ex) {
JOptionPane.showMessageDialog(this, "Please enter a valid quantity.",
"Invalid Input", JOptionPane.ERROR_MESSAGE);
return;
}
12 | P a g e
double totalCost = 0.0;
if (selectedIndices.length == 0) {
outputArea.append("No food items selected.\
n"); return;
}
outputArea.append(orderedItems.toString() + ".\n");
13 | P a g e
Output
14 | P a g e
15 | P a g e
16 | P a g e
References
https://docs.oracle.com/javase/8/docs/api/javax/swing/
package- summary.html
https://docs.oracle.com/javase/tutorial/uiswing/
https://stackoverflow.com/questions/tagged/swing
https://www.youtube.com/user/caveofprogramming
17 | P a g e
Conclusion
The methodology outlined above provides a comprehensive approach to developing a
Hotel Management System in Java using Swing. By following this methodology, you
ensure that the system is well-planned, robust, and user-friendly. Starting with
thorough requirements analysis, the system is designed using the MVC pattern to
separate concerns, making it easier to manage and extend. The implementation phase
focuses on building a responsive and intuitive user interface, coupled with solid
business logic for room booking, availability checks, and food ordering.
Testing is emphasized to ensure the system functions correctly and meets user
expectations. Finally, the deployment and maintenance phases ensure that the system is
not only delivered effectively but also remains reliable and relevant over time through
updates and enhancements.
By adhering to this structured methodology, you can successfully develop a Hotel
Management System that meets the needs of its users and is adaptable for future growth.
18 | P a g e
Teacher Evaluation Sheet
Enrolment No…………………………………………..
Name of Program……………………Semester:……………………………….
…………………………………………………………………………………………………
…………………………………………………………………………………………………
…………………………………………………………………………………………………
…………
19 | P a g e
Evaluation as per suggested Rubric for Assessment of Micro-Project
Literature survey/
2
Information Collection
3 Project Proposal
Analysis of Data
5
&
Representation
Quality of
6
Prototype/Model
7 Report Preparation
8 Presentation
20 | P a g e
Micro-Project Evaluation Sheet
Note:
Every course teacher is expected to assign marks for group evolution in first 3 columns & individual
evaluation in 4th columns for each group of students as per rubrics.
……………………………………………………………………………………………………………
……………………………………………………………………………………………………………
……………………………………………………………………………………………………………
……………………………………………………………………………………………………………
……………………………………………………………………………………………………………
……………………………………………………………………………………………………………
………………
Anyother comment:
……………………………………………………………………………………………………………
……………………………………………………………………………………………………………
……………………………………………………………………………………………………………
……………………………………………………………………………………………………………
……………………………………………………………………………………………………………
……………………………………………………………………………………………………………
………………
Signature...........................
21 | P a g e