You are on page 1of 98

PROJECT REPORT

ON
FOOD ORDERING
SYSTEM
IN
C++ PROGRAMMING
LANGUAGE

1
FOOD ORDERING
SYSTEM

Made By:-
NAME:- SAKSHI RAWAT
COURSE:- A LEVEL
Registration No. :- 1208911

2
ACKNOWLEDGEME
NT
It is a pleasure to acknowledge many people who knowingly and
unwittingly helped me , to complete my project.

I am particularly indebted to DOEACC A LEVEL, which groomed me up


in the field of Software Technology to take on challenges of the
competitive world and compete them with utmost success.

I would like to express my special thanks of gratitude to my teachers


Ms. Aparna and Ms. Sangeeta of my institute who have gave me this
golden opportunity to do this wonderful project on Food Ordering
System and providing me the knowledge and guidance during the
completion of my project. This project also helped me know about
many new concepts which increased my knowledge a lot.

I extend my sincere gratitude towards all the faculty members, teachers


and my parents, their guidance encouraged me and made a
unforgettable contribution for the successful completion of my project.

DATE:- NAME:- SAKSHI RAWAT

3
COURSE:- A LEVEL
Registration No. :- 1208911

CERTIFICATE
This is to certify that the project by SAKSHI RAWAT,
Registration No.- 1208911, at MBIT COMPUTRAINING PRIVATE
LIMITED, JANAKPURI, NEW DELHI – 110058 in partial
fulfillment of the ‘A’ Level examination, has been found
satisfactory. This project report has not been submitted for any
other examination and does not form part of any other course
undergone by the candidate.

4
TABLE OF
CONTENTS
Table of Content

s
1: Introduction About C and C++...............................................................................................................8
1.1 Foundation Of C++: The C Subset....................................................................................................8
1.2 About C++........................................................................................................................................9
1.3 STRUCTURE OF C AND C++ L ANGUAGE ................................................................................................9
1. Header Files Inclusion:................................................................................................................9
2. Main Method Declaration:........................................................................................................10
3. Variable Declaration.................................................................................................................11
4. Body:.........................................................................................................................................12
5. Return Statement....................................................................................................................13
1.4 Data Types.....................................................................................................................................13
I. Basic or Primitive Data Type.....................................................................................................13
II. User Defined Data Type-......................................................................................................14
III. Derived Data Type.................................................................................................................14
1.5 Correct way of inputting data in C and C++..................................................................................15
1.6 Operators used in C and C++ Language........................................................................................16
1. Airthematic Operator...............................................................................................................16
2. Relational Operator..................................................................................................................17
3. Logical Operator-......................................................................................................................17
4. Assignment Operator................................................................................................................18
5. Increment Or Decrement Operator...........................................................................................19

5
6. Conditional Operator................................................................................................................19
7. Bitwise Operator.......................................................................................................................20
8. Special Operator........................................................................................................................21
1.7 C++ Basics Input / Output..............................................................................................................22
1.8 Uses of C++....................................................................................................................................23
2: Objective And Scope Of Project...........................................................................................................26
2.1 Introduction About Project...........................................................................................................26
2.2 Key Features Of The Project..........................................................................................................27
2.3 Major Objective Of The Project....................................................................................................27
2.4 Review Of The Present System.....................................................................................................28
2.5 Advantages....................................................................................................................................29
3: SYSTEM STUDY AND ANALYSIS.............................................................................................................31
3.1 Feasibility Study............................................................................................................................31
3.1.1 Economic Feasibility Study.....................................................................................................31
3.1.2 Technical Feasibility Study.....................................................................................................32
3.1.3 Operational Feasibility Study.................................................................................................33
3.1.4 Scheduling Feasibility Study...................................................................................................34
3.2 Analysis Methodology...................................................................................................................35
3.2.1 Interviews...............................................................................................................................35
3.2.2 Group Communication...........................................................................................................36
3.2.3 Questionnaires.......................................................................................................................36
3.2.4 Presentation...........................................................................................................................37
4: SYSTEM DESIGN, TESTING AND IMPLEMENTATION.............................................................................38
4.1 System Design...............................................................................................................................38
4.1.1 Design Methodology.............................................................................................................38
4.1.2 Report Design........................................................................................................................39
4.1.3 Data Flow Diagram (DFDs).....................................................................................................41
4.1.4 Components Of Data Flow Diagram (DFDs)...........................................................................41
4.1.5 DFD Levels And Its Application In (Food Ordering System) Project......................................42
4.1.5 ER- Diagram............................................................................................................................44
4.1.6 Components Of ER- Diagram.................................................................................................45
4.1.7 Attributes Of ER- Diagram(Food Ordering System)...............................................................46
4.1.8 ER- Diagram (“Food Ordering System”).................................................................................48

6
4.2 Test Design And Implementation.................................................................................................49
4.2.1 Importance of Software Testing.............................................................................................49
4.2.2 Types Software Testing..........................................................................................................50
4.2.3 Software Testing (Food Ordering System).............................................................................52
5: CONCLUSION, CODE AND OUTPUT.......................................................................................................56
5.1 Conclusion (Food Ordering System)..............................................................................................56
5.3 Scope Of Modification (Food Ordering System)...........................................................................56
5.4 System Requirements (Food Ordering System)............................................................................57
5.5 Bibliography..................................................................................................................................57
5.6 Code (Food Ordering System).......................................................................................................58
5.7 Output (Food Ordering System)....................................................................................................86

7
1: Introduction About C and
C++
1.1 Foundation Of C++: The C
Subset
7

The origin of C is closely tied to the development of


the UNIX operating system, originally implemented in assembly
language on a PDP-7 by Dennis Ritchie and Ken Thompson,
incorporating several ideas from colleagues. Eventually, they
decided to port the operating system to a PDP-11. The original
PDP-11 version of UNIX was developed in assembly language.
Thompson needed a programming language to make utilities.
In 1972, Ritchie started to improve B, which resulted in creating a
new language C.[11] The C compiler and some utilities made with
it were included in Version 2 UNIX.[12] At Version 4
UNIX released at Nov. 1973, the UNIX kernel was extensively re-
implemented by C.[10] By this time, the C language had acquired
some powerful features such as  struct  types.
. In around 1977, Ritchie and Stephen C. Johnson made further
changes to the language to facilitate portability of the UNIX
operating system. Johnson's Portable C Compiler served as the
basis for several implementations of C on new platforms.

8
C is a procedural programming language. It was initially
developed by Dennis Ritchie between 1969 and 1973. It was
mainly developed as a system programming language to write
operating system. The main features of C language include low-
level access to memory, simple set of keywords, and clean style,
these features make C language suitable for system programming
like operating system or compiler development.
Many later languages have borrowed syntax/features directly or
indirectly from C language. Like syntax of Java, PHP, JavaScript
and many other languages is mainly based on C language. C++ is
nearly a superset of C language (There are few programs that may
compile in C, but not in C++).

1.2 About C++


C++ is a general-purpose programming language created
by Bjarne Stroustrup as an extension of the C programming
language, or "C with Classes". The language has expanded
significantly over time, and modern C++ now has object-
oriented, generic, and functional features in addition to facilities
for low-level memory manipulation. It is almost always
implemented as a compiled language, and many vendors
provide C++ compilers, including the Free Software
Foundation, LLVM, Microsoft, Intel, Oracle, and IBM, so it is
available on many platforms.
C++ was designed with an orientation toward system
programming and embedded, resource-constrained software and
large systems, with performance, efficiency, and flexibility of use
as its design highlights.
C++ was developed by Danish computer scientist Bjarne
Stroustrup at Bell Labs since 1979 as an extension of the C
language; he wanted an efficient and flexible language similar to
9
C that also provided high-level features for program
organization.

1.3 STRUCTURE OF C AND C++ LANGUAGE


1. Header Files Inclusion: The first and foremost component is
the inclusion of the Header files in a C and C++ program.
A header file is a file with extension .h which contains C and
C++ function declarations and macro definitions to be shared
between several source files.
Some of C and C++ Header files:
 stddef.h – Defines several useful types and macros.
 stdint.h – Defines exact width integer types.
 stdio.h – Defines core input and output functions
 stdlib.h – Defines numeric conversion functions, pseudo-
random network generator, memory allocation
 string.h – Defines string handling functions
 math.h – Defines common mathematical functions
 iostream.h - It is used as a stream of Input and Output
using cin and cout.
 fstream.h - It is used to control the data to read from a
file as an input and data to write into the file as an
output.
 time.h - It is used to perform functions related to date()
and time() like setdate() and getdate(). It is also used to
modify the system date and get the CPU time
respectively.
 graphics.h – It is used to access graphics from the file

Syntax to include a header file in C and C++:

#include < (header_file_name).h>

10
2. Main Method Declaration: The next part of a C and C++
program is to declare the main() function. The syntax to
declare the main function is:
Syntax to Declare main method:

int main()
{}
3. Variable Declaration: The next part of any C and C++ program
is the variable declaration. It refers to the variables that are
to be used in the function. A variable is a name given to a
memory location. It is the basic unit of storage in a program .
Please note that in C and C++ program, no variable can be
used without being declared..
Example:
int main()
{
int a;
.
.

Rules For Declaring Variable


 They must begin with a character without spaces but
underscore ( _ ) is permitted.
 The variable name should not start with a digit.
 No other special characters such as +,-,*,$,etc are not
allowed while giving a name to a variable.
 Variable name is case sensitive.
 The variable should not be a c key word.
 A variable name cannot be a keyword. For example, int is a
keyword that is used to denote integers.

Types of variables
11
CHARACTERSETS - The characters used to form words ,numbers
&expressions depend upon the computer on which the
programs run. The character in ‘C’ and ‘C++’ are classified in
the following categories :-
(a) Letters (A-Z)
(b) Digits (0-9)
(c) White spaces (blank space, newline, etc.)
(d) Special characters (+,-,*,<, >,etc.)

KEYWORDS – The words that have predefined meaning for ‘C’


and ‘C++’ compiler are called keywords. They are reserved
for specific purpose in C and C++ language . They are also
called reserved words. All keywords should be written in
lowercase letters. Some keywords are :-

auto break double int struct


long switch Case cnum register
extern return union float short
for void default goto sizeof
static while signed const if
typedof undersigned Do else char
continue volatile

CONSTANTS- The constant in ‘C’ and ‘C++’ are applicable to


the values which do not change during the execution of the
program. These are:-
(A) INTEGER CONSTANT – 120, -120,14,etc.
(b) FLOATING PRINT CONSTANT –
2.7,38.82,etc.
(c) CHARACTER CONSTANT –‘a’,’9’,etc.

12
(d) STRING CONSTANT – Collection of
characters.(ex:- Neha)
4. Body: Body of a function in C and C++ program, refers to
the operations that are performed in the functions. It can be
anything like manipulations, searching, sorting, printing,
etc.
5. Return Statement: The last part in any C and C++ program
is the return statement. The return statement refers to the
returning of the values from a function. This return
statement and return value depend upon the return-type of
the function. For example, if the return type is void, then
there will be no return statement. In any other case, there
will be a return statement and the return value will be of the
type of the specified return-type.
1.4 Data Types
All ‘C’ and ‘C++’ compilers supports a variety of data types.
This enables the programmer to select appropriate data type as
per the need of the application. The various types of data are
integer, character, string, etc. The type of the value that a
variable can store in the memory is called the data type.
Examples :- int, char, float, etc.
There are three types of data type :-
I. Basic or Primitive Data Type –Basic data types are those that
are not composed of other data types. The primitive data
types are also called Basic Data Types / Simple Data Types /
Fundamental Data Types.
The various basic data types of C and C++ language are :-
 Int - It is a keyword that is used to define integer number.
Normally they are associated with a variable to store sign
(+) integer value in memory location.

13
 Float- It is a keyword which is used to define floating point
number. The floating point number is also called real
number.
 Double- It is a keyword which is used to define high
decision floating point number. Normally they are
associated with the variable to store large floating point
number in memory location.
 Char- It is used to define a single character or sequence of
character called ”string”.
 Void- It is an empty data type. It is normally used in
functions to indicate that the function does not written any
value. It does not occupy any space in the memory.
 Bool- The bool data type has one of the two possible values:
true or false. Booleans are used in conditional statements
and loops.
II. User Defined Data Type- A user-defined data type (UDT) is
a data type that derived from an existing data type. You can
use UDTs to extend the built-in types already available and
create your own customized data types.
 Structure -Structure is a user-defined datatype in C and
C++ language which allows us to combine data of
different types together. Structure helps to construct a
complex data type which is more meaningful. It is
somewhat similar to an Array, but an array holds data
of similar type only. But structure on the other hand,
can store data of any type, which is practical more
useful.
 Union-A union is a special data type available in C
and C++ that allows to store different data types in the
same memory location. You can define a union with
many members, but only one member can contain a
value at any given time. Unions provide an efficient

14
way of using the same memory location for multiple-
purpose.

III. Derived Data Type- Data types that are derived from
fundamental data types are called derived data types.
Derived data types don't create a new data type but, instead
they add some functionality to the basic data types.
 Array-An array is a collection of one or more values of
the same type. Each value is called an element of
the array. The elements of the array share the same
variable name but each element has its own unique index
number (also known as a subscript). Anarray can be of
any type, For example: int , float , char etc.
 Function-In C and C++, we can divide a large program
into the basic building blocks known as function. The
function contains the set of programming statements
enclosed by { }. A function can be called multiple times to
provide reusability and modularity to the C and C++
program. In other words, we can say that the collection of
functions creates a program. The function is also known
as procedure or subroutine in other programming
languages.
 Pointer-Pointers in C and C++ language is a variable
that stores/points the address of another variable. A
Pointer in C and C++ is used to allocate memory
dynamically i.e. at run time. The pointer variable might
be belonging to any of the data type such as int, float,
char, double, short etc.

Pointer Syntax : data_type *var_name; Example : int *p;  char *p;


Where, * is used to denote that “p” is pointer variable and not a
normal variable.

15
1.5 Correct way of inputting data in C and
C++
Do’s
 num1,num2
 rollno.
 roll_no.

Don’ts
 1 num,2 num
 Roll no.

1.6 Operators used in C and C++ Language


An operator is a symbol that specifies the operation or activity
to be performed. Operators helps the user to command the
computer to do a certain mathematical or logical manipulations.
Operators are used in ‘C’ and ‘C++’ language to operate on data
and variables.
‘C++’ has a rich set of operators, which can be classified as :-

1. Airthematic Operator

C and C++ supports all the basic arithmetic operators.


The following table shows all the basic arithmetic
operators.

Operator Description

16
+ Add two operands
- Subtract second operand from first
* Multiply two operands
/ Divides two operands
% Remainder of division

2. Relational Operator

The following table shows all relation operators


supported by C and C++.

Operator Description
== Check if two operands are equal
!= Check if two operands are not equal
<= Check if operand on the left is smaller than equal to
operand on the right
>= Check if operand on the left is greater than equal to
operand on the right
< Check if operand on the left is smaller than operand
on the right
> Check if operand on the left is greater from the
operand on the right

17
3. Logical Operator-

C and C++ language supports following 3 logical


operators. Suppose a = 1 and b = 0,

Operator Description Example

&& Logical AND (a && b) is false


II Logical OR (a II b) is true
! Logical NOT (!a) is false

4. Assignment Operator

Assignment operators supported by C and C++ language


are as follows:-

Operato Description Example


r

= Assigns values from right side a=b


operands to left side operand

+= Adds right operand to the left a+=b is same


operand and assign the result to left as a=a+b

-= Subtracts right operand from the a-=b is same


left operand and assign the result to as a=a-b
left operand

18
*= Multiply left operand with the right a*=b is same
operand and assign the result to left as a=a*b
operand

/= Divides left operand with the right a/=b is same


operand and assign the result to left as a=a/b
operand

%= Calculate modulus using two a%=b is same


operands and assign the result to as a=a%b
left operand

5. Increment Or Decrement Operator

These operators are very compact and powerful operators


available in ‘C’ and ‘C++’ language. These operators are
unary operators and have only one operant.

a) Increment Operator- ‘++’ is an increment operator.


This is an unary operator. It increments the value of
operand by 1. The increment operator is classified
into two categories :-

Types Operators Example

Post -Increment ++ A++


Pre- Increment ++ ++A

19
b) Decrement Operator- ‘--’ is a decrement operator.
This is an unary operator. It decrements the value of
operand by 1. The decrement operator is classified
into two categories :-

Types Operators Example

Post -Decrement -- A--


Pre- Decrement -- --A

6. Conditional Operator

It is also called Ternary Operator as the name indicates,


an operator that operates on 3 operands is called ternary
operator. The ternary operator is (?:).
The syntax is :-
exp1?exp2:exp3;

Explanation:

 The question mark "?" in the syntax represents the ifpart.


 The first expression (expression 1) generally returns either
true or false, based on which it is decided whether
(expression 2) will be executed or (expression 3)
 If (expression 1) returns true then the expression on the left
side of " : " i.e (expression 2) is executed.
 If (expression 1) returns false then the expression on the right
side of " : " i.e (expression 3) is executed.

Example :-
max=(a>b)?a:b;
20
When a>b, than the value of ‘a’ is assigned to ‘max’.
Otherwise the value of ‘b’ is assigned to ‘max’ .

7. Bitwise Operator

Bitwise operators perform manipulations of data at bit


level. These operators also perform shifting of bits from
right to left. Bitwise operators are not applied
to float or double(These are datatypes, we will learn
about them in the next tutorial).

Operator Description
& Bitwise AND

I Bitwise OR

^ Bitwise Exclusive OR

<< Left Shift

>> Right Shift

Now let’s see truth table for bitwise &, | and ^.

a b a&b aIb a^b


0 0 0 0 0
0 1 0 1 1
1 0 0 1 1
1 1 1 1 0

21
The bitwise shift operator, shifts the bit value. The left operand
specifies the value to be shifted and the right operand specifies
the number of positions that the bits in the value have to be
shifted. Both operands have the same precedence.

8. Special Operator

Some special operators are:-


Operator Description Example

Sizeof Returns the size of Sizeof(x) return size


the variable. of the variable.
& Returns the address &x; return address
of the variable. of the variable x.
* Pointer to a *x; will be pointer
variable. to a variable x.

1.7 C++ Basics Input / Output


 Cin object to take input from the user, and the cout object to display output .

C++ Output
In C++,cout sends formatted output to standard output devices,
such as the screen. We use the cout object along with the
<< operator for displaying output. We first include the
iostream header file that allows us to display output. cout is an
object that prints the string inside quotation marks “ “ . It is
followed by the << operator.

cout << "character: " << ch << endl;


22
C++ Input
In C++, cin takes formatted input from standard input devices
such as the keyboard. We use the cin object along with the
>> operator for taking input. In the program, we use the >>
operator with cin to take input.

cin >> num;

1.8 Uses of C++


There are several benefits of using C++ for developing applications and
many applications product based developed in this language only
because of its features and security. Please find the below sections, where
uses of C++ has been widely and effectively used.
Below is the list of the top 10 uses of C++.
 Applications: It is used for the development of new applications
of C++. The applications based on the graphic user interface, which
are highly used applications like adobe photoshop and others.
Many applications of Adobe systems are developed in C++ like
Illustrator, adobe premiere and image ready and Adobe developers
are considered as active in the C++ community.
 Games: This language is also used for developing games. It
overrides the complexity of 3D games. It helps in optimizing the
resources. It supports the multiplayer option with networking.
uses of C++ allows procedural programming for intensive
functions of CPU and to provide control over hardware, and this
language is very fast because of which it is widely used in
developing different games or in gaming engines. C++ mainly
used in developing the suites of a game tool.
 Animation: There is animated software, which is developed with
the help of the C++ language. 3D animation, modeling,

23
simulation, rendering software are referred to as the powerful
toolset. It is widely used in building real-time, image processing,
mobile sensor applications, and visual effects, modeling which is
mainly coded in C++. This developed software used for animation,
environments, motion graphics, virtual reality, and character
creation. Virtual real devices are the most popular in today’s
entertainment world.
 Web Browser: This language is used for developing browsers as
well. C++ is used for making Google Chrome, and Mozilla Internet
browser Firefox. Some of the applications are written in C++, from
which Chrome browser is one of them and others are like a file
system, the map reduces large cluster data processing. Mozilla has
other application also written in C++ that is email client Mozilla
Thunderbird. C++ is also a rendering engine for the open-source
projects of Google and Mozilla.
 Database Access: This language is also used for developing
database software or open-source database software. The example
for this is MySQL, which is one of the most popular database
management software and widely used in organizations or among
the developers. It helps in saving time, money, business systems,
and packaged software. There are other database software access-
based applications used that are Wikipedia, Yahoo, youtube, etc.
The other example is Bloomberg RDBMS, which helps in
providing real-time financial information to investors. It is mainly
written in C++, which makes database access fast and quick or
accurate to deliver information regarding business and finance,
news around the world.
 Media Access: C++ is also used for creating a media player,
managing video files and audio files. The example is Winamp
Media player, which is developed in C++ language, which allows
us to enjoy music, access and share the videos and music files. It
also has features like art support, streaming of audio and video. It
also provides access to Internet radio stations.

24
 Compilers: Most of the compilers mainly written in C++
language only. The compilers that are used for compiling other
languages like C#, Java, etc. mainly written in C++ only. It is also
used in developing these languages as well as C++ is platform-
independent and able to create a variety of software.
 Operating Systems: It is also used for developing most of the
operating systems for Microsoft and few parts of the Apple
operating system. Microsoft Windows 95, 98, 2000, XP, office,
Internet Explorer and visual studio, Symbian mobile operating
systems are mainly written in C++ language only.
 Scanning: The applications like film scanner or camera scanner
are also developed in the C++ language. It has been used for
developing PDF technology for print documentation, exchanging
documents, archiving the document and publish the documents as
well.
 Other Uses: It is used for medical and engineering applications,
Computer-aided design systems. These applications are like MRI
scans machines, CAM systems that are mainly used in hospitals,
local, state and national government, and other departments for
construction and mining, etc. applications of C++ is considered as
a first preferred language to use among the developer when
performance is considered for any developing application

25
2: Objective And Scope Of
Project
2.1 Introduction About Project
This project is about Food Ordering System. The objective of this
project is to provide some kind of automation to the food
management staff and make them work efficiently by
maintaining the records in the system. Automated system is an
attraction for potential customers. Adopting these types of
system shows the attitude of the management that they are
aware to the newly introduced technology and is ready to this
technology to maintain the efficiency of their business.
Now a day’s computer has changed the whole world .it has made
contribution to every field of our lives .many new applications
are made available to the users for connecting with ach other,
ordering the things they want in just one click by sitting in their
houses. The world is now accepted the change of digitization and
26
the countries which are developing have started adopting this
change. Instead of using paper money we are now a days using
digital methods for making payment.
Now coming to the project this project “Food Ordering System”
is a small project which will help the business adopting it to
maintain the order details and customer information easily and
efficiently.
This project has been developed in C++ programming language.
In this world where many new computing languages have been
introduced C++ is still a choice of many businesses. This
programming language serves very effective and efficient way to
develop the interface of the project. All coding of this project is
being done in C++ programming language. Turbo C++ or any
other compiler supporting C++ can be used to run these codes.
Brief details of every process are being provided in this report in
the upcoming pages which will make the program in an
understandable form to the business and its users.

2.2 Key Features Of The Project


Key features of the project are:-
1.)Add Customer Information – It will let the user to add
customer information.
2.)Delete Customer Information – It will help the user to delete
the customer.
3.)View Customer Information – It will help the user to see the
added customer.
4.)Add Order Details – It will help the user to add the order
made by customer.
27
5.)View Order Details – It will help the user to view the added
order details.
6.)Delete Order Details – It will help the user to delete the added
order.
7.)Exit – It will help the user to exit the application.

2.3 Major Objective Of The Project


1) Any user can add the customer in the system by allotting
them the customer id.
2) When user want to delete a customer ,they can just type the
customer id and delete the customer.
3) User can view the customer details by entering the customer
id.
4) User can add the order placed by the customer by providing
the order id and can also view the order by typing order id
and can also delete the fulfilled orders.
5) One can easily modify the order details.
6) Customer can purchase order by a company.
7) Admin can easily view all the customers and the order
details purchased by them at once.
8) The main concern of this project is to improve the efficiency
and effectiveness of the whole system.

2.4 Review Of The Present System


It is very important to understand the working of the present
system which would be used by the company. Once the program
is started being used by the organization. The structure of the
organization can tell us about the deficiencies of the program
which will be a good way to improve the efficiency, effectiveness

28
and ease of the program, so that the improved program can help
the business to grow tremendously and easily. Apart from this it
also helps the programmer to learn the expectations the user is
having from the new system and to introduce the necessary
changes for the smooth working of the business and the system.
In Food Ordering organization one always has to record the
information such as adding details of new ordering, storing
details of ordering , searching for records, etc. on paper. It is very
time consuming as well as require a lot of paper work.
Study of the existing system would require studying of
documents, reports and available manuals. This would help the
programmer to make the new system as per the company’s
requirement. Distribution of questionnaire would also be
beneficial and make the requirements much clear to the
programmer. Based on the all information collected by
conducting various methods by the staff and the users it would
become easy for the programmer to analyze the requirements and
make the program much easy to use.

2.5 Advantages
Advantages of using a computerized system:-
1) Time Saving – It is much easier to find a record by running a
search in the computer rather than going through tons of
data. This helps the user to save a lot of time and help them
to concentrate on more important work rather than
searching for a particular record by wasting time. The
computerized program will make the work of the user much
faster.

29
2) Data Integrity – It integrates all the information of customer
at one place very effectively efficiently. After using a
computerized system there is no need to go through that
tons of paper of records. Just by entering our search we can
easily access a record.
3) Easy To Use – Computerized system is always very easy to
use. It can help the user to just enter the record without
making any mistakes, if a mistake has been made by the
user the system will pop up the error or warning message
and cancel the mistake and let the user to enter the correct
record from the place where the mistake was made. No need
to make a record from the starting again and again as one
was doing while making manual paper records.
4) Reduce Paper Work – It eliminates the use of paper and save
the user from wasting their time from surfing from a tons of
paper records.
5) Easy Maintenance – Computerized system is easy to
maintain. It saves the user from tons of paper work and help
the user to easily modify, delete and add the user as well as
order information.
6) Cost Effective – It makes the working cost effective as it
reduces the cost of paper, pen, ink and other stationary
items used to maintain the records.
7) Easy Access To All Records – The user can easily access the
records by running a search related to what one has to find
in the system and help them to access, modify and delete
records very easily.

30
3: SYSTEM STUDY AND ANALYSIS

3.1 Feasibility Study


A feasibility study is a preliminary assessment that assists
management in determining if a system is viable for development
or not.
 It recognizes the possibilities of enhancing an existing
system, creating a new system, and producing revised
estimations for ongoing system development.
 It is used to sketch out the problem and determine whether a
practical or acceptable solution exists.
 The primary goal of a feasibility study is to affirm the scale
of the problem rather than solving it.
 A feasibility study produces a formal system proposal,
which serves as a decision document and describes the
whole nature and scope of the proposed system.

31
 For any project at the conceptual level itself the detailed
feasibility of the project as a whole is studied in a
comprehensive manner.
There are mainly three types of feasibility studies that should be
carried out to check the detailed feasibility of the project:-
1.) Economic Feasibility Study
2.) Technical Feasibility Study
3.) Operational Feasibility Study
4.) Scheduling Feasibility Study
In this project feasibility has been carried out on “Food Ordering
System” in which we can know about scope of the project by each
feasibility test.
3.1.1 Economic Feasibility Study
Economic feasibility determines if the necessary software has the
ability to provide financial rewards for a company.
This sort of research includes the cost of the software
development team, the cost of the study involved in completing a
feasibility study, and the expected cost of software and hardware
Software is said to be economically feasible if it focuses on
pointers given below:-
 The expense of training, development team, software, and
hardware.
 The cost of undertaking software research activities such as
requirements analysis and requirements elicitation.
 The cost of developing software to provide long-term
benefits for a company.
 It is also studied if the program can be produced within the
financial constraints.
 It assesses the efficacy of a potential system using the
cost/benefit analysis approach.
 It displays the net advantage of the candidate system in
terms of organizational benefits and expenses.

32
 The primary goal of the Economic Feasibility Study is to
evaluate the economic needs of a candidate system before
committing investment capital to a project.
The agency doesn’t need to purchase new computers. They only
have to made initial investment for on the software such as,
purchasing the software, training their employees to use the
software. Once the initial investment is made soon in the future
it would nullify the initial cost and would lead the organization
towards high profit.
3.1.2 Technical Feasibility Study
Technical feasibility assesses the current resources such as
hardware and software and technology, which are required to
accomplish organization requirement in the software within the
allocated time and budget. These things are ascertained by the
software development team by checking whether the current
resources and technology needs to be upgraded or added in the
software to accomplish specified user requirements.
Technical feasibility focuses on following pointers:-
 It analyses the technical skills and capabilities of the
members of software development team.

 It studies and assesses whether or not the solution is


supported by existing technology.
 The analyst assesses if existing technological resources
should be updated or new ones introduced to meet the new
needs.
 It assures that the candidate system responds appropriately
to the extent to which it can support the technological
upgrade.

33
3.1.3 Operational Feasibility Study
The behavioral feasibility is analyzed to determine whether or
not the people or workers in the firm will utilize it.

Operational feasibility is based on human resources and


determines whether or not the program will work after it has
been properly created.

The operational feasibility performs the following tasks:

 The operational feasibility aids in deciding whether or not


the solution proposed by the software development team is
acceptable.
 Operational feasibility also aids in establishing if the issues
foreseen in the user requirements are a high priority.
 It determines whether the program is user-friendly or not
 It assesses if the system is functional once it has been built
and installed.
 It assures that management will support the proposed
system and will operate in the modern organizational
setting.
 It assesses whether users will be impacted and if they will
accept changed or new business processes that influence the
potential system advantages.
 It also assures that the candidate system’s computing
resources and network architecture are operational.
3.1.4 Scheduling Feasibility Study
It is the most significant research for determining the project’s
success. If the projects are not finished by the deadline, they will
all fail.

34
An organization can estimate the time necessary to complete a
project through scheduling feasibility.

The time required for the creation of the system is calculated


based on the requirements.

When all of these components are in order, manpower is assigned


to their respective jobs, and every effort is made to complete the
assignment before the deadline

The scheduling feasibility performs the following tasks:

 It guarantees that the project is finished within the time


frame or schedule specified.
 It also evaluates and confirms whether or not the project’s
deadlines are feasible.

3.2 Analysis Methodology


Analysis is the detailed study of the various operations
performed by the system and their relationship within and
outside the system.
Analysis methodology is an art, science, approach and a manner
in which information is gathered. It requires a person to have
knowledge of what information to gather, when to gather it and
what channels should be used to gather this information and how
to secure this information.
Various tools used for gathering information are as follows:-
3.2.1 Interviews
Interviews are the fact-finding technique where the system
analyst (interviewer) collects information from individuals
(interviewees). The respondents (interviewees) are generally
current users of the existing system or potential users of the
35
proposed system. The respondents may be managers or employees
who provide the data for the proposed system or those who will
be affected by it.
Types of interviews:-
 Unstructured – In unstructured interview the interviewer
can ask the question which may not be directly related to
the objectives. Unstructured interviews are conducted with
only a general goal or subject in mind.
 Structured – In this interview, the interviewer has a specific
set of questions to ask from the interviewee. All these
questions are prepared in advance and the answers are
noted.

3.2.2 Group Communication


When information is required from face- to-face sessions, but
there is not enough time to conduct personal interviews, group
interviews or meetings can be held. Since there are many persons
present, more types of ideas can be discussed in a short time. Also
the comments of one person may prompt other persons to
contribute the facts which they may have.

3.2.3 Questionnaires
Questionnaires are special purpose documents that allow the
analyst to collect information and opinions from respondents.
This is more structured and formal way of collecting data but
may be the only workable option where there are a large number
of users involved. Information is gathered by requesting users to
fill in a pre- designed form called questionnaire. Questionnaires
are made up of question about information sought by the analyst.

36
The question is then send to the user and replies are analyzed by
the analyst.
Types of questionnaires:-
 Structured – In this type of questionnaire respondent has to
select from possible options and the range of answers is
limited. These questionnaires can have multiple choice,
selection on ranking scale, selection of rating, fill in the
blanks , etc.
 Unstructured – In this type of questionnaire, respondents
opinions are asked. Here respondents can answer freely by
filling up the information on their own in blank spaces
rather than choosing from the options.

3.2.4 Presentation
Presentation is the activity of communicating findings,
recommendations and the documentation for review by interested
users and managers. Presentation may be either verbal or
written. Here, an analyst may use study of existing records and
questionnaires, etc. to put together a presentation.

37
4: SYSTEM DESIGN, TESTING AND
IMPLEMENTATION
4.1 System Design
Systems design is the process of defining the architecture, product
design, modules, interfaces, and data for a system to satisfy
specified requirements. Systems design could be seen as the application
of systems theory to product development.
 Logical design - The logical design of a system pertains to an
abstract representation of the data flows, inputs and outputs of the
system. This is often conducted via modelling, using an over-
abstract (and sometimes graphical) model of the actual system. In
the context of systems, designs are included. Logical design
includes entity-relationship diagrams (ER diagrams).
 Physical design - The physical design relates to the actual input
and output processes of the system. This is explained in terms of
how data is input into a system, how it is verified/authenticated,
38
how it is processed, and how it is displayed. In physical design, the
following requirements about the system are decided.
 Input requirement.
 Output requirements.
 Storage requirements.
 Processing requirements.
 System control and backup or recovery.

4.1.1 Design Methodology


The project is designed in C++ programming language. It is a superset of C
programming language. It is regarded as the middle level language as its
subset is made up of the combination of both high level and low level
language features.
C++ is widely used in software industry. We can develop system software,
application software, device drivers, embedded software, high performance
server and client applications and entertainment software such as video
games, etc.
Design methodology is employed in many industries, it is commonly
applied in technology fields, including those using the internet, software
and information systems development. Several design methodology
approaches have developed in the technology industry. Each was a
reaction to a different type of problem.
Some common technology design methodologies include:
1) Top Down Design or Stepwise Refinement: This starts from the end
solution and works backwards, refining each step along the way.
2) Bottom Up Design: This methodology starts with a foundation and
works up towards a solution.
3) Structured Design: This is an industry standard. The technique
starts by identifying inputs and desired outputs to create a graphical
representation.
4) Structured Analysis and Design Technique: This approach utilizes
a diagram to describe the hierarchy of a system's functions.
5) Data Structured Systems Development: Data structure determines
the system structure in this methodology.

39
6) Object Oriented Design: This methodology is based on a system of
interacting objects.

4.1.2 Report Design


A report is a document that presents information in an organized format
for a specific audience and purpose. Although summaries of reports may be
delivered orally, complete reports are almost always in the form of written
documents. Every kind of business and government computer system
produces some kind of report.
Report should follow following pointers:-
 The information should be clear and accurate yet concise, and
restricted to relevant data.
 Reports should have title, date, descriptive headings for columns of
data.
 Pages should be numbered properly.
 Reports should be in a logical arrangement so that user can easily
locate what they need.
 Report should be in an understandable format.

There are two types of reports:-


I. Internal Report – Managers and other decision makers within an
organization use internal reports to track performance and to make a
variety of judgements for the growth of business.
II. External Report - External repots are the reports which are used by
people external of the organization. These people are customer,
clients, vendors, government agencies and others outside of an
organization. The report should be in an understandable format,
should be clear and accurate.

Report format:-
 Report Heading – A report heading states the title of the report itself.
It appears at the beginning of the report.

40
 Page Heading – After report heading comes Page heading. It indicates
page number, date and time of the day on which the report was
printed.
 Control Heading – These are captions and title that separates one
group of data from another.
 Column Heading – These are the headings which appear on the top of a
column and identify the data under the heading in a clearer way.
 Detail Line - Details line display the detail of the report. If the report
will circulate outside the organization someone will probably edit
the data present in detail line to make it look more attractive and
understandable.
 Page Footing – Page Footing appears at the bottom of every page. It
may have page numbers ,name of the organization etc.
 Report Footing – It occurs at the end of the report. It may list totals of
the report or some message to the user that this is the end of the
report.

4.1.3 Data Flow Diagram (DFDs)


DFD stands for ”Data Flow Diagram”. It is used to graphically represents
the flow of data in a business information system. It describes the process
that are involved in a system to transfer data from the input to the file
storage and reports generation.
It is really helpful and useful as it provides overview of the data as well as
functionality to the software designers. DFDs shows how inputs can be
given, how data can be processed and how data can be showed as output.

4.1.4 Components Of Data Flow Diagram


(DFDs)
Components of DFDs are:-
1.) Process – It shows transformation or manipulation of data flows
within the system.

41
2.) Entity – It is a source or destination of a data flow which is outside
the area of study.

3.) Data Flow -It shows the flow of information from its source to its
destination. It is represented by a line, with arrow heads showing the
direction of the flow.

4.) Data Store – It is a holding place for information within the system.
Data stores may be long term files or may be short term files.

4.1.5 DFD Levels And Its Application In (Food


Ordering System) Project
DFDs are categorized by levels. The most basic level is ‘0’ and highest level
is ‘2’.
1.) ‘0’Level DFD – It is also known as context diagram. They provide a
broad view that is basically digestible but offers little detail. It
shows a single process node and its connection to external entities.

42
2.) ‘1’ Level DFD – They are still a general overview, but they go into
more detail then level ’0’. In level ‘1’, the single process node from the
level ’0’ is broken down into subprocesses.
3.) ‘2’ Level DFD - It simply break processes down into more detailed
processes.

4.1.5.1 ‘0’ Level DFD (Food Ordering System)

VIEW CUSTOMER DELETE


ADD CUSTOMER
CUSTOMER

FOOD
ORDERING EXIT
SYSTEM

ADD ORDER VIEW CUSTOMER DELETE ORDER


4.1.5.2 ‘1’ Level DFD (Food Ordering System)

ADD VIEW VIEW ADD


CUSTOMER CUSTOMER ORDER ORDER

Customer.txt FOOD Order.txt


ORDERING
SYSTEM

DELETE DELETE
CUSTOMER ORDER

43
EXIT
Module 1: Add Customer
In this module, the admin will add the customer details, such as,
customer_name, customer_number, customer_address, etc. by entering
customer id.

Module 2: View Customer


In this module, the admin or the user can view all the records of customers
by entering the customer id.

Module 3: Delete Customer


In this module, the user or admin can delete the customer and their details
by entering the customer id.

Module 4: Add Order


In this module, the admin will add the order details, such as, order_name,
order_number, order_address (where the order has to be delivered), etc. by
entering customer id.

Module 5: View Order


In this module, the admin or the user can view all the orders placed by the
customers by entering the order id.

Module 6: Delete Order


In this module, the user or admin can delete the order placed by the
customer if cancelled or fulfilled and all the related details by entering the
order id.

44
Module 7: Exit
In this module, the user or admin can exit from the application if pressed
“y” or ”Y” and can remain in the system by pressing “n” or “N”.

4.1.5 ER- Diagram


Entity Relationship Analysis involves capturing and analyzing of
maximum possible details on data that is required for building an
information system for an organization.
ER- Diagram displays the relationship of entity-set store in the database.
In other words, we can say that ER-Diagram helps you to explain the
logical structure of database. ER Model was introduced by P.P. Chen. ER
Modeling is a detailed logical representation of the entities, associations
and data elements for an organization. This technique is used in database
design that helps to describe how entities are related to one another. ER-
diagram can be used by database designers and other software developers
as a blueprint for implementing data in specific software application.
Why Use ER-Diagram ?

 It helps to define terms related to entity relationship modelling.


 It provides a preview of how all your tables should connect with
each other, what fields are going to be on each table.
 It helps to describe entities, attributes, relationships.
 The database designer gains a better understanding of the
information to be added or already is in the database with the help
of diagram.

4.1.6 Components Of ER- Diagram


Components of ER-Diagram are:-
1.) Entity – An entity is a person, place, thing or event of interest to the
organization and about which data are captured, stored or processed.
2.) Attributes – An attribute describes the property of an entity. Various
types of data items that describe an entity are known as attributes.

45
3.) Relationships – It is nothing but an association of two or more
entities in ER Model is called relationship.

ER-Diagrams symbols :-
S Name Of Symbol Symbol
No.
1. Entity Set

2. Attributes

3. Relationship Among Entity Sets

4. Links Attributes To Entity Sets and


Entity Sets To Relationships

4.1.7 Attributes Of ER- Diagram(Food Ordering


System)
An attribute describes the property of an entity. An attribute is represented
as oval in an ER-Diagram.
1.) Key Attributes – A key attribute can uniquely identify an entity from
an entity set.

46
For ex:- In “Food Ordering System” customer id is the key attribute.

Customer_name

Customer_addr Customer Customer_id

Customer_pnu
m

2.) Composite Attribute – An attribute that is a combination of other


attributes is known as composite attribute.
3.) Multivalued Attribute – An attribute that can hold multiple values is
known as multivalued attribute. It is represented by double oval.
For ex:- In “Food Ordering System” customer id is the key attribute.

Customer_name

Customer_addr Customer Customer_id

Customer_pnum

4.) Derived Attribute – A derived attribute is one whose value is dynamic


and derived from another attribute. It is represented by dashed oval.

47
AGE

4.1.8 ER- Diagram (“Food Ordering System”)

Customer
_name

Customer Customer
CUSTOMER
_addr _pnum

Customer
_id

order_cn order_ca
ame ddr

48

Places ORDER
order_de
order_id
tail

order_cn
um

4.2 Test Design And Implementation


Software testing is the process of finding errors in the developed product. It
also checks whether the real outcomes can match expected results, as well
as aids in the identification of defects, missing requirements, or gaps.
Testing is the penultimate step before the launch of the product to the
market. It includes examination, analysis, observation, and evaluation of
different aspects of a product.
Professional software testers use a combination of manual testing with
automated tools. After conducting tests, the testers report the results to the
development team. The end goal is to deliver a quality product to the
customer, which is why software testing is so important
4.2.1 Importance of Software Testing
1.) Enhance Product Quality - An enterprise can bring value to their
customers only when the product delivered is ideal. And to achieve that,
organizations have to make sure that users don’t face any issues while
using their product. Organizations have to focus on testing applications
and fix the bugs that testing reveals before releasing the product. When the
team resolves issues before the product reaches the customer, the quality of
the deliverable increases.

2.) Improve Security - When customers use the product, they are bound to
reveal some sort of personal information. To prevent hackers from getting
hold of this data, security testing is a must before the software is released.

49
When an organization follows a proper testing process, it ensures a secure
product that in turn makes customers feel safe while using the product.
For instance, banking applications or e-commerce stores need payment
information. If the developers don’t fix security-related bugs, it can cause
massive financial loss.
The other part of security is not losing your data. It’s common today for
people to store data in cloud storage.
Security of a product not only protects information from hackers but also
makes sure it’s not lost or gets corrupted.

3.) Detect Compatibility with Different Devices and Platforms -The days are
gone when customers worked exclusively on hefty desktops. In the mobile-
first age, testing a product’s device compatibility is a must.
4.2.2 Types Software Testing
I. Functional Testing
Functional testing verifies each function of an application or
software. The tester verifies functionality with a specified set of
requirements. So the source code of a software or an application
doesn’t play a major role in this case. Testing the behavior of the
software is the main concern.
The different types of functional testing include:
 Unit testing. In unit testing, the tester checks individual
software components. The aim is to test whether the
components behave according to the requirements.
 Integration testing. Integration testing deals with testing
individual components or modules after they are combined in a
group.
 System testing. Here, the tester executes test cases for verifying
the compliance of integrated and completed software along
with specifications.
 Beta/acceptance testing. Here, the intended users try the product
and report bugs.

II. Non- Functional Testing


Non-functional testing considers parameters such as reliability,
usability, and performance. A non-functional test might be checking
how many users can log in to the system at the same time.
50
Non-functional testing types include:
 Performance testing. The performance or speed of the
application is tested under the required workload.
 Load testing. This tests an application’s behavior under a huge
workload. So, if you’re testing a website, load testing checks
the site’s functionality and performance under high traffic.
 Stress testing. Stress testing determines software robustness by
assessing whether it’s working beyond regular operation.
 Volume testing. This tests the performance of the system by
loading the database to an increased volume of data.
 Security testing. Here, test cases are executed to check whether
the system is safeguarded against sudden or deliberate attacks
from internal and external sources.
 Compatibility testing. Test cases are executed to check whether
the application is compatible with varying environments. For
example, if you’re testing a web application, compatibility
testing deals with how the website works on different browsers
or devices.
 Install testing. These tests check if a product works according to
expectations after installation.
 Recovery testing. Here, testers determine an application’s
capacity to recover from hardware crashes and failures.

III. Blackbox Testing


Black box testing methods focus on the functional requirements of
the software. Black box testing enables the software engineer to
derive sets of input conditions that will fully exercise all the
functional requirements for a program. Black box testing attempts to
find the errors in the following categories :-
 Incorrect or missing functions.
 Interface errors.
 Errors in data structures or external database access.
 Performance errors.
 Initialization and termination errors.

IV. Whitebox Testing

51
Whitebox testing is a test case design method that uses the control
structure of the procedural design to derive test cases. Using white
box testing methods, the software engineer can derive test cases that
guarantee that all independent paths within a module have been
exercised at least once, exercise all logical decisions on their true and
false sides, execute all loops at their boundaries and within their
operational bounds and exercise internal data structures to ensure
their validity.

4.2.3 Software Testing (Food Ordering System)


1) Unit Testing
Unit testing is a testing done on the software unit-wise.
The units are tested one by one and if any problems are found in these
modules then they are debugged and tested again until it becomes
error free.

Entry Criteria :-
All the modules of the “Food Ordering System Project” are being
tested one by one. Module descriptions are as follows:-

Module 1: Add Customer


In this module, the admin will add the customer details, such as,
customer_name, customer_number, customer_address, etc. by entering
customer id.

Module 2: View Customer


In this module, the admin or the user can view all the records of customers
by entering the customer id.

Module 3: Delete Customer


In this module, the user or admin can delete the customer and their details
by entering the customer id.

52
Module 4: Add Order
In this module, the admin will add the order details, such as, order_name,
order_number, order_address (where the order has to be delivered), etc. by
entering customer id.

Module 5: View Order


In this module, the admin or the user can view all the orders placed by the
customers by entering the order id.

Module 6: Delete Order


In this module, the user or admin can delete the order placed by the
customer if cancelled or fulfilled and all the related details by entering the
order id.

Module 7: Exit
In this module, the user or admin can exit from the application if pressed
“y” or ”Y” and can remain in the system by pressing “n” or “N”.

Exit Criteria :-
All the modules working correctly. Acceptance of program with
review feedback of the unit tests along with the program code and
documentation.

Deliverables :-
 Accepted program code.
 Unit testing feedback according to the expected results

2) Integration Testing
Integration testing is a testing which let a tester to test program by
integrating the unit tested modules which shares like files. Here,

53
tester can test one or more unit tested programs by integrating them
and can check whether the modules are working properly when
integrated and if an error occurs, the program is debugged until it
starts working properly.

Entry Criteria :-
All the modules of the “Food Ordering System Project” which have
been already tested one by one are now integrated and then these
integrated modules are tested. Module descriptions are as follows:-

Module 1: Add Customer, View Customer, Delete


Customer
In this module , the admin will first integrate these three modules add
customer, view customer and delete customer.
The admin will add the customer details, such as, customer_name,
customer_number, customer_address, etc. by entering customer id. The
admin or the user can view all the records of customers by entering the
customer id. The user or admin can delete the customer and their details by
entering the customer id. Now when these integrated modules are tested
they should work fine to make the test conducted on integration testing
successful.

Module 4: Add Order, View Order, Delete Order


In this module , the admin will first integrate these three modules add
order, view order and delete order.
In this module, the admin will add the order details, such as, order_name,
order_number, order_address (where the order has to be delivered), etc. by
entering customer id. In this module, the admin or the user can view all the
orders placed by the customers by entering the order id. In this module, the
user or admin can delete the order placed by the customer if cancelled or
fulfilled and all the related details by entering the order id. Now when

54
these integrated modules are tested they should work fine to make the test
conducted on integration testing successful.

Exit Criteria :-
All the modules working correctly. Acceptance of all programs and
other software components by the integration testing team,
acceptance of user manuals, incorporation of integration testing
feedback.

Deliverables :-
 Accepted integrated software package.
 Results as per expectations.

3) System Testing
It is a final step while a program is going though testing. In this
testing method all the units, integrated units are tested together. In
other words, in this testing the software package is tested as a whole
to check whether the all the components of the software are working
together properly. If an error occurs, the program is debugged until it
starts working properly.

Entry Criteria :-
All the modules and integrated modules of the “Food Ordering
System Project” which have been already tested one by one are now
integrated once again into a full-fledge system and now this system
is being tested.

Exit Criteria :-
Firstly, all the modules working correctly. These modules are then
being integrated into some bigger modules and then were tested.

55
After the successful integration testing these integrated modules were
combined into one system and then the system is being tested.
Acceptance of all programs and other software components by the
testing team, acceptance of user manuals, incorporation of
integration testing feedback and successful system test.

Deliverables :-
 System worked finely as per expectations.

5: CONCLUSION, CODE AND


OUTPUT
5.1 Conclusion (Food Ordering System)
“Food Ordering System” will be provide more convenience to the
management and operators operating it. The employees now have to do
very less manual work. They don’t have to spent tons of time making
paper entries. This system will eliminate tons of paper work. If some
mistakes are being made by the admin there is no need to make records
again from the starting instead just deleting that record just by running a
search in the delete section would be sufficient. It is much faster and more
efficient as the data once entered can be easily accessed and modified. This
program and its following operations are very easy to understand and can
lead the business towards more growth and profit as it eliminates wastage
of time which was earlier done while preparing the record manually on
papers.

5.3 Scope Of Modification (Food


Ordering System)
As my project “Food Ordering System” was made at very low level, so
definitely there are huge scope of improvements in the software. Firstly, we

56
can add prices of the dishes and food items and can provide the user with
the menu to select from which will lead to an automatic generation of bill.
In addition, as we all know users can now a days make order by sitting at
their home via internet services, so we can collaborate our codes with
other domain languages and present our system as an application which
will connect the business and customer to a server where, when the order is
placed by the customer can be directly sent to the operators. This way the
business and customer would establish a good relationship and
coordination and business can also provide some attractive offers and
discounts to their regular customers and can attract more customers for
their growth. Lastly, we can make a section where user can login to their
accounts and check what orders to make, internet payments, etc.

5.4 System Requirements (Food Ordering


System)
Hardware On Which Program Was Made:-
Memory : 8 GB RAM.
Hard Disk : 1 TB.

Software Requirements :-
Programming Language : C++ Programming language.
Preferred IDE : TurboC3 or Turbo C++ or any IDE
supporting C++ Language.
Operating System : Windows 10 or the system which
will have C++ supporting IDE.

5.5 Bibliography
Books :-

57
 A Level made simple “Structured System Analysis And Design”
- By Prof. Satish Jain
 The complete Reference Of C++ - By Herbert Schildt

Websites :-
 https://www.w3schools.com/
 https://www.programiz.com/
 https://www.google.co.in/

5.6 Code (Food Ordering System)


#include<graphics.h>
#include<stdio.h>
#include<conio.h>
#include<dos.h>
#include<stdlib.h>
#include<iostream.h>
#include<string.h>
#include<ctype.h>

struct record
{
char cname[50];
char caddr[50];
char cnum[20];
char id[10];
char detail[100];

58
}order;

struct record1
{
char name[50];
char addr[50];
char pnum[20];
char id[10];
}customer;

void printTitle(void);
void start(void);
void menu(void);
void add_order(void);
void add_customer(void);
void delete_customer(void);
void delete_order(void);
void end(void);
void view_order(void);
void view_customer(void);
void option1(void);
void invalidinput1(void);
int c=0,d=0;

void main(void)
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"C:\\TURBOC3\\BGI");

59
setbkcolor(1);
cleardevice();
start();
menu();
getch();
closegraph();
}

void start(void)
{
setcolor(RED);
setlinestyle(SOLID_LINE,1,3);
rectangle(0,0,639,479);
}

void menu(void)
{
cleardevice(); //full screen menu bkgrnd color
st:
settextstyle(TRIPLEX_FONT,HORIZ_DIR,4);
setcolor(WHITE);
outtextxy(60,150,"1) ADD CUSTOMER INFORMATION");
outtextxy(60,190,"2) DELETE CUSTOMER");
outtextxy(60,230,"3) VIEW CUSTOMER INFORMATION");
outtextxy(60,270,"4) ADD ORDER INFORMATION");
outtextxy(60,310,"5) VIEW ORDER");
outtextxy(60,350,"6) DELETE ORDER");
outtextxy(60,390,"7) EXIT");

60
while(1)
{
printTitle();
switch(getch())
{
case'1':
add_customer();
cleardevice();
start();
goto st;
case'2':
delete_customer();
cleardevice();
start();
goto st;
case'3':
view_customer();
cleardevice();
start();
goto st;
case'4':
add_order();
cleardevice();
start();
goto st;
case'5':
view_order();
cleardevice();

61
start();
goto st;
case'6':
delete_order();
cleardevice();
start();
goto st;
case'7':
end();
cleardevice();
start();
break;
default:
cout<<"OOPS!! INVALID INPUT";
}
}
}

void printTitle(void)
{
setcolor(6);
outtextxy(16,40,"WELCOME TO THE FOOD ORDER SYSTEM");
}

void end(void)
{
cleardevice();
settextstyle(TRIPLEX_FONT,HORIZ_DIR,3);

62
setcolor(WHITE);
outtextxy(60,150,"ARE YOU SURE YOU WANT TO EXIT (Y/N)");
switch(getch())
{
case'Y':
case'y':
exit(0);
break;
case'N':
case'n':
menu();
break;
default:
cout<<"OOPS!! INVALID INPUT";
getch();
end();
}
}

int isNumber(char str[])


{
int withDecimal=0,isNegative=0,i=0;
int len=strlen(str);
for(i=0;i<len;i++)
{
if(!isdigit(str[i])) //if1
{
if(str[i]=='.')

63
{
if(withDecimal)
{
return 0;
}
withDecimal=1;
}
else if(str[i]=='-')
{
if(isNegative)
{
return 0;
}
if(i==0)
{
isNegative=1;
}
else
{
return 0;
}
}
else
{
return 0;
}
}
}

64
return 1;
}

void add_order(void)
{
FILE*fpoin1;
char temp[50];
int valid=1;
int a=35;
fpoin1=fopen("order.txt","a");
do
{
valid=1;
cleardevice();
start();
settextstyle(DEFAULT_FONT,HORIZ_DIR,3);
outtextxy(35,40,"FOOD ORDER SYSTEM");
settextstyle(DEFAULT_FONT,HORIZ_DIR,1);
outtextxy(60,100,"ENTER ORDER ID");
gotoxy(a,7);
gets(temp);
strcpy(order.id,temp);

if(!isNumber(temp))
{
valid=0;
outtextxy(60,250,"Enter Digits Only In Order");
getch();

65
}
if(strlen(temp)<1||strlen(temp)>4&&valid==1)
{
valid=0;
outtextxy(60,250,"Enter Correctly(Range:1..4)");
getch();
}
}
while(!valid);
do
{
valid=1;
cleardevice();
start();
settextstyle(DEFAULT_FONT,HORIZ_DIR,3);
outtextxy(35,40,"FOOD ORDER SYSTEM");
settextstyle(DEFAULT_FONT,HORIZ_DIR,1);
outtextxy(60,100,"ENTER CUSTOMER NAME");
gotoxy(a,8);
gets(temp);
strcpy(order.cname,strupr(temp));

if(strlen(temp)<1||strlen(temp)>25)
{
valid=0;
outtextxy(60,250,"Enter Correctly(Range:1..25)");
getch();
}

66
if(isNumber(temp))
{
valid=0;
outtextxy(60,250,"Enter Alphabets Only In Customer Name");
getch();
}
}
while(!valid);
do
{
valid=1;
cleardevice();
start();
settextstyle(DEFAULT_FONT,HORIZ_DIR,3);
outtextxy(35,40,"FOOD ORDER SYSTEM");
settextstyle(DEFAULT_FONT,HORIZ_DIR,1);
outtextxy(60,115,"ENTER ADDRESS");
gotoxy(a,9);
gets(temp);
strcpy(order.caddr,strupr(temp));

if(temp[0]=='0')
return;
if(strlen(temp)<1||strlen(temp)>50)
{
valid=0;
outtextxy(60,250,"Enter Correctly(Range:1..50)");
getch();

67
}
}
while(!valid);
do
{
valid=1;
cleardevice();
start();
settextstyle(DEFAULT_FONT,HORIZ_DIR,3);
outtextxy(35,40,"FOOD ORDER SYSTEM");
settextstyle(DEFAULT_FONT,HORIZ_DIR,1);
outtextxy(60,130,"ENTER CONTACT PERSON");
gotoxy(a,10);
gets(temp);
strcpy(order.cnum,strupr(temp));

if(isNumber(temp))
{
valid=0;
outtextxy(60,250,"Enter Alphabets Only In Contact Person");
getch();
}
if(strlen(temp)<1||strlen(temp)>25)
{
valid=0;
outtextxy(60,250,"Enter Correctly(Range:1..25)");
getch();
}

68
}
while(!valid);
do
{
valid=1;
cleardevice();
start();
settextstyle(DEFAULT_FONT,HORIZ_DIR,3);
outtextxy(35,40,"FOOD ORDER SYSTEM");
settextstyle(DEFAULT_FONT,HORIZ_DIR,1);
outtextxy(60,130,"ENTER ORDER DETAILS");
gotoxy(a,10);
gets(temp);
strcpy(order.detail,temp);

if(strlen(temp)<1||strlen(temp)>100)
{
valid=0;
outtextxy(60,250,"Enter Correctly(Range:1..100)");
getch();
}
}
while(!valid);
if((c!=1)&&(d!=1))
{
cleardevice();
start();
outtextxy(90,290,"RECORD ADDED");

69
outtextxy(90,310,"PRESS ANY KEY TO CONTINUE");
getch();
}
fwrite(&order,sizeof(order),1,fpoin1);
fclose(fpoin1);
fflush(stdin);
}

void view_order(void)
{
FILE*fpoin1;
char*searchname,temp[30];
int count=0;
st_start:
cleardevice();
start();
gotoxy(10,5);
cout<<"Enter The ID Of Order:";
gets(temp);
searchname=temp;

if(!isNumber(searchname))
{ //valid=0;
settextstyle(TRIPLEX_FONT,HORIZ_DIR,2);
outtextxy(60,250,"Enter Digits Only In ORDER ID");
getch();
goto st_start;
}

70
if(strlen(searchname)<1&&strlen(searchname)>4)
{
settextstyle(TRIPLEX_FONT,HORIZ_DIR,2);
setcolor(WHITE);
outtextxy(60,250,"Please Enter Correctly(Range:1..4)");
getch();
goto st_start;
}
fpoin1=fopen("order.txt","r");
while(fread(&order,sizeof(order),1,fpoin1)!=NULL)
{
if(strcmp(searchname,order.id)==0)
{
cleardevice();
start();
gotoxy(9,10);
cout<<"CUSTOMER NAME";
gotoxy(34,10);
puts(order.cname);
gotoxy(20,11);
cout<<"\n"<<"\t"<<"ADDRESS"<<"\t\t\t"<<order.caddr;
cout<<"\n"<<"\t"<<"CONTACT PERSON"<<"\t\t"<<order.cnum;
cout<<"\n"<<"\t"<<"ORDER DETAILS"<<"\t\t"<<order.detail;
cout<<"\n\n\n\n";
start();
count++;
getch();
}

71
}
cout<<"\n\t\t\tTHERE ARE "<<count<<" RECORD(s)";
start();
getch();
}

void add_customer(void)
{
FILE*fpoin1;
char temp[50];
int valid=1;
int a=35;
fpoin1=fopen("customer.txt","a");
do
{
valid=1;
cleardevice();
start();
settextstyle(DEFAULT_FONT,HORIZ_DIR,3);
outtextxy(35,40,"FOOD ORDER SYSTEM");
settextstyle(DEFAULT_FONT,HORIZ_DIR,1);
outtextxy(60,100,"ENTER CUSTOMER ID");
gotoxy(a,7);
gets(temp);
strcpy(customer.id,temp);

if(!isNumber(temp))
{

72
valid=0;
outtextxy(60,250,"Enter Digits Only In Customer ID");
getch();
}
if(strlen(temp)<1||strlen(temp)>4&&valid==1)
{
valid=0;
outtextxy(60,250,"Enter Correctly(Range:1..4)");
getch();
}
}
while(!valid);
do
{
valid=1;
cleardevice();
start();
settextstyle(DEFAULT_FONT,HORIZ_DIR,3);
outtextxy(35,40,"FOOD ORDER SYSTEM");
settextstyle(DEFAULT_FONT,HORIZ_DIR,1);
outtextxy(60,100,"ENTER CUSTOMER NAME");
gotoxy(a,8);
gets(temp);
strcpy(customer.name,strupr(temp));

if(strlen(temp)<1||strlen(temp)>25)
{
valid=0;

73
outtextxy(60,250,"Enter Correctly(Range:1..25)");
getch();
}
if(isNumber(temp))
{
valid=0;
outtextxy(60,250,"Enter Alphabets Only In Customer Name");
getch();
}
}
while(!valid);
do
{
valid=1;
cleardevice();
start();
settextstyle(DEFAULT_FONT,HORIZ_DIR,3);
outtextxy(35,40,"FOOD ORDER SYSTEM");
settextstyle(DEFAULT_FONT,HORIZ_DIR,1);
outtextxy(60,115,"ENTER ADDRESS");
gotoxy(a,9);
gets(temp);
strcpy(customer.addr,strupr(temp));

if (temp[0]=='0')
return;
if(strlen(temp)<1||strlen(temp)>50)
{

74
valid=0;
outtextxy(60,250,"Enter Correctly(Range:1..50)");
getch();
}
}
while(!valid);
do
{
valid=1;
cleardevice();
start();
settextstyle(DEFAULT_FONT,HORIZ_DIR,3);
outtextxy(35,40,"FOOD ORDER SYSTEM");
settextstyle(DEFAULT_FONT,HORIZ_DIR,1);
outtextxy(60,130,"ENTER PHONE NUMBER");
gotoxy(a,10);
gets(temp);
strcpy(customer.pnum,strupr(temp));
if(!isNumber(temp))
{
valid=0;
outtextxy(60,250,"Enter Digits Only In Phone Number");
getch();
}
if(strlen(temp)!=10)
{
valid=0;
outtextxy(60,250,"Please Enter 10 Digits In Phone Number");

75
getch();
}
}
while(!valid);
if((c!=1)&&(d!=1))
{
cleardevice();
start();
outtextxy(90,290,"RECORD ADDED");
outtextxy(90,310,"PRESS ANY KEY TO CONTINUE");
getch();
}
fwrite(&customer,sizeof(customer),1,fpoin1);
fclose(fpoin1);
fflush(stdin);
}

void delete_customer(void)
{
char*searchname,temp[30];
int count=0,count1=0,success=0,i,j,success2=0,k=0;
FILE*fpoin1,*fpoin2;
st_start:
cleardevice();
start();
gotoxy(10,5);
cout<<"ENTER THE ID OF CUSTOMER:";
gets(temp);

76
searchname=temp;
if(!isNumber(searchname))
{
//valid=0;
settextstyle(TRIPLEX_FONT,HORIZ_DIR,2);
outtextxy(60,250,"ENTER DIGITS ONLY IN CUSTOMER ID");
getch();
goto st_start;
}
if(strlen(searchname)<1&&strlen(searchname)>4)
{
settextstyle(TRIPLEX_FONT,HORIZ_DIR,2);
setcolor(WHITE);
outtextxy(60,250,"Please Enter Correctly (Range:1..4)");
getch();
goto st_start;
}
gotoxy(10,7);
fpoin1=fopen("customer.txt","r");
while((fread(&customer,sizeof(customer),1,fpoin1))!=NULL)
{
count1++;
if((strcmp(searchname,customer.id)==0))
{
success2=1;
cleardevice();
start();
gotoxy(9,10);

77
cout<<"CUSTOMER NAME";
gotoxy(34,10);
puts(customer.name);
gotoxy(20,11);
cout<<"\n"<<"\t"<<"ADDRESS"<<"\t\t"<<customer.addr;
cout<<"\n"<<"\t"<<"PHONE NUMBER"<<"\t\t"<<customer.pnum;
start();
count++;
k=1;
success=1;
break;
}
}
if((success2==1)&&(success==1))
{
i=1;
rewind(fpoin1);
fpoin2=fopen("temp.txt","w");
for(i=1;i<count1;i++)
{
fread(&customer,sizeof(customer),1,fpoin1);
fwrite(&customer,sizeof(customer),1,fpoin2);
}
fread(&customer,sizeof(customer),1,fpoin1);
while((fread(&customer,sizeof(customer),1,fpoin1))!=NULL)
fwrite(&customer,sizeof(customer),1,fpoin2);
for(j=0;j<=3;j++)
{

78
cleardevice();
start();
settextstyle(TRIPLEX_FONT,HORIZ_DIR,2);
setcolor(WHITE);
outtextxy(100,150,"RECORD DELETING");
delay(700);
setcolor(BLACK);
outtextxy(100,150,"RECORD DELETING");
delay(700);
setcolor(WHITE);
}
start();
cleardevice();
start();
setcolor(RED);
outtextxy(100,170,"RECORD DELETED");
delay(1500);
fclose(fpoin2);
fclose(fpoin1);
remove("customer.txt");
rename("temp.txt","customer.txt");
fpoin1=fopen("customer.txt","r");
}
if(success2==0)
{
gotoxy(28,20);
printf("RECORD NOT FOUND");
getch();

79
}
if((count!=0)&&(k==0))
{
gotoxy(10,24);
cout<<"THER ARE "<<count<<" RECORD(s) LEFT";
getch();
}
}

void view_customer(void)
{
FILE*fpoin1;
char*searchname,temp[30];
int count=0;
st_start:
cleardevice();
start();
gotoxy(10,5);
cout<<"Enter The ID Of Customer:";
gets(temp);
searchname=temp;

if(!isNumber(searchname))
{ //valid=0;
settextstyle(TRIPLEX_FONT,HORIZ_DIR,2);
outtextxy(60,250,"Enter Digits Only In CUSTOMER ID");
getch();
goto st_start;

80
}
if(strlen(searchname)<1&&strlen(searchname)>4)
{
settextstyle(TRIPLEX_FONT,HORIZ_DIR,2);
setcolor(WHITE);
outtextxy(60,250,"Please Enter Correctly(Range:1..4)");
getch();
goto st_start;
}
fpoin1=fopen("customer.txt","r");
while(fread(&customer,sizeof(customer),1,fpoin1)!=NULL)
{
if(strcmp(searchname,customer.id)==0)
{
cleardevice();
start();
gotoxy(9,10);
cout<<"CUSTOMER NAME";
gotoxy(34,10);
puts(customer.name);
gotoxy(20,11);
cout<<"\n"<<"\t"<<"CUSTOMER ID"<<"\t\t\t"<<customer.id;
cout<<"\n"<<"\t"<<"ADDRESS"<<"\t\t\t"<<customer.addr;
cout<<"\n"<<"\t"<<"CONTACT PERSON"<<"\t\t"<<customer.pnum;
cout<<"\n\n\n\n";
start();
count++;
getch();

81
}
}
cout<<"\n\t\t\tTHERE ARE "<<count<<" RECORD(s)";
start();
getch();
}

void delete_order(void)
{
char*searchname,temp[30];
int count=0,count1=0,success=0,i,j,success2=0,k=0;
FILE*fpoin1,*fpoin2;
st_start:
cleardevice();
start();
gotoxy(10,5);
cout<<"ENTER THE ID OF ORDER:";
gets(temp);
searchname=temp;
if(!isNumber(searchname))
{
//valid=0;
settextstyle(TRIPLEX_FONT,HORIZ_DIR,2);
outtextxy(60,250,"ENTER DIGITS ONLY IN ORDER ID");
getch();
goto st_start;
}
if(strlen(searchname)<1&&strlen(searchname)>4)

82
{
settextstyle(TRIPLEX_FONT,HORIZ_DIR,2);
setcolor(WHITE);
outtextxy(60,250,"Please Enter Correctly (Range:1..4)");
getch();
goto st_start;
}
gotoxy(10,7);
fpoin1=fopen("order.txt","r");
while((fread(&order,sizeof(order),1,fpoin1))!=NULL)
{
count1++;
if((strcmp(searchname,order.id)==0))
{
success2=1;
cleardevice();
start();
gotoxy(9,10);
cout<<"CUSTOMER NAME";
gotoxy(34,10);
puts(order.cname);
gotoxy(20,11);
cout<<"\n"<<"\t"<<"ADDRESS"<<"\t\t"<<order.caddr;
cout<<"\n"<<"\t"<<"CONTACT PERSON"<<"\t\t"<<order.cnum;
cout<<"\n"<<"\t"<<"ORDER DETAILS"<<"\t\t"<<order.detail;
start();
count++;
k=1;

83
success=1;
break;
}
}
if((success2==1)&&(success==1))
{
i=1;
rewind(fpoin1);
fpoin2=fopen("temp.txt","w");
for(i=1;i<count1;i++)
{
fread(&order,sizeof(order),1,fpoin1);
fwrite(&order,sizeof(order),1,fpoin2);
}
fread(&order,sizeof(order),1,fpoin1);
while((fread(&order,sizeof(order),1,fpoin1))!=NULL)
fwrite(&order,sizeof(order),1,fpoin2);
for(j=0;j<=3;j++)
{
cleardevice();
start();
settextstyle(TRIPLEX_FONT,HORIZ_DIR,2);
setcolor(WHITE);
outtextxy(100,150,"RECORD DELETING");
delay(700);
setcolor(BLACK);
outtextxy(100,150,"RECORD DELETING");
delay(700);

84
setcolor(WHITE);
}
start();
cleardevice();
start();
setcolor(RED);
outtextxy(100,170,"RECORD DELETED");
delay(1500);
fclose(fpoin2);
fclose(fpoin1);
remove("order.txt");
rename("temp.txt","order.txt");
fpoin1=fopen("order.txt","r");
}
if(success2==0)
{
gotoxy(28,20);
printf("RECORD NOT FOUND");
getch();
}
if((count!=0)&&(k==0))
{
gotoxy(10,24);
cout<<"THER ARE "<<count<<" RECORD(s) LEFT";
getch();
}
}

85
5.7 Output (Food Ordering System)
MENU

ADD CUSTOMER

86
87
88
VIEW CUSTOMER

89
After Deleting the record:-

90
DELETE CUSTOMER

91
ADD ORDER

92
93
94
VIEW ORDER

95
After Deleting the Record

DELETE ORDER

96
97
EXIT

98

You might also like