Вы находитесь на странице: 1из 34

Certificate

Project Report on

“Restaurant Billing System”

by

Class-Batch Roll No Name


SE_4_D 53 Pakshal Jain

SE_4_D 51 Atharva Pimputkar


s

DEPARTMENT OF COMPUTER ENGINEERING


SHAH AND ANCHOR KUTCHHI ENGINEERING
COLLEGE
CHEMBUR, MUMBAI – 400088.
2020 – 2021

Page 1
Table of Contents

 Abstract
 Introduction
 Problem Statement
 Database
 Implementation
 Results
 Conclusion
 References

Page 2
Abstract

Restaurant Bill Management system is basically a billing system we can see in many
places.

It reduces paperwork of billing systems and we can say it helps nature. In this system a
billing page of the restaurant is created in that we can add food items, drinks whichever
we want and how much quantity we want and finally it creates a total bill which includes
total amount of items concluded with tax if has. The main page also have many options
like home delivery, options in food items like that.

Page 3
Introduction

Our system is considered as daily basis using system. The main target of our project is to
store customer information just like customer name, address, phone no. etc. This project is
set to add orders, cancel orders, option for home delivery. Purpose is nothing but to reduce
manual work of such restaurant or hotel systems. Project aims in developing computerized
system to maintain daily basis transactions. The main reason of storing information is its
very helpful for government authorities to grab the data if anything happened to customer.
Else we also have home delivery selection option so staff can easily locate customer
residence. In our project we have used mainly java programming for designing billing
form. Designed billing form provides many options like food items, Cold drinks, Hot
drinks, Deserts, Home delivery if want etc. following to restaurants service. By adding
items it calculates total bill including taxes. So this is how final bill is created. Our
database maintenance is made efficient as its easy to access data for authorized person.

Page 4
Problem statement

The major target of our project is to come with easy and useful format that helps both
customers and employees. Older techniques of using pen and paper for billing any
customer bills will overcomes by our project. Billing counter employees also have easy
way to use our system. Our main job was to create a storage to store an information of
each and every bill of customer. In case of any calamities paper works destroys in seconds
but here database stored information can quickly restorable.

Page 5
Database

Database Name: studentdb & Table Name: customer

Page 6
Implementation
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
import javax.swing.JOptionPane;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

/**
*
* @author PAKSHAL_JAIN
*/
public class RESTAURANT_BILLING_SYSTEM extends javax.swing.JFrame {

/**
* Creates new form RESTAURANT_BILLING_SYSTEM
*/
public RESTAURANT_BILLING_SYSTEM() {
initComponents();
}

Page 7
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {

jSpinner1 = new javax.swing.JSpinner();


jFrame1 = new javax.swing.JFrame();
jFrame2 = new javax.swing.JFrame();
jMenuItem1 = new javax.swing.JMenuItem();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
tf1 = new javax.swing.JTextField();
tf2 = new javax.swing.JTextField();
tf3 = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
jSeparator1 = new javax.swing.JSeparator();
jSeparator2 = new javax.swing.JSeparator();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel13 = new javax.swing.JLabel();
jScrollPane4 = new javax.swing.JScrollPane();
ta1 = new javax.swing.JTextArea();
jLabel14 = new javax.swing.JLabel();
jLabel15 = new javax.swing.JLabel();
jLabel16 = new javax.swing.JLabel();
tf4 = new javax.swing.JTextField();
tf5 = new javax.swing.JTextField();
tf6 = new javax.swing.JTextField();
checkbox1 = new javax.swing.JCheckBox();
jLabel17 = new javax.swing.JLabel();
tf8 = new javax.swing.JTextField();
jLabel18 = new javax.swing.JLabel();
tf7 = new javax.swing.JTextField();
jButton4 = new javax.swing.JButton();
cb1 = new javax.swing.JComboBox<>();
cb2 = new javax.swing.JComboBox<>();
cb3 = new javax.swing.JComboBox<>();
qt1 = new javax.swing.JTextField();
qt2 = new javax.swing.JTextField();
qt3 = new javax.swing.JTextField();
jPanel1 = new javax.swing.JPanel();

Page 8
jLabel5 = new javax.swing.JLabel();
jSeparator7 = new javax.swing.JSeparator();
jSeparator8 = new javax.swing.JSeparator();
jLabel19 = new javax.swing.JLabel();
jSeparator4 = new javax.swing.JSeparator();
jSeparator6 = new javax.swing.JSeparator();
jPanel3 = new javax.swing.JPanel();
qt4 = new javax.swing.JTextField();
qt5 = new javax.swing.JTextField();
qt6 = new javax.swing.JTextField();
cb4 = new javax.swing.JComboBox<>();
cb5 = new javax.swing.JComboBox<>();
cb6 = new javax.swing.JComboBox<>();
jLabel11 = new javax.swing.JLabel();
jLabel12 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jSeparator5 = new javax.swing.JSeparator();
jSeparator3 = new javax.swing.JSeparator();
jLabel20 = new javax.swing.JLabel();
jPanel2 = new javax.swing.JPanel();
jButton3 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton1 = new javax.swing.JButton();
jButton5 = new javax.swing.JButton();
jButton6 = new javax.swing.JButton();
jTabbedPane1 = new javax.swing.JTabbedPane();

javax.swing.GroupLayout jFrame1Layout = new


javax.swing.GroupLayout(jFrame1.getContentPane());
jFrame1.getContentPane().setLayout(jFrame1Layout);
jFrame1Layout.setHorizontalGroup(
jFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 400, Short.MAX_VALUE)
);
jFrame1Layout.setVerticalGroup(
jFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 300, Short.MAX_VALUE)
);

javax.swing.GroupLayout jFrame2Layout = new


javax.swing.GroupLayout(jFrame2.getContentPane());
jFrame2.getContentPane().setLayout(jFrame2Layout);
jFrame2Layout.setHorizontalGroup(
jFrame2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 400, Short.MAX_VALUE)
);
jFrame2Layout.setVerticalGroup(

Page 9
jFrame2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 300, Short.MAX_VALUE)
);

jMenuItem1.setText("jMenuItem1");

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

jLabel1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N


jLabel1.setText("Name:");
getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 110, -1, -1));

jLabel2.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N


jLabel2.setText("Phone No:");
getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 110, -1, -
1));

jLabel3.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N


jLabel3.setText("Address:");
getContentPane().add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(570, 110, -1, -
1));
getContentPane().add(tf1, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 100, 150, 30));
getContentPane().add(tf2, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 100, 180, 30));
getContentPane().add(tf3, new org.netbeans.lib.awtextra.AbsoluteConstraints(630, 100, 200, 30));

jLabel4.setBackground(new java.awt.Color(153, 255, 255));


jLabel4.setFont(new java.awt.Font("Rockwell", 1, 36)); // NOI18N
jLabel4.setForeground(new java.awt.Color(102, 102, 255));
jLabel4.setText("RESTAURANT BILLING SYSTEM");
jLabel4.setMaximumSize(new java.awt.Dimension(148, 50));
jLabel4.setMinimumSize(new java.awt.Dimension(148, 50));
jLabel4.setPreferredSize(new java.awt.Dimension(148, 50));
getContentPane().add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 20, 610, -
1));
getContentPane().add(jSeparator1, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 150, 840,
20));
getContentPane().add(jSeparator2, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 72, 660,
-1));

jLabel6.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N


jLabel6.setText("1. Burger ");
getContentPane().add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 220, -1, -1));

jLabel7.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N


jLabel7.setText("2. Pizza ");
getContentPane().add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 270, -1, -1));

Page 10
jLabel8.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
jLabel8.setText("3. Sandwich");
getContentPane().add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 310, -1, 30));

jLabel13.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N


jLabel13.setText("Bill Reciept");
getContentPane().add(jLabel13, new org.netbeans.lib.awtextra.AbsoluteConstraints(770, 180, -1, -
1));

ta1.setColumns(20);
ta1.setRows(5);
jScrollPane4.setViewportView(ta1);

getContentPane().add(jScrollPane4, new org.netbeans.lib.awtextra.AbsoluteConstraints(640, 210,


360, 440));

jLabel14.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N


jLabel14.setText("Cost Of Meal");
getContentPane().add(jLabel14, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 380, -1, -
1));

jLabel15.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N


jLabel15.setText("Cost Of Drinks");
getContentPane().add(jLabel15, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 380, -1, -
1));

jLabel16.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N


jLabel16.setText("Cost Of Delivery");
getContentPane().add(jLabel16, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 440, -1, -
1));
getContentPane().add(tf4, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 370, 150, 30));

tf5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
tf5ActionPerformed(evt);
}
});
getContentPane().add(tf5, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 370, 170, 30));

tf6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
tf6ActionPerformed(evt);
}
});
getContentPane().add(tf6, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 430, 150, 30));

checkbox1.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N


checkbox1.setText("Home Delivery");

Page 11
getContentPane().add(checkbox1, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 433, -1,
30));

jLabel17.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N


jLabel17.setText("Total Bill Amount:");
getContentPane().add(jLabel17, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 510, -1, -
1));
getContentPane().add(tf8, new org.netbeans.lib.awtextra.AbsoluteConstraints(390, 500, 190, 30));

jLabel18.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N


jLabel18.setText("Tax:");
getContentPane().add(jLabel18, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 495, -1,
40));
getContentPane().add(tf7, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 500, 160, 30));

jButton4.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N


jButton4.setText("Generate Reciept");
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
}
});
getContentPane().add(jButton4, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 620, 150,
40));

cb1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "SELECT", "Cheese


Burger", "Chicken Burger", "Veg Burger", "Beef Burger", "Black Bean Burger" }));
cb1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cb1ActionPerformed(evt);
}
});
getContentPane().add(cb1, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 210, 100, 30));

cb2.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "SELECT", "Veg


Cheese Pizza", "Chicken Cheese Pizza", "Pepperoni Pizza", "Buffalo Pizza", "BBQ Chicken Pizza" }));
cb2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cb2ActionPerformed(evt);
}
});
getContentPane().add(cb2, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 260, 100, 30));

cb3.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "SELECT", "Veg


Cheese Sandwich", "Club Sandwich", "Pocket Sandwich", "Chicken Sandwich", "Plain Sandwich" }));
getContentPane().add(cb3, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 310, 100, 30));
getContentPane().add(qt1, new org.netbeans.lib.awtextra.AbsoluteConstraints(230, 210, 60, 30));
getContentPane().add(qt2, new org.netbeans.lib.awtextra.AbsoluteConstraints(230, 260, 60, 30));

Page 12
getContentPane().add(qt3, new org.netbeans.lib.awtextra.AbsoluteConstraints(230, 310, 60, 30));

jPanel1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAIS
ED));
jPanel1.setForeground(new java.awt.Color(51, 51, 255));

jLabel5.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N


jLabel5.setText("Food Items");

jLabel19.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N


jLabel19.setText("Qty.");

javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);


jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jSeparator8, javax.swing.GroupLayout.PREFERRED_SIZE, 50,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jSeparator7, javax.swing.GroupLayout.PREFERRED_SIZE, 50,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, 48,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel5)
.addComponent(jSeparator7, javax.swing.GroupLayout.PREFERRED_SIZE, 10,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(21, 21, 21)
.addComponent(jSeparator8, javax.swing.GroupLayout.PREFERRED_SIZE, 17,
javax.swing.GroupLayout.PREFERRED_SIZE))

Page 13
.addComponent(jLabel19, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(148, Short.MAX_VALUE))
);

getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 160, 270,


190));
getContentPane().add(jSeparator4, new org.netbeans.lib.awtextra.AbsoluteConstraints(580, 160, -1,
-1));
getContentPane().add(jSeparator6, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 190, -1,
-1));

jPanel3.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAIS
ED));

cb4.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "SELECT", "Pepsi",


"Coca Cola", "Sprite", "Thums Up", "Limica" }));

cb5.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "SELECT", "Coffee",


"Hot Chocolate", "Green Tea", "Tea" }));

cb6.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "SELECT", "Apple


Juice", "Sugarcane Juice", "Orange Juice", "Red Grape Juice", "Pineapple Juice" }));

jLabel11.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N


jLabel11.setText("2. Hot Drinks");

jLabel12.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N


jLabel12.setText("3. Juice");

jLabel10.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N


jLabel10.setText("1. Cold Drinks");

jLabel9.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N


jLabel9.setText("Drinks");

jLabel20.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N


jLabel20.setText("Qty.");

javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);


jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

Page 14
.addGroup(jPanel3Layout.createSequentialGroup()

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addComponent(jLabel12, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(18, 18, 18)
.addComponent(cb6, javax.swing.GroupLayout.PREFERRED_SIZE, 110,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel3Layout.createSequentialGroup()

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel10)
.addComponent(jLabel11))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 14,
Short.MAX_VALUE)

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(cb5, 0, 110, Short.MAX_VALUE)
.addComponent(cb4, 0, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
.addGap(18, 18, 18)))

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(qt4, javax.swing.GroupLayout.DEFAULT_SIZE, 60,
Short.MAX_VALUE)
.addComponent(qt5)
.addComponent(qt6, javax.swing.GroupLayout.Alignment.TRAILING))
.addContainerGap())
.addGroup(jPanel3Layout.createSequentialGroup()
.addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, 72,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel9)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jSeparator5)
.addGap(18, 18, 18)
.addComponent(jLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, 40,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(21, 21, 21))))
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

Page 15
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18))
.addGroup(jPanel3Layout.createSequentialGroup()

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(26, 26, 26)
.addComponent(jSeparator5, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 27,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, 30,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(qt4, javax.swing.GroupLayout.PREFERRED_SIZE, 30,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cb4, javax.swing.GroupLayout.PREFERRED_SIZE, 30,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel10))
.addGap(18, 18, 18)

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(qt5, javax.swing.GroupLayout.PREFERRED_SIZE, 30,
javax.swing.GroupLayout.PREFERRED_SIZE)

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel11)
.addComponent(cb5, javax.swing.GroupLayout.PREFERRED_SIZE, 30,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(18, 18, 18)

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(qt6, javax.swing.GroupLayout.PREFERRED_SIZE, 30,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cb6, javax.swing.GroupLayout.PREFERRED_SIZE, 30,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel12))
.addContainerGap(13, Short.MAX_VALUE))

Page 16
);

getContentPane().add(jPanel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 160, 300,


190));

jPanel2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAIS
ED));

jButton3.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N


jButton3.setText("Calculate Total Amount");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});

jButton2.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N


jButton2.setText("Calculate Delivery & Tax Amount");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});

jButton1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N


jButton1.setText("Calculate Meal & Drinks Amount");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});

jButton5.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N


jButton5.setText("CLEAR");
jButton5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton5ActionPerformed(evt);
}
});

jButton6.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N


jButton6.setText("EXIT");
jButton6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton6ActionPerformed(evt);
}
});

Page 17
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel2Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton3)
.addGap(33, 33, 33))
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(111, 111, 111)
.addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 100,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 90,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(130, 130, 130))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(19, 19, 19)

.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 40,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 40,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 40,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)

.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 40,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 40,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);

getContentPane().add(jPanel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 540, 630,


130));

Page 18
getContentPane().add(jTabbedPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(680, -10, -
1, -1));

pack();
}// </editor-fold>

private void tf5ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
}

private void tf6ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
}

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:

double amt1=Double.parseDouble(""+tf4.getText());
double amt2=Double.parseDouble(""+tf5.getText());
double amt3=Double.parseDouble(""+tf6.getText());
double amt4=Double.parseDouble(""+tf7.getText());
double totalamount=amt1+amt2+amt3+amt4;
tf8.setText(""+totalamount);

private void cb1ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
double cost=0.0,cost1=0.0,cost2=0.0,cost3=0.0,cost4=0.0,cost5=0.0;
int qty1,qty2,qty3,qty4,qty5,qty6;

String item=(String)cb1.getSelectedItem();

if(item.equals("SELECT")){
qty1=0;
qt1.setText(""+qty1);
cost=0.0;
}
else{
qty1=Integer.parseInt(qt1.getText());

Page 19
if(item.equals("Cheese Burger")){
cost=80.0;
}
else if(item.equals("Chicken Burger")){
cost=120.0;
}
else if(item.equals("Veg Burger")){
cost=60.0;
}
else if(item.equals("Beef Burger")){
cost=170.0;
}
else if(item.equals("Black Bean Burger")){
cost=200.0;
}
}

String item1=(String)cb2.getSelectedItem();

if(item1.equals("SELECT")){
qty2=0;
qt2.setText(""+qty2);
cost1=0.0;
}
else{
qty2=Integer.parseInt(qt2.getText());
if(item1.equals("Veg Cheese Pizza")){
cost1=100.0;
}
else if(item1.equals("Chicken Cheese Pizza")){
cost1=150.0;
}
else if(item1.equals("Pepperoni Pizza")){
cost1=80.0;
}
else if(item1.equals("Buffalo Pizza")){
cost1 = 200.0;
}
else if(item1.equals("BBQ Chicken Pizza")){
cost1=250.0;
}
}

String item3=(String)cb3.getSelectedItem();

if(item3.equals("SELECT")){
qty3=0;
qt3.setText(""+qty3);

Page 20
cost2=0.0;
}
else{
qty3=Integer.parseInt(qt3.getText());
if(item3.equals("Veg Cheese Sandwich")){
cost2=100.0;
}
else if(item3.equals("Club Sandwich")){
cost2=150.0;
}
else if(item3.equals("Pocket Sandwich")){
cost2=80.0;
}
else if(item3.equals("Chicken Sandwich")){
cost2 = 200.0;
}
else if(item3.equals("Plain Sandwich")){
cost2=250.0;
}
}

//CODE FOR DRINKS-----------

String item4=(String)cb4.getSelectedItem();

if(item4.equals("SELECT")){
qty4=0;
qt4.setText(""+qty4);
cost3=0.0;
}
else{
qty4=Integer.parseInt(qt4.getText());
if(item4.equals("Pepsi")){
cost3=50.0;
}
else if(item4.equals("Coca Cola")){
cost3=40.0;
}
else if(item4.equals("Sprite")){
cost3=40.0;
}
else if(item4.equals("Thums Up")){
cost3= 55.0;
}
else if(item4.equals("Limica")){
cost3=35.0;
}

Page 21
}

String item5=(String)cb5.getSelectedItem();

if(item5.equals("SELECT")){
qty5=0;
qt5.setText(""+qty5);
cost4=0.0;
}
else{
qty5=Integer.parseInt(qt5.getText());
if(item5.equals("Coffee")){
cost4=40.0;
}
else if(item5.equals("Hot Chocolate")){
cost4=100.0;
}
else if(item5.equals("Green Tea")){
cost4=40.0;
}
else if(item5.equals("Tea")){
cost4= 20.0;
}
}

String item6=(String)cb6.getSelectedItem();

if(item6.equals("SELECT")){
qty6=0;
qt6.setText(""+qty6);
cost5=0.0;
}
else{
qty6=Integer.parseInt(qt6.getText());
if(item6.equals("Apple Juice")){
cost5=90.0;
}
else if(item6.equals("Sugarcane Juice")){
cost5=50.0;
}
else if(item6.equals("Orange Juice")){
cost5=50.0;
}
else if(item6.equals("Red Grape Juice")){
cost5= 70.0;
}
else if(item6.equals("Pineapple Juice")){
cost5= 80.0;

Page 22
}
}

double totalmeal=cost*qty1 + cost1*qty2 + cost2*qty3;


double totaldrinks=cost3*qty4 + cost4*qty5 + cost5*qty6;
tf4.setText(""+totalmeal);
tf5.setText(""+totaldrinks);

private void cb2ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
}

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:

if(checkbox1.isSelected()==true){
double cost=200.0;
tf6.setText(""+cost);
}
else{
double x=0.0;
tf6.setText(""+x);
}
double tax1=Double.parseDouble(""+tf4.getText());
double tax2=Double.parseDouble(""+tf5.getText());
double totaltax=(tax1+tax2)+8*(tax1+tax2)/100;
tf7.setText(""+totaltax);
}

private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
System.exit(0);
}

private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:

String Name=(String)tf1.getText();
int Num=Integer.parseInt(""+tf2.getText());
String Add=(String)tf3.getText();
double com=Double.parseDouble(""+tf4.getText());
double cod=Double.parseDouble(""+tf5.getText());
double delivery=Double.parseDouble(""+tf6.getText());
double tax=Double.parseDouble(""+tf7.getText());
double totalamt=Double.parseDouble(""+tf8.getText());

Page 23
ta1.append("------------------KHUSH JAIN REST-------------------------\n");
ta1.append("Name Of The Customer: " +Name+"\n");
ta1.append("\n");
ta1.append("Phone Number: "+Num+"\n");
ta1.append("\n");
ta1.append("Address Of The Customer: " +Add+"\n");
ta1.append("\n");
ta1.append("Cost Of Meal: " +com+"\n");
ta1.append("\n");
ta1.append("Cost Of Drinks: "+cod+"\n");
ta1.append("\n");
ta1.append("Cost Of Delivery: " +delivery+"\n");
ta1.append("\n");
ta1.append("Tax(SGST+CGST): " +tax+"\n");
ta1.append("\n");
ta1.append("Total Amount: " +totalamt+"\n");
ta1.append("\n");
ta1.append("------------------RECIEPT---------------------------");

//SQL CONNECTION CODE:

try{

Class.forName("com.mysql.jdbc.Driver");
// establish connection
Connection con = DriverManager.getConnection("jdbc:mysql://localhost/studentdb", "root", "");
Statement statement = con.createStatement();
statement.executeUpdate("INSERT INTO customer VALUES('" + tf1.getText() + "','" +
tf2.getText() + "','" + tf3.getText() + "','" + tf4.getText() + "','" + tf5.getText() + "'," + tf8.getText() + ")");
JOptionPane.showMessageDialog(null, "Record inserted...");
statement.close();
con.close();
Referesh(); //Calling Referesh() method
}
catch (SQLException | ClassNotFoundException e) {
JOptionPane.showMessageDialog(null, e);
}

private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
tf1.setText("");
tf2.setText("");
tf3.setText("");
tf4.setText("");
tf5.setText("");
tf6.setText("");

Page 24
tf7.setText("");
tf8.setText("");
cb1.setSelectedItem("SELECT");
cb2.setSelectedItem("SELECT");
cb3.setSelectedItem("SELECT");
cb4.setSelectedItem("SELECT");
cb5.setSelectedItem("SELECT");
cb6.setSelectedItem("SELECT");
}

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {

java.util.logging.Logger.getLogger(RESTAURANT_BILLING_SYSTEM.class.getName()).log(java.util
.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(RESTAURANT_BILLING_SYSTEM.class.getName()).log(java.util
.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {

java.util.logging.Logger.getLogger(RESTAURANT_BILLING_SYSTEM.class.getName()).log(java.util
.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {

java.util.logging.Logger.getLogger(RESTAURANT_BILLING_SYSTEM.class.getName()).log(java.util
.logging.Level.SEVERE, null, ex);
}
//</editor-fold>

/* Create and display the form */


java.awt.EventQueue.invokeLater(new Runnable() {

Page 25
public void run() {
new RESTAURANT_BILLING_SYSTEM().setVisible(true);
}
});
}

// Variables declaration - do not modify


private javax.swing.JComboBox<String> cb1;
private javax.swing.JComboBox<String> cb2;
private javax.swing.JComboBox<String> cb3;
private javax.swing.JComboBox<String> cb4;
private javax.swing.JComboBox<String> cb5;
private javax.swing.JComboBox<String> cb6;
private javax.swing.JCheckBox checkbox1;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JButton jButton5;
private javax.swing.JButton jButton6;
private javax.swing.JFrame jFrame1;
private javax.swing.JFrame jFrame2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel14;
private javax.swing.JLabel jLabel15;
private javax.swing.JLabel jLabel16;
private javax.swing.JLabel jLabel17;
private javax.swing.JLabel jLabel18;
private javax.swing.JLabel jLabel19;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel20;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JMenuItem jMenuItem1;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JScrollPane jScrollPane4;
private javax.swing.JSeparator jSeparator1;

Page 26
private javax.swing.JSeparator jSeparator2;
private javax.swing.JSeparator jSeparator3;
private javax.swing.JSeparator jSeparator4;
private javax.swing.JSeparator jSeparator5;
private javax.swing.JSeparator jSeparator6;
private javax.swing.JSeparator jSeparator7;
private javax.swing.JSeparator jSeparator8;
private javax.swing.JSpinner jSpinner1;
private javax.swing.JTabbedPane jTabbedPane1;
private javax.swing.JTextField qt1;
private javax.swing.JTextField qt2;
private javax.swing.JTextField qt3;
private javax.swing.JTextField qt4;
private javax.swing.JTextField qt5;
private javax.swing.JTextField qt6;
private javax.swing.JTextArea ta1;
private javax.swing.JTextField tf1;
private javax.swing.JTextField tf2;
private javax.swing.JTextField tf3;
private javax.swing.JTextField tf4;
private javax.swing.JTextField tf5;
private javax.swing.JTextField tf6;
private javax.swing.JTextField tf7;
private javax.swing.JTextField tf8;
// End of variables declaration

private void Referesh() {


tf1.setText("");
tf2.setText("");
tf3.setText("");
tf4.setText("");
tf5.setText("");
tf8.setText("");
qt1.setText("");
qt2.setText("");
qt3.setText("");
qt4.setText("");
qt5.setText("");
qt6.setText("");

throw new UnsupportedOperationException("Not supported yet."); //To change body of generated


methods, choose Tools | Templates.
}
}

Page 27
Results

1. Calculate Cost Of Meal & Drinks Button Output:

Page 28
2. Calculate cost of delivery & Tax(16%) Button Output:

3. Calculate Total Amount Button Output:

Page 29
4. Generate Reciept & Insert Data Into Database Output:

Page 30
6. Clear All The Field Using Clear Button Output:

Page 31
7. Exit (System.exit(0);) Button Output:

Page 32
Conclusion

Our project had mainly focused on generation of bill of restaurant with the help of
database.

We also learned lot of things related to this field. We have basically created a form page
that includes food items and all as we ordered also it generates full bill. Database use in
such type of system also a great experience for us. This system keeps the records of
hardware assets besides software of this organization. The existing system is a manually
maintained system. All these details are entered and retrieved manually because of this
there are many disadvantages like Time consuming ,updating process, inaccuracy of data.
For avoiding this we introduced or proposed a new system in proposed system the
computerized version of the existing system. provides easy and quick access over the data.

Page 33
References

Here some references that we have used in this project

 WWW.ieee.com
 WWW.slite.com ( Refarance for project report)
 WWW.quara.com
 Netbeans apache server
 Mysql for database

Page 34

Вам также может понравиться