0% found this document useful (0 votes)
14 views14 pages

AJP Part B 1

The document outlines a micro-project titled 'Cafe Management System' undertaken by students of the Information Technology Department at Government Polytechnic Murtizapur for the Advanced Java Programming course. The project aims to automate billing and order management in cafes, enhancing operational efficiency through a user-friendly interface and accurate calculations. It includes a detailed methodology, benefits, course outcomes, and a sample code implementation of the system.

Uploaded by

Sameer Gonarkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views14 pages

AJP Part B 1

The document outlines a micro-project titled 'Cafe Management System' undertaken by students of the Information Technology Department at Government Polytechnic Murtizapur for the Advanced Java Programming course. The project aims to automate billing and order management in cafes, enhancing operational efficiency through a user-friendly interface and accurate calculations. It includes a detailed methodology, benefits, course outcomes, and a sample code implementation of the system.

Uploaded by

Sameer Gonarkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Maharashtra State Board of Technical Education

Government Polytechnic Murtizapur


Information Technology Department
2024-2025

Subject
Advanced Java Programming (22517)
Guided By :-
Mr.G.J.Solanke

Micro-Project Topic

Cafe Management System

Submitted By
Sr.no Roll.no Enrollment No. Name
1 22 2212410230 Gonarkar Sarvar A.

2 41 2212410260 Raipure Mayuri V.

3 58 23410260399 Jadhao Roshan U.

1
MAHARASHTRA STATE
BOARD OF TECHNICAL EDUCATION
Certificate
This is to Verify That
Mr./Ms……………………………………………................Roll No…….…..…of
Fifth Semester of Diploma in …………...Information Technology……………of
Institute……………Government Polytechnic Murtizapur…..………………..

(Code........1241............) Has completed the Micro-Project Satisfactory in course


Advanced Java Programming (22517) for the academic year 2024-2025 as prescribed
in the curriculum.

Place…………………. Enrollment no…………………...


Date………………….. Exam Seat No.…………………..

Course Teacher Head of the Department Principal


2
Annexure – II
Part – B Micro-Project Report
(Outcomes after Execution)
Format for Micro-Project Report (Minimum 3 pages)

Title of Microproject

Cafe Management System

1.0 Rationale

The Cafe Management System simplifies billing and order management in cafes, ensuring
accuracy and efficiency. By automating calculations, incorporating VAT, and offering a user-
friendly interface, it reduces manual workload and enhances the overall customer experience.
This project highlights the importance of technology in streamlining business operations.
2.0 Aims/Benefits of the Micro-Project

To design and implement a secure and user-friendly Cafe Management System that automates billing,
enhances operational efficiency, and provides a seamless experience for users.

Benefits

 Automates Billing: Simplifies the process of calculating total bills, taxes, and discounts.
 User-Friendly Interface: Ensures ease of use through an intuitive GUI built with Java Swing.
 Time-Saving: Reduces manual calculations, allowing faster service for customers.
 Cost-Effective: Minimizes errors and operational inefficiencies.
 Customizable: Allows easy adaptation for specific business needs.
 Educational Value: Enhances understanding of Java programming, GUI design, and backend
integration.

3.0 Course Outcomes Addressed (Add to the earlier list if more COs are addressed)

CO1: Develop programs using GUI Framework (AWT and Swing).


CO2: Handle events of AWT and Swings components.
CO3: Develop programs to handle events in Java Programming.

4.0 Literature Review

Research into management systems for small businesses, such as cafes, highlights the importance of
automation in streamlining daily operations. Key findings from previous studies and similar projects
include:

3
 Efficiency in Operations: Automated billing systems eliminate manual errors and reduce the time
required for calculations.
 Role of GUI Frameworks: Java Swing is widely used for developing user-friendly, platform-
independent graphical interfaces, making it suitable for small-scale business applications.
 Cost Accuracy: Systems that incorporate tax calculations and discount options enhance
transparency and trust between businesses and customers.
 Usability Challenges: Successful systems prioritize simplicity in design, ensuring even non-
technical users can operate them effectively.

5.0 Actual Methodology Followed

The Cafe Management System project was developed in a systematic and collaborative manner. The
steps followed are detailed below:

 Selection of Project Topic


o Task: Deciding the project topic and objectives.
o Responsible Members: All team members (Mayuri Raipure, Sarvar Gonarkar, Roshan
Jadhao) discussed and finalized the topic with guidance from Mr. Solanke Sir.
 Research and Data Collection
o Task: Researching similar systems, understanding requirements, and gathering relevant
theoretical concepts.
o Responsible Members: Sarvar and Mayuri reviewed online resources and books to outline
the system's features and requirements.
 Design of System Architecture
o Task: Designing the user interface layout and backend logic for the project.
o Responsible Members: Roshan focused on designing GUI elements (login, menu, receipt
generation), while Sarvar worked on mapping backend functionality like tax calculations
and data flow.
 Code Implementation
o Task: Writing Java code for different modules of the system, including the login page,
menu selection, and billing logic.
o Responsible Members:
 Mayuri: Implemented GUI components using Java Swing.
 Roshan: Wrote backend logic for item selection, quantity management, and cost
calculation.
 Sarvar: Handled tax calculations, receipt generation, and integrating all modules.
 Testing and Debugging
o Task: Testing the system for functionality, identifying errors, and resolving bugs.
o Responsible Members: All team members collaborated to test different modules, while
Roshan focused on fixing GUI-related issues and Sarvar resolved backend errors.
 Documentation
o Task: Writing and formatting the project report, including adding code snippets and system
outputs.
o Responsible Members: Mayuri compiled and documented the final report with assistance
from Sarvar for formatting.

4
 Code Implementation

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class CafeManagementSystem extends JFrame {

CardLayout cardLayout = new CardLayout();


JPanel mainPanel;

JTextField usernameField;
JPasswordField passwordField;

JTextField latteField, espressoField, cappuccinoField, teaField, coffeeField,


hotChocolateField, muffinField, croissantField, sandwichField,
pastryField, juiceField, tableField;

JTextArea receiptArea;
JTextArea totalSalesArea;

final double LATTE_PRICE = 40.0;


final double ESPRESSO_PRICE = 50.0;
final double CAPPUCCINO_PRICE = 60.0;
final double TEA_PRICE = 20.0;
final double COFFEE_PRICE = 35.0;
final double HOT_CHOCOLATE_PRICE = 70.0;
final double MUFFIN_PRICE = 25.0;
final double CROISSANT_PRICE = 45.0;
final double SANDWICH_PRICE = 55.0;
final double PASTRY_PRICE = 30.0;
final double JUICE_PRICE = 40.0;
final double TAX_RATE = 0.1;

double totalSales = 0.0;

public CafeManagementSystem() {
setTitle("Cafe Management System");
setSize(700, 600);
setDefaultCloseOperation(EXIT_ON_CLOSE);

mainPanel = new JPanel(cardLayout);

mainPanel.add(createLoginPanel(), "Login");

5
mainPanel.add(createMenuPanel(), "Menu");
mainPanel.add(createReceiptPanel(), "Receipt");
mainPanel.add(createTotalSalesPanel(), "TotalSales");

add(mainPanel);
}

private JPanel createLoginPanel() {


JPanel panel = new JPanel(new GridBagLayout());

JLabel userLabel = new JLabel("Username:");


usernameField = new JTextField(15);

JLabel passLabel = new JLabel("Password:");


passwordField = new JPasswordField(15);

JButton loginButton = new JButton("Login");


loginButton.addActionListener(e -> validateLogin());

GridBagConstraints gbc = new GridBagConstraints();


gbc.insets = new Insets(10, 10, 10, 10);
gbc.gridx = 0; gbc.gridy = 0;
panel.add(userLabel, gbc);
gbc.gridx = 1;
panel.add(usernameField, gbc);

gbc.gridx = 0; gbc.gridy = 1;
panel.add(passLabel, gbc);
gbc.gridx = 1;
panel.add(passwordField, gbc);

gbc.gridx = 0; gbc.gridy = 2; gbc.gridwidth = 2;


panel.add(loginButton, gbc);

return panel;
}

private JPanel createMenuPanel() {


JPanel panel = new JPanel(new GridLayout(14, 2, 10, 10));

JLabel tableLabel = new JLabel("Table Number:");


tableField = new JTextField();

JLabel latteLabel = new JLabel("Latte (₹40):");


latteField = new JTextField("0");

6
JLabel espressoLabel = new JLabel("Espresso (₹50):");
espressoField = new JTextField("0");

JLabel cappuccinoLabel = new JLabel("Cappuccino (₹60):");


cappuccinoField = new JTextField("0");

JLabel teaLabel = new JLabel("Tea (₹20):");


teaField = new JTextField("0");

JLabel coffeeLabel = new JLabel("Coffee (₹35):");


coffeeField = new JTextField("0");

JLabel hotChocolateLabel = new JLabel("Hot Chocolate (₹70):");


hotChocolateField = new JTextField("0");

JLabel muffinLabel = new JLabel("Muffin (₹25):");


muffinField = new JTextField("0");

JLabel croissantLabel = new JLabel("Croissant (₹45):");


croissantField = new JTextField("0");

JLabel sandwichLabel = new JLabel("Sandwich (₹55):");


sandwichField = new JTextField("0");

JLabel pastryLabel = new JLabel("Pastry (₹30):");


pastryField = new JTextField("0");

JLabel juiceLabel = new JLabel("Juice (₹40):");


juiceField = new JTextField("0");

JButton nextButton = new JButton("Generate Receipt");


nextButton.addActionListener(e -> showReceipt());

JButton totalSalesButton = new JButton("View Total Sales");


totalSalesButton.addActionListener(e -> showTotalSales());

panel.add(tableLabel);
panel.add(tableField);
panel.add(latteLabel);
panel.add(latteField);
panel.add(espressoLabel);
panel.add(espressoField);
panel.add(cappuccinoLabel);
panel.add(cappuccinoField);
panel.add(teaLabel);
panel.add(teaField);

7
panel.add(coffeeLabel);
panel.add(coffeeField);
panel.add(hotChocolateLabel);
panel.add(hotChocolateField);
panel.add(muffinLabel);
panel.add(muffinField);
panel.add(croissantLabel);
panel.add(croissantField);
panel.add(sandwichLabel);
panel.add(sandwichField);
panel.add(pastryLabel);
panel.add(pastryField);
panel.add(juiceLabel);
panel.add(juiceField);
panel.add(totalSalesButton);
panel.add(nextButton);

return panel;
}

private JPanel createReceiptPanel() {


JPanel panel = new JPanel(new BorderLayout(10, 10));

receiptArea = new JTextArea();


receiptArea.setEditable(false);
receiptArea.setFont(new Font("Monospaced", Font.PLAIN, 14));
JScrollPane scrollPane = new JScrollPane(receiptArea);

JButton backButton = new JButton("Back to Menu");


backButton.addActionListener(e -> cardLayout.show(mainPanel, "Menu"));

JPanel buttonPanel = new JPanel();


buttonPanel.add(backButton);

panel.add(scrollPane, BorderLayout.CENTER);
panel.add(buttonPanel, BorderLayout.SOUTH);

return panel;
}

private JPanel createTotalSalesPanel() {


JPanel panel = new JPanel(new BorderLayout(10, 10));

totalSalesArea = new JTextArea();


totalSalesArea.setEditable(false);
totalSalesArea.setFont(new Font("Monospaced", Font.PLAIN, 14));

8
JButton backButton = new JButton("Back to Menu");
backButton.addActionListener(e -> cardLayout.show(mainPanel, "Menu"));

JPanel buttonPanel = new JPanel();


buttonPanel.add(backButton);

panel.add(new JScrollPane(totalSalesArea), BorderLayout.CENTER);


panel.add(buttonPanel, BorderLayout.SOUTH);

return panel;
}

private void validateLogin() {


String username = usernameField.getText();
String password = new String(passwordField.getPassword());

if (username.equals("admin") && password.equals("password")) {


cardLayout.show(mainPanel, "Menu");
} else {
JOptionPane.showMessageDialog(this, "Invalid Credentials!", "Error",
JOptionPane.ERROR_MESSAGE);
}
}

private void showReceipt() {


try {
int tableNumber = Integer.parseInt(tableField.getText());
int latteQty = Integer.parseInt(latteField.getText());
int espressoQty = Integer.parseInt(espressoField.getText());
int cappuccinoQty = Integer.parseInt(cappuccinoField.getText());
int teaQty = Integer.parseInt(teaField.getText());
int coffeeQty = Integer.parseInt(coffeeField.getText());
int hotChocolateQty = Integer.parseInt(hotChocolateField.getText());
int muffinQty = Integer.parseInt(muffinField.getText());
int croissantQty = Integer.parseInt(croissantField.getText());
int sandwichQty = Integer.parseInt(sandwichField.getText());
int pastryQty = Integer.parseInt(pastryField.getText());
int juiceQty = Integer.parseInt(juiceField.getText());

double subtotal = (latteQty * LATTE_PRICE) + (espressoQty * ESPRESSO_PRICE) +


(cappuccinoQty * CAPPUCCINO_PRICE) + (teaQty * TEA_PRICE) +
(coffeeQty * COFFEE_PRICE) + (hotChocolateQty * HOT_CHOCOLATE_PRICE) +
(muffinQty * MUFFIN_PRICE) + (croissantQty * CROISSANT_PRICE) +
(sandwichQty * SANDWICH_PRICE) + (pastryQty * PASTRY_PRICE) +
(juiceQty * JUICE_PRICE);

9
double tax = subtotal * TAX_RATE;
double total = subtotal + tax;

totalSales += total;

receiptArea.setText(
"Table Number: " + tableNumber + "\n" +
"=============================\n" +
"Latte: " + latteQty + " x ₹" + LATTE_PRICE + " = ₹" + (latteQty * LATTE_PRICE) +
"\n" +
"Espresso: " + espressoQty + " x ₹" + ESPRESSO_PRICE + " = ₹" + (espressoQty *
ESPRESSO_PRICE) + "\n" +
"Cappuccino: " + cappuccinoQty + " x ₹" + CAPPUCCINO_PRICE + " = ₹" +
(cappuccinoQty * CAPPUCCINO_PRICE) + "\n" +
"Tea: " + teaQty + " x ₹" + TEA_PRICE + " = ₹" + (teaQty * TEA_PRICE) + "\n" +
"Coffee: " + coffeeQty + " x ₹" + COFFEE_PRICE + " = ₹" + (coffeeQty *
COFFEE_PRICE) + "\n" +
"Hot Chocolate: " + hotChocolateQty + " x ₹" + HOT_CHOCOLATE_PRICE + " = ₹" +
(hotChocolateQty * HOT_CHOCOLATE_PRICE) + "\n" +
"Muffin: " + muffinQty + " x ₹" + MUFFIN_PRICE + " = ₹" + (muffinQty *
MUFFIN_PRICE) + "\n" +
"Croissant: " + croissantQty + " x ₹" + CROISSANT_PRICE + " = ₹" + (croissantQty *
CROISSANT_PRICE) + "\n" +
"Sandwich: " + sandwichQty + " x ₹" + SANDWICH_PRICE + " = ₹" + (sandwichQty *
SANDWICH_PRICE) + "\n" +
"Pastry: " + pastryQty + " x ₹" + PASTRY_PRICE + " = ₹" + (pastryQty *
PASTRY_PRICE) + "\n" +
"Juice: " + juiceQty + " x ₹" + JUICE_PRICE + " = ₹" + (juiceQty * JUICE_PRICE) + "\n"
+
"=============================\n" +
"Subtotal: ₹" + String.format("%.2f", subtotal) + "\n" +
"Tax: ₹" + String.format("%.2f", tax) + "\n" +
"Total: ₹" + String.format("%.2f", total) + "\n"
);

cardLayout.show(mainPanel, "Receipt");
} catch (NumberFormatException e) {
JOptionPane.showMessageDialog(this, "Invalid input. Please enter valid quantities and table
number.", "Error", JOptionPane.ERROR_MESSAGE);
}
}

private void showTotalSales() {


totalSalesArea.setText("Total Sales: ₹" + String.format("%.2f", totalSales));
cardLayout.show(mainPanel, "TotalSales");

10
}

public static void main(String[] args) {


SwingUtilities.invokeLater(() -> new CafeManagementSystem().setVisible(true));
}
}
6.0 Actual Resources Used

Sr. Name of Resource/ Specification Quantity Remark


No Material

1 Books Effective Java Author: Joshua Bloch 1 -

Required for
2 Software Java jdk 1.8.0 1 Java
runtime

5 Operating System Windows 11 1 -

6 Code Editor Notepad++ 1 For editing


text files

7 Documentation Tool Microsoft Word 1 -

7.0 Outputs of the Micro-Projects

Login Page
11
Home Page

Receipt Page

12
Total Selling Page

13
8.0 Skill Developed / Learning outcome of this Micro-Project

Developing an Online Examination System using Java Swing builds these key skills:
1. Java Programming: Core Java, OOP, GUI design, event handling.
2. UI/UX Design: User-friendly interface creation.
3. Problem-Solving: Logic building for navigation, scoring, and error handling.
4. Debugging: Identifying and fixing bugs.
5. Project Management: Task breakdown, deadlines, and collaboration (if in a team).
6. Testing: Ensuring functionality and reliability.
7. Communication: Explaining, documenting, and presenting the project.

9.0 Applications of this Micro-Project

The Cafe Management System has diverse applications across different domains:

1. Cafes and Restaurants:


o Simplifies billing processes, ensuring accuracy in calculations.
o Speeds up service by automating item selection and receipt generation.
2. Training Institutes:
o Provides hands-on experience in developing Java-based GUI applications.
o Useful as a teaching tool for introducing Java Swing and backend integration.
3. Small Businesses:
o Offers a cost-effective solution for managing orders and tracking expenses.
4. Educational Projects:
o Serves as an example for implementing end-to-end solutions in Java.
5. Customization for Specific Needs:
o Can be adapted for other retail businesses such as bakeries or small retail shops.
6. Personal Use:
o Useful for students and hobbyists to practice software development concepts.

14

You might also like