Java - Programming - Microproject. Final PDF
Java - Programming - Microproject. Final PDF
SYIF
SEMESTER 4 (2023-2024)
SUBJECT: JAVA PROGRAMMING
(22412)
GROUP- 07
41.Manas Singh
47.Yash Tanpure
49.Rishabh Pal
53.Aryan Tiwari
Place: Mumbai
Date:
Subject Teacher Head of Department Principle
Ms. Suvarn Thakre Ms. SuvarnThakre Dr.S.M. Ganechari
ACKNOWLEDGEMENT
THANK YOU!
INDEX
Micro-Project can also help students to develop skills specific to collaborative efforts,
allowing students to tackle more complex problems then they could do on their own.
Collect relevant information about hotel reservation from different sources.
Identify what kind of function, class too use.
Analyze the collected data and generate useful information from it.
1. Manas Singh
2. Yash Tanpure
3. Rishabh Pal
4. Aryan Tiwari
1.0. Rationale:
Creating a hotel reservation program in Java serves to streamline hotel operations by
automating booking processes, reducing errors, and optimizing room allocation. It enhances
the guest experience through convenient booking, real-time updates, and secure online
payments, while providing valuable data for decision-making and reporting. The program's
scalability, customization, and multi-platform compatibility make it adaptable for hotels of
all sizes and enable seamless integration with other management systems, contributing to
the efficient and secure operation of the hotel business.
The Java hotel reservation programs underscores the pivotal role of such systems in the
hospitality industry. These systems automate booking processes, manage room inventory,
and elevate guest experiences. Researchers emphasize the importance of user-friendly
interfaces, real-time updates, and robust security measures in these systems. Case studies
demonstrate tangible benefits, including increased bookings and operational efficiency.
While Java is chosen for its performance and flexibility, it also poses challenges related to
memory management and platform compatibility. The literature also explores emerging
trends, such as AI integration and compliance with data protection regulations, to meet
evolving industry demands and guest expectations. Future research may focus on AI-driven
personalization and the analysis of guest reviews for system enhancements.
// The Processor class extends Thread and provides a utility method for pausing
// the execution
// of the current thread for a specified duration.
public class Processor extends Thread {
// Pauses the execution of the current thread for the specified number of
// milliseconds.
// This method is designed to facilitate timed delays in the program.
public static void sleep(int milliseconds) {
try {
Thread.sleep(milliseconds);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
// The Server class handles user input through a Scanner object and provides
// methods
// for room-related functionalities such as finding room numbers and
// initializing the database.
public class Server {
// Scanner object for reading user input from the console.
public static Scanner sc = new Scanner(System.in);
// The Database class serves as a container for storing and managing various
// data related to the hotel reservation system.
public class Database {
// Vectors to store room-related information: room number, type, availability
// status, price,Date,Time of Booking and status.
public static Vector<Integer> RoomNo = new Vector<>();
public static Vector<String> RoomType = new Vector<>();
public static Vector<Boolean> RoomAvailability = new Vector<>();
public static Vector<Double> RoomPrice = new Vector<>();
public static Vector<String> RoomStatus = new Vector<>();
/*
* The FrontEnd class manages the user interface and interaction in the Hotel
* Reservation System. It includes methods for displaying the main menu,
* capturing user details through a form, and validating user inputs for name,
* email, phone, age, gender, and Addhar card. The class also provides methods
* for displaying overviews of user information and menus for room type and
* availability selection during the booking process.
*/
class FrontEnd {
// Handles the user form, checking if the user is already logged in.
public static void UserForm() {
if (Database.Login) {
System.out.println(" : You have already filled the required form : ");
System.out.println("If you want to fill it again, enter 1; otherwise, enter
0");
int Select = Server.sc.nextInt();
switch (Select) {
case 1 -> Formfill(); // If the user chooses to fill the form again,
invoke the method for form
// filling.
default -> MainMenu(); // If the user chooses not to fill the form again,
go back to the main menu.
}
} else {
Formfill(); // If the user is not logged in, proceed to fill the form.
}
}
}
}
}
}
} else {
System.out.println("Please enter a numeric value for Age.");
FrontEnd.UserAge(); // Recursively call the method to prompt the
user again
}
}
}
// Break the loop if the Addhar card number contains only numeric
characters.
if (FrontEnd.containsOnlyNumeric(Database.Addhar) == true) {
break AddharResolver;
}
}
} else {
// Check if the Addhar card number has a valid length of at least 12 digits.
if (!(Database.Addhar.length() >= 12)) {
System.out.println("Please enter a valid Addhar Card Number of at
least 12 digits with no spaces");
UserAddhar(); // Prompt user to enter a valid Addhar card number.
}
}
}
System.out.println("====================================");
System.out.println("====================================");
System.out.println("====================================");
System.out.println("====================================");
System.out.println("===========Encryption===============");
System.out.println(" :-Name--------: " + (Database.Name));
System.out.println(" :-Email-------: " + (Database.Email));
System.out.println(" :-Phone-------: " + (Database.Phone));
System.out.println(" :-Age---------: " + (Database.Age));
System.out.println(" :-Gender------: " + (Database.Gender));
System.out.println(" :-Addhar------: " + (Database.Addhar));
System.out.println("====================================");
System.out.println("====================================");
System.out.println("====================================");
System.out.println("====================================");
} else {
// Display decrypted user information.
System.out.println("====================================");
System.out.println("====================================");
System.out.println("====================================");
System.out.println("====================================");
System.out.println("===========Decryption===============");
System.out.println(" :-Name--------: " + (Database.Name));
System.out.println(" :-Email-------: " + (Database.Email));
System.out.println(" :-Phone-------: " + (Database.Phone));
System.out.println(" :-Age---------: " + (Database.Age));
System.out.println(" :-Gender------: " + (Database.Gender));
System.out.println(" :-Addhar------: " + (Database.Addhar));
System.out.println("====================================");
System.out.println("====================================");
System.out.println("====================================");
System.out.println("====================================");
}
}
}
// The BackEnd class contains methods related to the backend logic and
// processing of the Hotel Reservation System.
// It handles operations such as traversing through rooms, booking rooms,
// canceling bookings, and uninstalling the application.
// The methods in this class interact with the Database and other components to
// ensure the smooth functioning of the reservation system.
class BackEnd {
// This method, Traverse, displays information about available rooms,
including
// room numbers, types, prices, and statuses.
// It provides a visual overview for users to make informed choices when
booking
// or exploring available rooms.
"=========================================================
====================================");
System.out.println(
"=========================================================
====================================");
"=========================================================
====================================");
System.out.println(
"=========================================================
====================================");
static {
// Initialize encryption and decryption maps
initializeMaps();
}
// The encrypt method takes an email and substitutes each character using
the
// encryption map.
// It returns the encrypted email as a string.
public static String encrypt(String email) {
StringBuilder encryptedEmail = new StringBuilder();
return encryptedEmail.toString();
}
return decryptedEmail.toString();
}
// The Security.Seal class serves as a handler for sealing and unsealing data.
// It provides a layer of security by controlling the encryption and decryption
// processes.
// The Handler method is responsible for sealing and unsealing data based on
the
// Seal.Packed status.
// When Seal.Packed is true, it indicates that data should be encrypted, and the
// Handler method
// performs encryption using the Security.Secure.encrypt method.
// When Seal.Packed is false, it indicates that data should be decrypted, and
// the Handler method
// performs decryption using the Security.Secure.decrypt method.
// Initially, Packed is set to false, and Unpacked is set to true, assuming the
// data is initially decrypted.
// The Data class manages encryption and decryption of sensitive data using
// substitution cipher.
// It provides methods to pack (encrypt) and unpack (decrypt) data,
particularly
// for email addresses.
class Data {
}
}
}
// The App class serves as the entry point for the Hotel Reservation System
// application.
// It contains methods for installation, uninstallation, and handling user
// interactions.
// The main method initializes the system and starts the user interface.
class App {
// The static block ensures that the Install method is called when the class is
// loaded.
static {
Install();
}
// The Install method serves as the entry point for initializing the system.
// It sequentially calls methods for preloading data, setting up packages, and
// executing procedures.
public static void Install() {
Preload();
Packages();
Procedure();
}
// The Uninstall method simulates the uninstallation process by displaying
// messages and animations.
public static void Uninstall() {
try {
System.out.println("Uninstalling packages...");
Animation();
System.out.println("Synchronizing Server...");
Animation();
System.out.println("Uninstalling Textures...");
Animation();
System.out.println("Uninstalling Resources, Models...");
Animation();
System.out.println("Uninstalling Fonts...");
Animation();
System.out.println("Uninstalling Images...");
Animation();
System.out.println("Uninstalling UI Elements...");
Animation();
System.out.println("Freeing Resources and Memory...");
Animation();
System.out.println("Closing...");
Animation();
System.exit(0);
} catch (Exception e) {
System.out.println(" : Error : " + e);
}
}
// The Preload method initializes the server by calling the Initialize method
// from the Server class.
public static void Preload() {
Server.Initialize();
}
// The Procedure method starts the main menu by calling the MainMenu
method from
// the FrontEnd class.
public static void Procedure() {
FrontEnd.MainMenu();
}
// The Packages method simulates the loading of packages by displaying
messages
// and animations.
public static void Packages() {
try {
System.out.println("Loading packages...");
Animation();
System.out.println("Synchronizing Server...");
Animation();
System.out.println("Loading Textures...");
Animation();
System.out.println("Loading Resources, Models...");
Animation();
System.out.println("Loading Fonts...");
Animation();
System.out.println("Loading Images...");
Animation();
System.out.println("Loading UI Elements...");
Animation();
} catch (Exception e) {
System.out.println(" : Error : " + e);
}
}
}
}
class Instance {
// Create an instance of the Framework class.
FrameWork Main = new FrameWork();
/*
* Hotel Reservation System
* class : Server , Database , Frontend , BackEnd , App
* User-data : email,phone,age,name,gender,addhar
* Hotel Room : Variables : room number,type,availability,price
* Options : Book And Cancel Room ,able to Traverse Rooms
* additional variables : Decider,converter
*/
/*
* CODE DOCUMENTATION
* The Hotel Reservation System is a comprehensive Java program designed to
* manage hotel room bookings. The code consists of several classes, each
* serving a distinct purpose in the overall functionality of the system.
*
* The Instance class is the entry point of the application, creating
* instances of various classes to initialize the system. These include the
* FrameWork class, responsible for coordinating the different components,
* such as the backend, frontend, security, and app modules.
*
* The Security class encompasses encryption and decryption functionalities,
* ensuring the confidentiality of user data. The Secure inner class provides
* methods for encrypting and decrypting sensitive information, such as user
* names, emails, phone numbers, and more. This is achieved through the use of
* encryption maps, providing a layer of security to protect user data.
*
* The Seal class, another inner class of Security, manages the packing and
* unpacking of data. The Data inner class is responsible for packing and
* unpacking user information, providing an additional layer of data protection
* through its encryption and decryption processes.
*
* The Processor class extends the Thread class and includes a method for
* introducing delays in the system, contributing to the animation and timing
* aspects of the application.
*
* The Database class serves as a data storage container, using vectors to
* store information about room numbers, types, availability, prices, and user
* details. It also includes variables for user information such as name, email,
* gender, Addhar card number, phone number, room number, and login status.
*
* The Server class provides methods for finding available rooms based on user
* input, initializing the system with default room details, and handling room
* availability and status.
*
* The FrontEnd class handles user interfaces and forms, presenting options
* for user interactions, including booking, cancellation, and exploration of
* available rooms. It includes methods for collecting user details, displaying
* overviews, and navigating through the main menu.
*
* The BackEnd class manages the backend logic, including room booking and
* cancellation processes. It communicates with the Database class to update
* room availability and status based on user actions.
*
* The App class controls the installation and uninstallation procedures,
* handling package loading, synchronization, and resource freeing. The
* Uninstall method provides an animated sequence for uninstalling the
* application gracefully.
*
* Overall, the Hotel Reservation System code is well-structured, employing a
* modular approach to facilitate code maintenance and readability. It
* encompasses features for user interaction, data security, and system
* functionality, creating a robust and user-friendly hotel reservation
* experience.
*/
Conclusion:
In conclusion, the literature review on Java hotel reservation programs highlights their
significant role in the hospitality sector. These systems are essential for optimizing booking
procedures, room management, and guest satisfaction. While the choice of Java as a
programming language offers flexibility and performance advantages, it also poses certain
challenges, particularly related to memory management and platform compatibility. Best
practices in system design encompass user-friendly interfaces, real-time updates, and robust
security measures to safeguard guest data. Additionally, case studies showcase tangible
benefits, such as increased bookings and operational efficiency, while emerging trends like
AI integration and regulatory compliance underscore the ever-evolving nature of this field.
Future research in this area may explore AI-driven personalization and leverage guest
feedback analysis for continual system improvement. Ultimately, Java hotel reservation
programs serve as crucial tools in modern hospitality management, enhancing both guest
experiences and operational efficiency.