Project Report ON Food Ordering System IN C++ Programming Language
Project Report ON Food Ordering System IN C++ Programming Language
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.
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
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++).
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;
.
.
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.)
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.
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. Airthematic Operator
Operator Description
16
+ Add two operands
- Subtract second operand from first
* Multiply two operands
/ Divides two operands
% Remainder of division
2. Relational Operator
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-
4. Assignment Operator
18
*= Multiply left operand with the right a*=b is same
operand and assign the result to left as a=a*b
operand
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 :-
6. Conditional Operator
Explanation:
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
Operator Description
& Bitwise AND
I Bitwise OR
^ Bitwise Exclusive OR
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
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.
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.
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
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.
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.
34
An organization can estimate the time necessary to complete a
project through scheduling feasibility.
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.
39
6) Object Oriented Design: This methodology is based on a system of
interacting objects.
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.
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.
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.
FOOD
ORDERING EXIT
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.
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”.
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
46
For ex:- In “Food Ordering System” customer id is the key attribute.
Customer_name
Customer_pnu
m
Customer_name
Customer_pnum
47
AGE
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
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.
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.
Entry Criteria :-
All the modules of the “Food Ordering System Project” are being
tested one by one. Module descriptions are as follows:-
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 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:-
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.
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.
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/
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();
}
}
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