FOOD ORDERING AND
BILLING SYSTEM
Project Report
Of Summer Training Project
BACHELOR OF TECHNOLOGY
ELECTRONICS AND COMMUNICATION ENGINEERING
Submitted to
Dr. A.P.J ABDUL KALAM
TECHNICAL UNIVERSITY LUCKNOW
SUBMITTED BY
ADWITEEYA PRAKASH
UNIVERSITY ROLL NO.-2200100100040
UNITED COLLEGE OF ENGINEERING
AND RESEARCH
INDEX
Content Page No.
1. ABSTRACT 01
2. INTRODUCTION 02
3. BASICS OF CORE JAVA 03
4. BLOCK DIAGRAM 08
5. FLOW CHART 09
6. METHODOLOGY 10
7. CODE 11
8. OUTPUT 15
9. FACILITIES REQUIRED FOR PROPOSED WORK 16
10. SOCIAL RELEVANCE 17
11. FUTURE SCOPE 18
12. CONCLUSION 19
11. BIBLIOGRAPHY 20
ABSTRACT
This Java-based food ordering system streamlines the ordering process for customers and
enhances efficiency for restaurants. The system incorporates user-friendly interfaces for
customers to browse menus, place orders, and make payments securely. Utilizing Java's object-
oriented features, the system manages order data, updates inventory in real-time, and generates
invoices. Employing a relational database, it ensures seamless communication between
customers, restaurants, and delivery services. With robust error handling and intuitive design,
this system optimizes the overall food ordering experience, benefiting both customers and
businesses.
1
INTRODUCTION
JAVA was originally developed by James Gosling at Sun Microsystems. It was released in
May 1995 as a core component of Sun Microsystems Java platform. Due to its platform
independency, security features, and its ability to handle large amounts of data. It is a
powerful programming language that is well-suited for developing Food Ordering and Billing
System.
In this project we've made food ordering and billing system with Java. By the use of this system
customer can order their required food item by entering their choice of the food item which is
given in our menu with its price. Customer can also order various food items according to their
choices . They can order the quantity of food as per their requirement.
When customer enters all their choices of food items we generate the total bill of the order
which customer should have to pay and we also provide feedback(Yes/No) option to the
customer if they are interested in giving feedback then they have to enter Yes and give
their feedback otherwise they have to enter No.
2
BASICS OF CORE JAVA
Introduction:
Core Java is like the base or foundation of a special language called Java that helps people
create computer programs. It's important because it provides the basic tools and rules for
making different kinds of applications. Core Java is like the backbone of the Java programming
language. It provides the basic tools and rules for making computer programs. Let's explore
what makes Core Java important and how it helps in creating different types of applications.
Key Features of Core Java:
1. Building Blocks - Objects and Classes: In Core Java, we use something called objects and
classes. Think of classes as blueprints and objects as the actual things made from those
blueprints. This makes our programs organized and easy to reuse.
2. Works Anywhere - Platform Independence: One cool thing about Core Java is that we can
write our program once, and it can run on any computer that has Java installed. It's like magic –
saves a lot of time!
3. Multitasking - Doing Many Things at Once: Core Java lets our programs do many things at
the same time. It's like juggling multiple tasks, such as playing music while browsing the
internet.
4. Handling Mistakes - Exception Handling: Sometimes our programs make mistakes. Core Java
helps us handle these mistakes in a smart way, making our programs more trustworthy.
5. Safety - Security Features: Core Java has features that keep our programs safe from harmful
things. It's like having a security guard for our applications.
In Java, a constructor is a special type of method that is used to initialize objects of a class. It
shares the same name as the class and does not have a return type. The primary purpose of a
constructor is to set initial values for the instance variables of the object being created. When an
object is instantiated using the new keyword, the constructor is automatically invoked.
Constructors-
There are two main types of constructors in Java: default (or no-argument) constructors and
parameterized constructors. The default constructor is automatically provided by Java if no
constructor is explicitly defined in the class. It initializes the instance variables to their default
values (e.g., 0 for numeric types, null for objects).
On the other hand, a parameterized constructor allows you to pass arguments at the time of
object creation. This enables you to initialize the object with specific values based on the
provided parameters. Parameterized constructors enhance flexibility and allow for
more customized object creation.
3
Constructors play a crucial role in ensuring that objects start in a consistent state, and they are
integral to the concept of encapsulation in object-oriented programming. They contribute to the
overall robustness and reliability of Java programs by establishing a well-defined starting point
for objects within a class hierarchy. Understanding how to appropriately design and utilize
constructors is fundamental for Java developers aiming to create efficient and maintainable
code.
In Java, constructors are special methods that initialize objects when they are created. There are
three main types of constructors:
1. Default Constructor:
- A default constructor is automatically provided by Java if no constructor is explicitly defined
in a class.
- It initializes the instance variables with default values (0 for numeric types, null for objects).
- Example:
java
public class MyClass {
// Default constructor
public MyClass() {
// Initialization code
}
}
2. Parameterized Constructor:
- A parameterized constructor allows you to initialize the instance variables with values passed
as parameters when the object is created.
- It provides flexibility to create objects with different initial states.
- Example:
java
public class Car {
String model;
int year;
// Parameterized constructor
4
public Car(String model, int year) {
this.model = model;
this.year = year;
}
}
Object-Oriented Programming Concepts in Java
Object-Oriented Programming (OOP) is a paradigm that helps organize code by representing
real-world entities as objects, fostering modularity and reusability. In Java, OOP principles are
fundamental for designing robust and scalable applications.
1. Objects:
Simple Explanation: In Java, everything is an object. Objects are instances of classes and
represent real-world entities. For example, a "Car" class can create individual car objects, each
with specific characteristics and behaviors.
2. Classes:
Simple Explanation: A class is like a blueprint that defines the properties and behaviors
common to a group of objects. Going back to our "Car" example, the class specifies what a car
should have (attributes like color, model) and what it can do (methods like start, stop).
3. Encapsulation:
Simple Explanation: Encapsulation means bundling data (attributes) and methods that operate
on that data within a single unit, i.e., a class. It hides the internal workings of the object,
exposing only what's necessary. It's like a black box; you know what it does, but not how it
does it.
4. Inheritance:
Simple Explanation: Inheritance is like a parent-child relationship between classes. A new
class (child) can inherit attributes and behaviors from an existing class (parent). If we have a
"Vehicle" class, a "Car" class can inherit from it, gaining the vehicle properties.
5. Polymorphism:
Simple Explanation: Polymorphism allows objects to take on multiple forms. In Java, this often
involves method overriding. For instance, a "Shape" class could have a method "draw," and
both
5
a "Circle" and "Square" class, which inherit from "Shape," can override this method to suit their
specific shapes.
6. Abstraction:
Simple Explanation: Abstraction is simplifying complex systems by modeling classes based
on real-world entities and only including relevant details. In Java, abstract classes and
interfaces help achieve abstraction. For example, an "Animal" class can be abstract, with
concrete classes like "Dog" and "Cat" providing specific implementations.
Understanding and applying these OOP concepts in Java leads to well-organized, modular,
and extensible code, making it easier to maintain and scale applications. This approach aligns
with Java's design philosophy, promoting code readability, flexibility, and long-term
maintainability.
Important Components of Core Java:
1. Java Virtual Machine (JVM): This is like a special computer inside our computer that
understands and runs our Java programs. It makes sure our programs work on any type of
computer.
2. Java Development Kit (JDK): This kit gives us all the tools we need to create Java programs.
It's like a toolbox with everything required for building our programs.
3. Useful Tools - Standard Libraries: Core Java comes with lots of ready-to-use tools. These
tools help us with things like handling information, connecting to the internet, and managing
files.
Why Core Java is Important:
1. Versatility - Can Do Many Jobs: Core Java can be used for many different types of
programs, from small apps to big business systems. It's like a superhero toolbox that can
handle various tasks.
2. Community Support - Lots of Help from Others: Many people use Core Java, so there's a big
community that helps each other. This means we can find lots of examples and advice when we
need help.
3. Great for Big Projects - Scalability: Big companies use Core Java for their important projects
because it helps build strong, reliable, and big applications.
Looking Ahead:
6
1. Facing New Competition - Adapting: Other programming languages are becoming popular
too, but Core Java is learning new things to stay useful and competitive.
2. Keeping Up with Trends - Modern Ways: Core Java is learning new tricks to fit in with the
latest trends in making computer programs, getting ready for the future.
Conclusion:
In simple words, Core Java is like the special language foundation for creating computer
programs. It's cool because it makes our programs organized, works on any computer, and is
like a superhero toolbox for developers. Many people use it, and it's getting ready for the
future by learning new things.
7
BLOCK DIAGRAM
8
FLOW CHART
9
METHODOLOGY
• The code written is a basic implementation of an Food Ordering and Billing
sstem using Java programming language:
• The code defines a single class “ FoodOrder” and contains a single method called
“main” which is the entry point of the program.
• At the beginning of the main method, the code creates integer variables called
"French Fries", "Burger", "Pastry", “Pizza”,“ ColdCoffee”, “ColdDrink” and
“IcedTea” and initialize them with their “100”, “120”, “100”, “200”, “100”,
“100”,“80”and “80” and some more integer variables called “ch”, “quantity”,
“total”and initialize them with 0. And at last create string again.
• Then, the code uses a Scanner object to read input from the user then we create
a method to display the menu and then prompts the user to enter their choice of
food item.
• Then we create a method to generate bill and also create a method to order food
items by using Switch case.
• The switch case in java executes one statement from multiple ones. Thus, it is like
an if-else-if ladder statement. It works with a lot of data types. We use 8 cases in switch.
• If the user want to make another order then , the code displays choice (Yes/No)
and prompts the user to enter (Yes/No).
• After that, the code uses an if-else statement to check the user choices and
proceed accordingly.
• If user select Yes then we again display the menu and prompt user to enter there
next choice of food item. And again follow the same procedure for order.
• Then after enter all their choices user should have to choice No option, If user
choose No option then we generate their total bill and display choice that user want
to give there feedback(Yes/No).
• If user want to give their feedback then they have to choose Yes then the
program prompts user to enter their feedback. And After user give their feedback we
display a message to the user “Thank you for your Feedback”.
• If user select No then the program displays message to the user “Visit Again”
and “Invalid Choice!!”.
• Finally, the code closes the Scanner object to release the system resources.
10
CODE
import java.util.*;
public class FoodOrder {
// declaring variables for prices of food items
int FrenchFries = 100;
int Burger = 120;
int Pastry = 100;
int Pizza = 200;
int ColdCoffee = 100;
int ColdDrink = 80;
int IcedTea = 80;
int ch = 0;
int quantity = 0;
static int total = 0;
String again = "";
Scanner sc = new Scanner(System.in);
// creating a method for declaring food items
public int displayMenu() {
System.out.println("*****Welcome To FoodieAdda*****");
System.out.println("================================================
=");
System.out.println(" 1.FrenchFries 100/-");
System.out.println(" 2.Burger 120/-");
System.out.println(" 3.Pastry 100/-");
System.out.println(" 4.Pizza 200/-");
System.out.println(" 5.ColdCoffee 100/-");
System.out.println(" 6.ColdDrink 80/-");
System.out.println(" 7.IcedTea 80/-");
System.out.println(" 8.Exit ");
System.out.println("================================================
==");
System.out.println(" What do you want to Order Today??");
System.out.println("Enter Your Choice");
int input = sc.nextInt();
return input;
11
}
// Method to Generate Bill
public void generateBill() {
System.out.println();
System.out.println("*****Thank You For Ordering*****");
System.out.println("****Your Bill is : " + total + "*****");
}
// creating a method to order food item by using switch case
public void order() {
ch = displayMenu();
switch (ch) {
case 1:
// for french fries
System.out.println("You have selected French Fries");
System.out.println();
System.out.println("Enter the desired Quantity : ");
quantity = sc.nextInt();
total = total + quantity * FrenchFries;
break;
case 2:
// for Burger
System.out.println("You have selected Burger");
System.out.println();
System.out.println("Enter the desired Quantity : ");
quantity = sc.nextInt();
total = total + quantity * Burger;
break;
case 3:
// for Pastry
System.out.println("You have selected Pastry");
System.out.println();
System.out.println("Enter the desired Quantity : ");
quantity = sc.nextInt();
total = total + quantity * Pastry;
break;
case 4:
// for Pizza
System.out.println("You have selected Pizza");
System.out.println();
System.out.println("Enter the desired Quantity : ");
12
quantity = sc.nextInt();
total = total + quantity * Pizza;
break;
case 5:
// for Cold Coffe
System.out.println("You have selected Cold Coffee ");
System.out.println();
System.out.println("Enter the desired Quantity : ");
quantity = sc.nextInt();
total = total + quantity * ColdCoffee;
break;
case 6:
// for Cold Drink
System.out.println("You have selected Cold Drink");
System.out.println();
System.out.println("Enter the desired Quantity : ");
quantity = sc.nextInt();
total = total + quantity * ColdDrink;
break;
case 7:
// for Iced Tea
System.out.println("You have selected Iced Tea");
System.out.println();
System.out.println("Enter the desired Quantity : ");
quantity = sc.nextInt();
total = total + quantity * IcedTea;
break;
case 8:
System.out.println("You canceled the service!!");
System.exit(1);
default:
System.out.println("Invalid Choice!!");
System.exit(1);
//break;
// If user wants to make another order.
System.out.println();
System.out.println("Do you wish to Order anything else??(Yes/No) : ");
again = sc.next();
13
if (again.equalsIgnoreCase("YES")) {
order();
} else if (again.equalsIgnoreCase("No"))
{ generateBill();
feedback();
} else {
System.out.println("Invalid
Choice"); }
// Take Customer feedback
public void feedback() {
System.out.println("Would you like to give us feedback? (YES OR NO?)");
String feedb = sc.next();
if (feedb.equalsIgnoreCase("YES")) {
System.out.println("Please enter your feedback!!");
sc.next();
System.out.println("Thank you for your FeedBack !! ");
} else if (feedb.equalsIgnoreCase("No")) {
System.out.println("VISIT AGAIN!!");
} else {
System.out.println("Invalid Choice!!");
System.exit(1);
}
}
public static void main(String[] args) {
FoodOrder foodOrder = new FoodOrder();
foodOrder.order();
}
}
14
OUTPUT
There are the following output of Food Ordering and Billing System:
15
FACILITIES REQUIRED FOR PROPOSED WORK
Software Requirements:
• Java Development Kit (JDK) is a software that is used in development and execution
of java programs or applications. If JDK is not already installed in your system
then download and install it (JDK as per your OS) first.
• An editor like notepad, notepad++, TextPad, etc. is required for windows
operating system. The notepad editor comes by default with windows operating
system. The programmer can choose the editor of their choice.
• Any terminal like cmd, shell etc. to compile and run java program. By default CMD
is available in windows OS while shell is available in linux based OS.
Hardware Requirements:
• The hardware requirement actually depends on the version of java you want to use:
Like RAM space, Disk Space, Processor etc.
16
SOCIAL RELEVANCE
In a Java-based Command Line Interface (CLI) food ordering system, social relevance refers to
features that enhance user interaction and connectivity. This could include sharing order details
with friends, recommending dishes, or integrating social media functionalities to make the food
ordering experience more engaging and collaborative.
17
FUTURE SCOPE
A Java-based CLI (Command Line Interface) for a food ordering system could have a
promising future, offering simplicity and efficiency. It might evolve to include more features,
better user interfaces, and potentially integrate with other platforms or technologies as the
demand for convenient and streamlined food ordering solutions continues to grow.
18
CONCLUSION
The project training taken by me at " UNITED COLLEGE OF ENGINEERING AND
RESEARCH" helped me in not only gaining practical experience but also to adapt the
organizational environments and procedures.
It is said that no system is perfect, every system has some limitations and flaws. Taking
this into consideration, the project "FOOD ORDERING AND BILLING SYSTEM "
has been carried out successfully.
Thus I confidently conclude that this was not only beneficial in its technical and
educational aspect but also wins equality in building up my personality.
19
BIBLIOGRAPHY
For successfully completing this project,we have taken reference from the following:
•
https://www.youtube.com •
https://www.google.com
• https://www.geeksforgeeks.org
20