AJP Micro Project
AJP Micro Project
Besides, there are additional buttons for VAT amounts and senior citizen. This whole system is built using
Java programming language with the help of NetBeans IDE.
Design of this project is very simple so that the user won’t find any difficulties while working on it. To run
this project, you must have installed NetBeans IDE on your PC. Coffee Shop System in Java with source
code is free to download, Use for educational purposes only! For the project demo, have a look at the image
below.
1. Automation of Cafe Management: To design and develop a software system that simplifies and
automates the management of a café, including order processing, bill calculation, and receipt
generation.
2. Interactive User Interface: To implement a user-friendly graphical interface using Java Swing,
making it intuitive and accessible for both employees and customers.
3. Error-Free Billing System: To ensure accurate and efficient calculation of bills, including taxes and
discounts, with minimal errors.
5. Cost and Item Tracking: To facilitate seamless management of items, including displaying their
costs and sizes, while calculating total costs for customers.
6. Educational Value: To demonstrate the practical implementation of Java programming concepts and
tools, including Swing components and event handling.
Page | 1
7. Platform Independence: To create a lightweight application that is platform-independent and can
run on any system with a compatible Java runtime environment.
8. Scalability and Maintainability: To design the system with simplicity for easy future enhancements
or integration with other modules.
Overall, the CMS aims to improve cafe efficiency, minimize human errors, enhance the customer
experience, and provide management with the necessary tools for effective decision-making
2. Mastery of Java Swing: Gain proficiency in creating graphical user interfaces (GUI) with Java
Swing, including the use of components like JButton, JTextField, and JTextArea.
4. Error Handling and Debugging: Learn techniques to identify, debug, and resolve errors in a
Java-based project effectively.
5. Software Development Lifecycle: Understand and execute all stages of the software
development lifecycle, including planning, implementation, testing, and deployment.
6. User-Centric Design: Develop skills to create user-friendly applications that prioritize ease of use
and functionality.
7. Integration of Taxation and Billing: Acquire the ability to incorporate financial logic, such as
calculating total costs, taxes, and discounts, into a functional application.
8. Hands-On Experience with IDEs: Utilize Integrated Development Environments (IDEs) like
NetBeans to enhance productivity and streamline the development process.
10. Team Collaboration: Develop teamwork and project collaboration skills by working effectively in
a group to complete the project within a specified timeline.
Page | 2
4.0 Literature Review: -
Swing
It is a part of Java’s JFC (Java Foundation Classes) used for building graphical user interfaces
(GUIs). In your program, Swing is used to create the interface that interacts with users for various
functionalities like viewing the menu, adding menu items, and placing orders. The components and layouts
used in the program illustrate the versatility of Swing:
• JFrame: The JFrame is the top-level window that acts as the main frame of the application.
• JPanel: Panels are containers to organize components within a layout.
• JButton: Buttons like viewMenuButton, addMenuItemButton, and placeOrderButton are added to the
interface, allowing users to perform actions.
• JOptionPane: This is used for simple dialog boxes that allow users to interact with the system, such as
confirming actions or entering data.
• JComboBox: A dropdown is used for selecting menu items while placing an order.
The Swing framework allows you to build rich, interactive applications without relying on web browsers,
making it ideal for desktop systems like your restaurant management system.
JDBC
To fully implement a Cafe Management System, database integration is essential for
persisting data like menu items and orders. This is where JDBC (Java Database Connectivity) comes
in. JDBC allows Java applications to connect to and interact with a database (like MySQL,
PostgreSQL, etc.). With JDBC, you can store and retrieve information about menu items, orders, and
billing in a persistent and structured way.
Page | 3
5.0 Proposed Methodology: -
We will follow the same above steps to create the micro project.
Page | 4
7.0 Action Plan: -
Submitted by:
1) Mohammad Yusuf Siddique
Page | 5
PART B – Micro-Project Proposal
Acknowledgement
I would like to express my sincere gratitude to everyone who supported me throughout the
development of this Cafe Management System.
First and foremost, I am deeply grateful to Prof. Afzal Ahmad for their invaluable guidance,
encouragement, and insight, which provided me with the clarity and direction necessary for
completing this project.
I would also like to thank Jamia Polytechnic for providing the resources and tools essential for this
system's development. A special thanks goes to my colleagues and team members for their
collaborative efforts, constructive feedback, and constant support throughout this journey.
Finally, I am profoundly thankful to my family and friends for their unwavering support and
understanding during the entire process, which motivated me to put forth my best effort in
completing this project.
Page | 6
CONTENTS
1 Rationale ..................................................................................................... 8
Page | 7
1.0 Rational
The Cafe Management System project emerges from the pressing need for a solution that align with the
contemporary dining landscape. In a world where diners increasingly seek personalized and seamless
experiences, and where restaurant owners aim to boost their operational efficiency, technological solutions like
this system are essential. The restaurant industry is no longer limited to culinary delights alone; it is a dynamic
and competitive arena where the integration of technology is a requisite. The rationale behindthis project is
to facilitate the convergence of technology and culinary artistry, making dining out not just a source of
nourishment but a memorable experience.
The Cafe Management System contributes significantly to the growing body of knowledge on the practical
application of technology in the restaurant industry. By providing a user-friendly platform forcustomers to
explore menus, place orders with ease, and make payments, it enhances their diningexperience.
Moreover, it empowers restaurant owners and managers by simplifying menu management, order processing,
and billing. This project is a testament to the adaptability and innovation of the restaurant industry, proving
that technology can be harnessed to meet the needs of a tech-savvy clientele. Itunderscores the
industry's ability to evolve and remain competitive in a fast-paced, data-driven world,making it a
compelling case study in the modern restaurant management landscape.
Swing
It is a part of Java’s JFC (Java Foundation Classes) used for building graphical user interfaces
(GUIs). In your program, Swing is used to create the interface that interacts with users for various
functionalities like viewing the menu, adding menu items, and placing orders. The components and layoutsused
in the program illustrate the versatility of Swing:
• JFrame: The JFrame is the top-level window that acts as the main frame of the application.
• JPanel: Panels are containers to organize components within a layout.
• JButton: Buttons like viewMenuButton, addMenuItemButton, and placeOrderButton are added to the
interface, allowing users to perform actions.
• JOptionPane: This is used for simple dialog boxes that allow users to interact with the system, such as
confirming actions or entering data.
• JComboBox: A dropdown is used for selecting menu items while placing an order.
Page | 8
The Swing framework allows you to build rich, interactive applications without relying on web browsers,
making it ideal for desktop systems like your restaurant management system.
JDBC
To fully implement a Restaurant Management System, database integration is essential for
persisting data like menu items and orders. This is where JDBC (Java Database Connectivity) comesin.
JDBC allows Java applications to connect to and interact with a database (like MySQL, PostgreSQL, etc.). With
JDBC, you can store and retrieve information about menu items, orders, and billing in a persistent and
structured way.
Event Sources
A source is an object that generates an event. This occurs when the internal state of that object
changes in some way. Sources may generate more than one type of event.
A source must register listeners in order for the listeners to receive notifications about a
specific type of event. Each type of event has its own registration method. Here is the
general form:
Page | 9
public void addTypeListener(TypeListener el)
Here, Type is the name of the event, and el is a reference to the event listener. For example, the
method that registers a keyboard event listener is called addKeyListener( ). The method that
registers a mouse motion listener is called addMouseMotionListener( ). When an event occurs, all
registered listeners are notified and receive a copy of the event object. This is knownas multicasting
the event. In all cases, notifications are sent only to listeners that register to receive them.
Event Listeners
A listener is an object that is notified when an event occurs. It has two major requirements.First, it
must have been registered with one or more sources to receive notifications about
specific types of events. Second, it must implement methods to receive and process these
notifications.
The methods that receive and process events are defined in a set of interfaces found in
java.awt.event.
Page | 10
The getModifiers( ) method returns a value that indicates which modifier keys (ALT, CTRL,
META, and/or SHIFT) were pressed when the event was generated. Its form is shown here:int
getModifiers( )
The method getWhen( ) returns the time at which the event took place. This is called the
event’s timestamp. The getWhen( ) method is shown here:
long getWhen( )
JButton
The JButton class provides the functionality of a push button. You have already seen a simple
form of it in the preceding chapter. JButton allows an icon, a string, or both to beassociated
with the push button. Three of its constructors are shown here:
JButton(Icon icon)
JButton(String str)
JButton(String str, Icon icon)
Here, str and icon are the string and icon used for the button.
When the button is pressed, an ActionEvent is generated. Using the ActionEvent object
passed to the actionPerformed( ) method of the registered ActionListener, you can obtainthe
action command string associated with the button. By default, this is the string displayedinside
the button.
JTextField
JTextField is the simplest Swing text component. It is also probably its most widely used text
component. JTextField allows you to edit one line of text. It is derived from JTextComponent,
which provides the basic functionality common to Swing text components. JTextField uses the
Document interface for its model.
Three of JTextField’s constructors are shown here:
JTextField(int cols)
JTextField(String str, int cols)
JTextField(String str)
Here, str is the string to be initially presented, and cols is the number of columns in the text
Page | 11
field. If no string is specified, the text field is initially empty. If the number of columns is not
specified, the text field is sized to fit the specified string.
JTextField generates events in response to user interaction. For example, an ActionEvent
is fired when the user presses ENTER. A CaretEvent is fired each time the caret (i.e., the
cursor) changes position. (CaretEvent is packaged in javax.swing.event.) Other events are
also possible. In many cases, your program will not need to handle these events. Instead,
you will simply obtain the string currently in the text field when it is needed. To obtain the
text currently in the text field, call getText( ).
Reference:
Books: -
1. Java the Complete Reference, ninth edition by Herbert Schild, Publisher: McGraw Hills
2. Head First EJB 3.0 by Kathy Sierra, Bert Bates, Publisher: O'Reilly Media
3. Head First Servlets and JSP by Bryan Basham, Kathy Sierra & Bert Bates, Publisher: O'Reilly
Media
Website: -
1. http://www.programmingearth.com
2. http://www.geeksforgeeks.com
This methodology ensures the development of a reliable, user-friendly cafe management systemthat can
manage the core functions of a cafe effectively.
12 | P a g e
Algorithm:
1. Start
2. Initialize menuItems, orderItems, and total Bill
3. Create a GUI window with menu, order, and control button’s
4. Add action listeners to buttons for viewing the menu, adding items, and placing order.
5. In the viewMenu() method:
6. Display the menu if not empty
7. Show a message if the menu is empty
8. In the addMenuItem() method:
9. Prompt the user to enter a menu item name and price
10. Add the new item to the menuItems list
11. Show a success message7. In the placeOrder() method:
12. Allow the user to select a menu item and quantity.
13. Calculate the order total
14. Add the order to the orderItems list
15. Update the total Bill
16. Display a success message
17. Determine the MenuItem and OrderItem classes
13 | P a g e
6.0 Outputs of the Micro-Project
Coding:
package cafe.management;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.SimpleDateFormat;
import java.util.Calendar;
// Pricing Constants
private final double LATTE_PRICE = 3.50;
private final double ESPRESSO_PRICE = 4.00;
private final double CAPPUCCINO_PRICE = 3.75;
private final double TAX_RATE = 0.10;
// Constructor
public CafeManagementSystem() {
setTitle("Cafe Management System");
setSize(800, 600);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setLayout(new CardLayout());
// Initialize Components
initializeLoginPanel();
initializeMenuPanel();
initializeReceiptPanel();
showPanel("Login");
}
14 | P a g e
JLabel lblPassword = new JLabel("Password:");
txtPassword = new JPasswordField();
panelLogin.add(lblUsername);
panelLogin.add(txtUsername);
panelLogin.add(lblPassword);
panelLogin.add(txtPassword);
panelLogin.add(new JLabel());
panelLogin.add(btnLogin);
}
panelMenu.add(lblLatte);
panelMenu.add(txtLatte);
panelMenu.add(lblEspresso);
panelMenu.add(txtEspresso);
15 | P a g e
panelMenu.add(lblCappuccino);
panelMenu.add(txtCappuccino);
panelMenu.add(lblTotalDrinks);
panelMenu.add(txtTotalDrinks);
panelMenu.add(btnCalculate);
panelMenu.add(btnGenerateReceipt);
panelMenu.add(btnClear);
panelMenu.add(btnLogout);
}
txtTotalDrinks.setText(String.format("$%.2f", drinksCost));
txtTax.setText(String.format("$%.2f", tax));
txtTotal.setText(String.format("$%.2f", total));
}
16 | P a g e
Calendar cal = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
17 | P a g e
18 | P a g e
7.0 Skill Developed / learning out of this Micro-Project
Through the micro-project, the following things are learnt and skills are developed by the group
1. Developing the project in Advanced Java and utilizing the Swing framework enhances proficiency in
Java programming.
2. To know the Importance of this project.
3. The structure and requirement of Proposal and Report understood.
4. The necessity of group work is well understood.
5. What is the role of Group Leader and members? It is well understood.
19 | P a g e
8.0 Applications of this Micro-Project: -
A Restaurant Management System enhances order handling, billing, inventory, staff, reservations,
analytics, and integrates online ordering and loyalty programs.
5. Multilingual support.
6. Sustainability tracking.
7. Customizable reporting.
20 | P a g e