You are on page 1of 14

1|Page

COFFEE SHOP

PBL Project

Submitted in partial fulfilment for the award of the degree of

BACHLEORS OF COMPUTER AND APPLICATION

by
Aman Tomar (BCAN1CA22097)
Sanaya Sharma (BCAN1CA22110)
Harsh Sharma (BCAN1CA22140)

Under the guidance of


Ayushi Gupta
Assistant Proffesor

Department of Computer Science Engineering

School of Engineering and Technology

ITM UNIVERSITY, GWALIOR - 474026 MP, INDIA

(November 2023)
2|Page
3|Page

Contents

Abstract… ................................................................................................................................... 1

List of Tables… .......................................................................................................................... 2

Introduction… ............................................................................................................................ 3

1.1 Project background

1.2 Problem Statement

Benefits of Project… ................................................................................................................... 4

Future scope…............................................................................................................................ 5

Conclusion… .............................................................................................................................. 6

Future Scope… ........................................................................................................................... 7

Source code………………………………………………………………………………….....8

References… ............................................................................................................................... 9
4|Page

INTRODUCTION
1.1 Project Background:-

"Café BDU Billing System" is the system for manage the cafe
business. The main point of developing this system is to help
cafe administrator to manage the cafe business and help
customer for online ordering and billing system.

The project is in developing stage because many cafes have a


lot of difficulties to manage the business such as customer
ordering and billing system. By using manual customer
ordering, it is difficult for the staff to keep the correct customer
order information and face hassle while managing the billing.

So, Café BDU Billing System will develop to help the cafe
administrator to manage cafe management and for customer to
make their online ordering and billing. Other than that, this
project is to upgrade the manual system and make the business
easily to access and systematic.
5|Page

1.2 Problem Statement:-

Nowadays, many cafes & restaurants manage their business by


manual especially taking customer orders. Today, cafe staff takes
the customer ordering by manual system with using paper. This is
the problem for a café staff where there is a probability to lose
and duplicates customers' information's. Additionally, it would
affect to reputation of café in operating management of ordering.

Besides, the café staff information is also kept manually in paper,


and this is difficult for the administrator to find staff information.
There remains a probability of missing the paper and difficult to
arrange the schedule. Sometimes, staff information and customer
information are important to café administrator for reference in
the future.

Furthermore, cafe side needs management in the section menu.


This is important to café staff to manage the menu. Besides, this
section is for the customer to view the menu that the café has

prepared and then they make their ordering.

As a result, the current (manual) system is not applicable and


appropriate anymore.
6|Page

Benefits of this Project

The Coffee Shop GUI, with its modular structure and planned
enhancements, offers businesses a cost-effective solution for
digitalizing their ordering process. This can lead to increased
operational efficiency, improved customer satisfaction, and
potentially expanded revenue streams through better service and
customization options.

Future Scope:-
1. User Authentication: Enhance security by implementing user authentication mechanisms for staff or
personalized user accounts.
2. Order Customization: Allow users to customize their orders, such as choosing size, toppings, or
special instructions.
3. Payment Processing: Integrate a payment system for a complete ordering and transaction experience.
4. Database Integration: Implement a database to store order history, enabling features like order
tracking and customer preferences.
5. Improved UI Design: Enhance the visual appeal and user experience through better design practices.
6. Error Handling Refinement: Further refine error handling and input validation to ensure a robust and
user-friendly application.
7|Page

Conclusion:_

The provided Java code creates a basic Coffee Shop


GUI application using Swing. It features a menu
table, quantity input, order button, and a receipt
table dynamically updated with order details and
total cost. The application demonstrates event
handling and UI components effectively for a
simple ordering system.
8|Page

Source code:-

import javax.swing;
import javax.swing.table.DefaultTableModel;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.DecimalFormat;

public class CoffeeShopGUI extends JFrame {

private static final DecimalFormat df = new


DecimalFormat("#.##");
private double totalCost = 0.0;

public CoffeeShopGUI() {
setTitle("Coffee Shop");
setSize(600, 400);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLocationRelativeTo(null);

JPanel panel = new JPanel();


getContentPane().add(panel);
placeComponents(panel);

setVisible(true);
}

private void placeComponents(JPanel panel) {


panel.setLayout(null);

JLabel titleLabel = new JLabel("Coffee Shop");


titleLabel.setBounds(250, 10, 100, 25);
panel.add(titleLabel);
9|Page

// Menu Table
String[] menu Columns = {"Item", "Cost (₹)"};
Object[][] menu Data = {
{"Espresso", 120.0},
{"Latte", 150.0},
{"Cappuccino", 170.0},
{"Americano", 100.0},
{"Mocha", 200.0},
{"Macchiato", 180.0}
// Add more dishes as needed
};
Default Table Model menu Model = new
DefaultTableModel(menu Data, menu Columns);
JTable menuTable = new JTable(menu Model);
menuTable.setBounds(50, 40, 250, 150);
JScrollPane menuScrollPane = new
JScrollPane(menuTable);
menuScrollPane.setBounds(50, 40, 250, 150);
panel.add(menuScrollPane);

JLabel quantityLabel = new JLabel("Quantity:");


quantityLabel.setBounds(320, 40, 100, 25);
panel.add(quantityLabel);

JTextField quantityField = new JTextField(10);


quantityField.setBounds(420, 40, 50, 25);
panel.add(quantityField);

JButton orderButton = new JButton("Place Order");


orderButton.setBounds(490, 40, 100, 25);
panel.add(orderButton);

JLabel receiptLabel = new JLabel("Receipt:");


receiptLabel.setBounds(50, 200, 100, 25);
10 | P a g e

panel.add(receiptLabel);

// Receipt Table
String[] receiptColumns = {"Item", "Quantity", "Total Cost
(₹)"};
DefaultTableModel receiptModel = new
DefaultTableModel(null, receiptColumns);
JTable receiptTable = new JTable(receiptModel);
JScrollPane receiptScrollPane = new
JScrollPane(receiptTable);
receiptScrollPane.setBounds(50, 230, 500, 100);
panel.add(receiptScrollPane);

orderButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
int selectedRow = menuTable.getSelectedRow();
if (selectedRow == -1) {
JOptionPane.showMessageDialog(null, "Please
select an item from the menu.", "Error",
JOptionPane.ERROR_MESSAGE);
return;
}

String selectedItem = (String)


menuTable.getValueAt(selectedRow, 0);
int quantity;
try {
quantity = Integer.parseInt(quantityField.getText());
} catch (NumberFormatException ex) {
JOptionPane.showMessageDialog(null, "Please enter
a valid quantity.", "Error", JOptionPane.ERROR_MESSAGE);
return;
}
11 | P a g e

double cost = (double)


menuTable.getValueAt(selectedRow, 1);
double orderTotal = cost * quantity;

totalCost += orderTotal;

// Add the order details to the receipt table


receiptModel.addRow(new Object[]{selectedItem,
quantity, df.format(orderTotal)});

// Update the total cost


receiptLabel.setText("Total: ₹" + df.format(totalCost));
}
});
}

public static void main(String[] args) {


SwingUtilities.invokeLater(() -> new CoffeeShopGUI());
}
}
12 | P a g e

Project result :-
13 | P a g e

References(IEEE Format)- (Sample)

Youtube:- https://youtu.be/p3SQXnxRVm8?si=Loa7NHtN5BcR0i0D

Google :- https://www.google.com

Chatgpt :- https://chat.openai.com

Google :- https://www.geeksforgeeks.org/java/l Device Forensics Journal, vol. 1, no. 1, pp


14 | P a g e

You might also like