Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

VISVESVARAYA TECHNOLOGICAL UNIVERSITY

JNANASANGAMA, BELAGAVI – 590018

Mini Project Report


on

RESTAURANT BILLING SYSTEM

Submitted in partial fulfillment for the award of degree of

Bachelor of Engineering
In
Artificial Intelligence and Machine Learning

Submitted by
AARYAN KV
CHANDAN KUMAR BG
NAVEENA GN
SHESHADRI N

An Autonomous Institution under VTU


Department of Artificial Intelligence and Machine Learning

2022-23
An Autonomous Institution under VTU

Department of Artificial Intelligence and Machine Learning

CERTIFICATE
Certified that the Mini Project entitled “Restaurant Billing System” carried out by Mr.
Aaryan KV, Chandan kumar BG, Naveena GN, Sheshadri N bonafide students of 3rd
Semester B.E., B.N.M Institute of Technology in partial fulfillment for the Bachelor of
Engineering in ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING of the
Visvesvaraya Technological University, Belagavi during the year 2022-23. It is certified that all
corrections / suggestions indicated for Internal Assessment have been incorporated in the report.
The Project report has been approved as it satisfies the academic requirements in respect of
Database Management System with the Mini Project Laboratory prescribed for the said Degree.

Mrs. Nirupama M Padmanabha Dr. Sheba Selvam


Assistant Professor, Professor and HOD
Department of AIML, Department of AIML
BNMIT, Bengaluru BNMIT, Bengaluru

Name & Signature

Examiner 1:

Examiner 2:
OOP Using JAVA / Restaurant Billing System

Abstract

The restaurant billing system is a software program that enables customers to order food from a restaurant's menu
and calculate the total cost of their order. The program uses a TreeMap and HashMap data structures to map food
items to their prices and allows customers to enter coupon codes to receive discounts on their orders. This report
provides a detailed description of the program's features and functionality, along with an explanation of the
TreeMap and HashMap data structures and its role in the program's design.

This project aims to create a billing system for a restaurant using Java programming language and the TreeMap
data structure. The system allows customers to select items from the menu, enter the quantity, and receive a
printed receipt with the subtotal, tax, and total amount.

BE / Dept. of AIML / BNMIT 2022-23


OOP Using JAVA / Restaurant Billing System

Acknowledgement

The satisfaction and euphoria that accompany the successful completion of any task would be
incomplete without the mention of the people who made it possible, whose constant guidance and
encouragement crowned my effort with success.

I would like to thank Shri Narayan Rao R. Maanay, Secretary, BNMIT, Bengaluru for providing
an excellent academic environment in the College.

I would like to sincerely thank Prof. T. J. Rama Murthy, Director, BNMIT, Bengaluru for
having extended his support and encouraging me during the course of the work.

I would like to sincerely thank Dr. S.Y. Kulkarni, Additional Director, BNMIT, Bengaluru for
having extended his support and encouraging me during the course of the work.

I would like to express my gratitude to Prof. Eishwar N. Maanay, Dean, BNMIT, Bengaluru for
his relentless support, guidance and assistance.

I would like to thank Dr. Krishnamurthy G.N, Principal, BNMIT, Bengaluru for his constant
encouragement.

I would like to thank Dr. Sheba Selvam, Professor and Head of the Department of Artificial
Intelligence and Machine Learning, BNMIT, Bengaluru who has shared her opinions and thoughts
which helped me in completion of my Internship successfully.

I would also like to thank my guide Mrs. Nirupama M Padmanabha, Associate Professor,
Department of Artificial Intelligence and Machine Learning, BNMIT, Bengaluru for guiding in a
systematic manner.

Finally, I would like to thank all technical and non-technical faculty members of Department of
Artificial Intelligence and Machine Learning, BNMIT, Bengaluru, for their support. I would like to
thank my Family and Friends for their unfailing moral support and encouragement.

Aaryan KV,
Chandan kumar BG,
Naveena GN,
Sheshadri N .

BE / Dept. of AIML / BNMIT 2022-23


OOP Using JAVA / Number Guessing Game

Table of Contents

Chapter No. Topics Page No.

1 Introduction 3

2 Problem Statement 4

3 System Requirements 5

4 System Design 6

5 Source code & Implementation Outputs 7

6 Conclusion & References

BE / Dept. of AIML / BNMIT 1 2022-23


OOP Using JAVA / Number Guessing Game

List of Figures

Figure No. Figure Title

1 This displays the menu of the restaurant

2 Accepting Inputs from the user

3 Output Screen With The Receipt

BE / Dept. of AIML / BNMIT 2 2022-23


OOP Using JAVA / Number Guessing Game

Chapter 1

Introduction

In today's world, technology plays a significant role in almost all aspects of our lives, including the way we order
food. Restaurants use various software applications to make the ordering process simpler and more efficient. The
restaurant billing system is one such software program that enables customers to place orders quickly and
efficiently while allowing the restaurant to keep track of orders and customer payments. This report presents a
Java program that implements a restaurant billing system using a TreeMap and HashMaps data structures.

The restaurant billing system program is a Java-based program that uses a HashMap to store food items and their
prices. The program prompts the customer to select items from the menu and calculates the total cost of the order.
The program also allows the customer to enter a coupon code to receive a discount on their order. The program
uses a while loop to iterate through the order process, allowing the customer to place multiple orders if desired.

The program begins by creating a HashMap called menu, which maps food items to their prices. The program
then prompts the user to order food items from the menu. If the user enters an item that is not in the menu, the
program outputs a message indicating that the item is not available. If the user enters a valid item, the program
adds the item's price to the total variable and outputs a message indicating that the item has been added to the
order.

After each order, the program prompts the user to order more items or to proceed to checkout. If the user chooses
to proceed to checkout, the program checks if the user has a coupon code. If the user enters a valid coupon code,
the program applies the discount to the total cost of the order. If the coupon code is not valid, the program outputs
a message indicating that the coupon code is not valid.

BE / Dept. of AIML / BNMIT 3 2022-23


OOP Using JAVA / Number Guessing Game

Chapter 2

Problem Statement

The goal of this project is to develop a software program that enables customers to order food items from a
restaurant's menu and calculate the total cost of their order. The program should use a TreeMap data structure to
store food items and their prices and allow customers to enter coupon codes to receive discounts on their orders.
The program should also use a loop to iterate through the ordering process, allowing customers to place multiple
orders if desired The program should allow the user to select items from a pre-defined menu, specify the quantity
of each item, apply discounts using coupon codes, and generate a receipt with the total cost including taxes and
discounts. The program should be able to handle invalid inputs and display appropriate error messages to the user.
The program should be developed using Java programming language and should have a user-friendly interface.
The program should be efficient, easy to use, and provide accurate order calculations. The program should be
tested thoroughly to ensure that it meets the requirements and functions as intended.

BE / Dept. of AIML / BNMIT 4 2022-23


OOP Using JAVA / Number Guessing Game

Chapter 3

System Requirements

To create a Restaurant Billing System using Java, you will need the following system requirements:

1. Java Development Kit (JDK): You will need to install the JDK on your system to develop Java
applications. The latest version of the JDK is recommended.

2. Integrated Development Environment (IDE): An IDE will make it easier to create and debug Java
applications. Popular Java IDEs include Eclipse, IntelliJ IDEA, and NetBeans.

3. Java Swing Library: Java Swing is a GUI toolkit for Java applications. It provides a set of
components for building desktop applications with a GUI. You will need to ensure that your IDE has
the Java Swing library installed.

4. RAM and Processor: You should have a computer with at least 4GB of RAM and a multi-core
processor to develop Java applications efficiently.

5. Operating System: Java can be run on multiple operating systems, including Windows, Linux, and
macOS. Ensure that your operating system is compatible with the version of Java you are using.

Overall, creating a Restaurant Billing System in Java is a relatively lightweight application,


so most modern computers should be able to handle it without issue.

BE / Dept. of AIML / BNMIT 5 2022-23


OOP Using JAVA / Number Guessing Game

Chapter 4
System Design

To design a a Restaurant Billing System using Java, you will need to follow these steps:

1. Create a TreeMap named 'menu2' to store menu items and their prices in ascending order.
2. Create an array named 'oitem' to store the ordered menu items, and another array named 'qo' to store the
quantity of each ordered item.
3. Create a LinkedHashMap named 'coupons' to store discount coupons and their discount percentage.
4. Create another LinkedHashMap named 'menu' to store menu items and their prices.
5. Create a LinkedHashMap named 'menu1' to store the menu item numbers and their prices.
6. Print the welcome message and display the menu using a loop.
7. Enter a loop for ordering items and ask the user to enter the item and quantity to be ordered.
8. If the entered item is not available in the menu, display an error message and continue to the next iteration
of the loop.
9. Calculate the total price of the ordered items and add it to the 'total' variable.
10. Ask the user if they want to order more items.
11. When the user finishes ordering, ask them to enter a discount coupon.
12. Check if the entered coupon code is valid, if not, display an error message.
13. Calculate the total price of the ordered items including tax and discount.
14. Print the receipt with item names, their price, quantity, and total price.
15. Finally, display the grand total exclusive of tax and discount, and the grand total inclusive of tax and
discount.

BE / Dept. of AIML / BNMIT 6 2022-23


OOP Using JAVA / Number Guessing Game

Chapter 5

Source code & Implementation Outputs

Source code

import java.util.LinkedHashMap;
import java.util.*;
import java.util.Scanner;

public class RestaurantBillingSystem


{

public static void main(String args[])


{
int i=1,j=1,o=1;
String[] oitem = new String[100];
int qo[]=new int[100];
TreeMap<Double , String> menu2 = new TreeMap<Double, String>();
Scanner scanner = new Scanner(System.in);
LinkedHashMap coupons = new LinkedHashMap();
LinkedHashMap menu = new LinkedHashMap();
LinkedHashMap menu1 = new LinkedHashMap();

// Initialize the menu


menu.put("Burger ", 189.00);
menu.put("Fries ", 129.00);
menu.put("Soda ", 89.00);
menu.put("Sandwich ", 149.00);
menu.put("Chicken Nuggets ", 229.00);
menu.put("Fried Chicken 6 pcs", 359.00);
menu.put("Choco lava cake ", 119.00);
menu.put("Popcorn ", 199.00);
menu.put("Biryani ", 249.00);
menu.put("Ice Cream ", 219.00);

menu2.put(189.00,"Burger ");
menu2.put(129.00,"Fries ");
menu2.put(89.00,"Soda ");
menu2.put(149.00,"Sandwich ");
menu2.put(229.00,"Chicken Nuggets ");
menu2.put(359.00,"Fried Chicken 6 pcs");
menu2.put(119.00,"Choco lava cake ");
menu2.put(199.00,"Popcorn ");

BE / Dept. of AIML / BNMIT 7 2022-23


OOP Using JAVA / Number Guessing Game
menu2.put(249.00,"Biryani ");
menu2.put(219.00,"Ice Cream ");

menu1.put("1", 189.00);
menu1.put("2", 129.00);
menu1.put("3", 89.00);
menu1.put("4", 149.00);
menu1.put("5", 229.00);
menu1.put("6", 359.00);
menu1.put("7", 119.00);
menu1.put("8", 199.00);
menu1.put("9", 249.00);
menu1.put("10", 219.00);

coupons.put("NEWUSER",0.4);
coupons.put("20OFF",0.2);
coupons.put("BULKORDER",0.15);

double total = 0;
double price[] = new double[100];
double total1[] = new double[100];
boolean ordering = true;
System.out.println("Welcome To Our Restaurant");
System.out.println("Here's Our Menu:");
for (Object item : menu.keySet())
{
System.out.print(i++ + " ");
System.out.println(item + ": $" + menu.get(item));

}
while (ordering)
{

System.out.print("Enter item to order: ");


String item = scanner.nextLine();

if (!menu1.containsKey(item))
{
System.out.println("Invalid item!");
continue;
}

System.out.print("Enter quantity: ");


int quantity = scanner.nextInt();
scanner.nextLine();
double t= new Double(menu1.get(item).toString());

String rrr=menu2.get(t);

oitem[j]=rrr;
price[j]=t;
qo[j]=quantity;

BE / Dept. of AIML / BNMIT 8 2022-23


OOP Using JAVA / Number Guessing Game
total+= t*quantity;

total1[j]=total;

System.out.print("Order more? (y/n): ");


ordering = scanner.nextLine().equalsIgnoreCase("y");

j++;
}

System.out.println("Enter a discount coupon");


String dcoupon = scanner.nextLine();

double cc= new Double(coupons.getOrDefault(dcoupon,0).toString());


if(cc==0)
System.out.println("Coupon Code Invalid");

System.out.println();

double newtotal=(total+(total*0.05))-(total*cc);
System.out.println("**********************");
System.out.println(" \t\t\t RECEIPT");
System.out.println("**********************");
System.out.print("Items Ordered \t\t\t Price \t Quantity \t Total\n");
System.out.println("**********************");
for(o=1;o<j;o++)
{

System.out.print(oitem[o]+"\t\t "+price[o]+" "+qo[o]+"\t\t"+total1[o]+"\n");

}
System.out.println();
System.out.println("THE GRAND TOTAL EXCLUSIVE OF TAX AND DISCOUNT IS:"+total);
System.out.println();
System.out.println("THE GRAND TOTAL INCLUSIVE OF 5% TAX AND "+ cc*100+ "%" + "
DISCOUNT IS:"+newtotal);

BE / Dept. of AIML / BNMIT 9 2022-23


OOP Using JAVA / Number Guessing Game

Implementation Outputs

1. This displays the menu of the restaurant

2. Accepting inputs from the user

BE / Dept. of AIML / BNMIT 10 2022-23


OOP Using JAVA / Number Guessing Game

3.Output Screen With The Receipt

BE / Dept. of AIML / BNMIT 11 2022-23

You might also like