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

Application for Automation of Departmental Store

A REPORT SUBMITTED IN PARTIAL FULFILLMENT OF


THE REQUIREMENT FOR THE DEGREE OF
BACHELOR COMPUTER APPLICATION

UNDER THE GUIDANCE OF

Ms.Deepika Singh Mr. Jay Prakash Jay


Faculty of Institute Project Supervisor
SOFTDOT HI-TECH EDUCATION SOFTDOT HI-TECH EDUCATION
& TRAINING INSTITUT & TRAINING INSTITUTE

Submitted By
Ashish Verma
Enrollment No:
ODL/05/401/395

2
SOFTDOT HI-TECH EDUCATION & TRAINING INSTITUTE
K-16 South Ex Part-I
NEW DELHI-110049
PHONE: 24601315

Contents

1. Certificate……………………………………………………. 4
2. Acknowledgement…………………………………………… 5
3. Introduction to C-Programming…………………………… 6
4. User Manual…………………………………………………. 13
5. Software Requirement Specification………………………. 16
5.1 Software requirement specification
5.2 Hardware requirement specification
6. System Analysis Design………………………………………20
7. Data Flow Diagram…………………………………………..32
8. E-R Diagram………………………………………………….43
9. Flow Chart……………………………………………………52
10. Coding………………………………………………………...64
11. Output……………………………………………………….. 96
12. Testing……………………………………………………….113
13. Bibliography………………………………………………...118

3
CERTIFICATE OF ORIGINALITY

This is to certify that the project report entitled “Automation of Departmental store”

submitted to Jamia Hamdard University in partial fulfilment of the requirement for

the award of the degree of BACHELOR IN COMPUTER APPLICATIONS

(BCA) , is an original work carried out by “Ashish Verma” Enrolment No:

0DL/05/401/395 under the guidance of Ms. Deepika Singh and Mr. Jay Prakash Jay.

The matter embodied in this project is a genuine work done by the student and has

not been submitted whether to this University or to any other University / Institute for the

fulfilment of the requirement of any course of study.

Signature of the Student: Signature of the Guide:

Name of the student Name of the Guide


Ashish Verma Ms. Deepika Singh
Mr. Jay Prakash Jay

Enrolment No: 0DL/05/401/395

4
ACKNOWLEDGEMENT

I, Ashish Verma, express my deep sense of gratitude and indebt ness to the
faculty members of Softdot Hi-tech education & training institute and my
guides, Ms. Deepika Singh & Mr. Jay Prakash Jay, under whose inspiring
guidance, valuable suggestions, constant encouragement and kind
supervision, with her help, the present project on “Automation of
Departmental Store” was carried out.

I also wish to express our indebt ness to those who helped us during the
preparation of the manuscript of this text.

My sincere thanks to all those friends who have helped us directly or


indirectly by giving their useful suggestions. Without their help this project
report would never have been completed.

Your Name
Ashish Verma

5
6
1. Introduction to C Programming

Objectives
This section is designed to give you a general overview of the C
programming language. Although much of this section will be expanded in
later sections it gives you a taste of what is to come.

Why use C?
C has been used successfully for every type of programming problem
imaginable from operating systems to spreadsheets to expert systems - and
efficient compilers are available for machines ranging in power from the
Macintosh to the Cray supercomputers. The largest measure of C's success
seems to be based on purely practical considerations:
• the portability of the compiler;
• the standard library concept;
• a powerful and varied repertoire of operators;
• an elegant syntax;
• ready access to the hardware when needed;
• and the ease with which applications can be optimized by hand-coding
isolated procedures
C is often called a "Middle Level" programming language. This is not a
reflection on its lack of programming power but more a reflection on its
capability to access the system's low level functions. Most high-level
languages (e.g. FORTRAN) provide everything the programmer might want
to do already build into the language. A low level language provides nothing
other than access to the machines basic instruction set. A middle level
language, such as C, probably doesn't supply all the constructs found in
high-languages - but it provides you with all the building blocks that you
will need to produce the results you want!

Uses of C
C was initially used for system development work, in particular the
programs that make-up the operating system. Why use C? Mainly because it
produces code that runs nearly as fast as code written in assembly language.
Some examples of the use of C might be:
• Operating Systems
• Language Compilers
• Assemblers

7
• Text Editors
• Print Spoolers
• Network Drivers
• Modern Programs
• Data Bases
• Language Interpreters
• Utilities
In recent years C has been used as a general-purpose language because of its popularity
with programmers. It is not the world's easiest language to learn and you will certainly
benefit if you are not learning C as your first programming language! C is trendy (I
nearly said sexy) - many well established programmers are switching to C for all sorts of
reasons, but mainly because of the portability that writing standard C programs can offer.

A Brief History of C
C is a general-purpose language which has been closely associated with the
operating system for which it was developed - since the system and most of
the programs that run it are written in C.
Many of the important ideas of C stem from the language BCPL, developed
by Martin Richards. The influence of BCPL on C proceeded indirectly
through the language B, which was written by Ken Thompson in 1970 at
Bell Labs, for the first UNIX system on a PDP-7. BCPL and B are "type
less" languages whereas C provides a variety of data types.
In 1972 Dennis Ritchie at Bell Labs writes C and in 1978 the publication of
The C Programming Language by Kernighan & Ritchie caused a revolution
in the computing world.
In 1983, the American National Standards Institute (ANSI) established a
committee to provide a modern, comprehensive definition of C. The
resulting definition, the ANSI standard, or "ANSI C", was completed late
1988.

C for Personal Computers


With regards to personal computers Microsoft C for IBM (or clones) PC's.
and Borland’s C are seen to be the two most commonly used systems.
However, the latest version of Microsoft C is now considered to be the most
powerful and efficient C compiler for personal computers.

We hope we have now managed to convince you to continue


with this online C course and hopefully in time become a confident C
programmer.

8
Program Design
Program design is the foundation for a good program and is therefore an important part of
the program development cycle. Before coding a program, the program should be well
convinced and all aspects of the program design should be considered in detail.
Program design is basically concerned with the development of a strategy to
be used in writing the program, in order to achieve the solution of a problem.
This includes mapping out a solution procedure and the form the program
would take .The program design involves the following stages:
1. Problem analysis
2. Outlining the program structure.
3. Algorithm or Flow Chart development.
4. Selection of control structures.

Problem Analysis
Before we think of a solution procedure to the problem, we must fully understand the
nature of the problem and what we want the program to do. Without the comprehension
and definition of the problem at hand, program design might turn into a hit-or-miss
approach. We must carefully decide the following at this stage:
-What kind of data will go in,
-What kind of outputs are needed, and
-What are the constraints and conditions under which the program has to
operate.

Outlining the Program Structure


Once we have decided what we want and what we have, then the next step is to decide
how to do it. C as a structured language lends itself to the solution procedure into tasks
that form a hierarchical structure. An important feature to this approach is that at each
level, the details of the design of lower level are hidden. The higher level functions are
designed first, assuming certain broad tasks of the immediately lower level functions.
Actual details of the lower level functions are not considered until that level is reached.
Thus the design of functions proceeds from top to bottom, introducing progressively
more and more refinements.

Problem

9
Task Task Task 3

T1 T1 T3 T3

T2 T2

Algorithm Development or Flow Chart Development


After we have decided a solution procedure and an overall outline of the program, the
next step is to work out a detailed definite step-by-step procedure, known as algorithm
for each function. The most common method of describing an algorithm is through the
use of flow charts.
Since algorithm is the key factor for the developing am efficient program,
we should devote enough attention to this step. A problem might have many
different approaches to its solution.

Control Statements
A complex solution procedure may involve a large number of control
statements to direct the flow of execution. In such situations, indiscriminate
use of control statements such as go to may lead to unreadable and
incomprehensible programs. It has been demonstrated that any algorithm can
be structured, using the three basic control structures, namely-sequence
structure, selection structure, and looping structure.

A well designed program would provide the following benefits:


1. Coding is easy and error-free.
2. Testing is simple.
3. Maintenance is easy.
4. Good documentation is possible.
5. Progress of coding may be controlled more precisely.

10
Program Coding
A program written by one may have to be red by others later. Therefore, it should be
readable and simple to understand. Complex logic and tricky coding should be avoided.
The elements of coding style include internal documentation, construction of statements,
generality of the program, and input/output formats.

Internal Documentation
Documentation refers to the details that describe a program. Details may be built-in-as an
integral part of the program. Two important aspects of internal documentation are
selection of meaningful variable names and the use of components, Selection of
meaningful names is crucial for understanding the program. Example,
Area=breadth*length;
Is more meaningful than a=b*l;

Statement Construction
Although the flow of logic is decided during design, the construction of individual
statements is done at the coding stage. Each statement should be simple and direct.
The guidelines for construction of statements are:
1. Use one statement per line.
2. Use proper indentation when selection and looping structures are implemented.
3. Avoid heavy nesting of loops, preferably not more than three levels.
4. Use simple conditional tests; if necessary break complicated conditions into
simple conditions.
5. Use parentheses to clarify logical and arithmetic expressions.
6. Use space, wherever possible, to improve readability.

Input/Output Formats
It should be simple and acceptable to users. A number of guidelines should be
considered during coding.
1. Keep formats simple.
2. Use end-of-file indicators, rather than the user requiring to specify the
number of items.
3. Label all interactive input requests.
4. Label all output reports.
5. Use output messages when the output contains some peculiar results.

Common Programming Errors


It is advisable to keep track of errors that occur during run time, and to see that
these known errors are not present in the program.

Missing Semicolons
Every C statement must end with a semicolon. A missing semicolon may cause
considerable confusion to the compiler and result in ‘misleading’ error messages.

11
There may be an instance when a missing semicolon might cause the compiler to
go ‘crazy’ and to produce a series of error messages.

Missing Braces
It is common to forgot a closing brace when coding a deeply nested loop. It will
be usually detected by the compiler because the number of opening braces should
match with the closing ones.
Another serious problem with the braces is, not using them when multiple
statements are to be grouped together.

Missing Quotes
Every string must be enclosed in double quotes, while a single character constant
in single quotes. If we miss them out, the string (or the character) will be
interpreted as a variable name.

Undeclared Variables
C requires variable to be declared for its type, before it is used. During the
development of a large program, it is quite possible to use a variable to hold
intermediate results and to forget to declare it.

Forgetting the Precedence of Operators


Expressions are evaluated according to the precedence of operators.

Mismatching of Actual and Formal Parameter Type in Function Calls


When a function with parameters is called, we should ensure that the type of
values passed, match with the type expected by the called function. Otherwise,
erroneous results may occur. If necessary, we may use the type cast operator to
change the type locally.

Program Testing
Program testing is the process of reviewing and executing a program with the
intent of detecting errors, which may belong to any of the four kinds discussed
above. We know that while the compiler can detect syntactic and semantic errors,
it cannot detect run-time and logical errors that show up during the execution of
the program. Testing, therefore should be necessary including steps to detect all
possible errors in the program. Testing process includes two stages:
1. Human testing
2. Computer-based testing.
Human testing is an effective error-detection process and is done before the
computer-based testing begins. Human testing methods include code inspection
by the programmer, code inspection by a test group, and a review by a peer group.
The test is carried out statement by statement and is analyzed with respect to a
checklist of common programming errors. In addition to finding the errors, the
programming style and choice of algorithm are also reviewed.

12
13
USER MANUAL
This page will act as guide for all the new users. This is an application
about a departmental store where you find different kinds of products
you want to purchase/sell.
Following are the list of options when you open the application

1. Information about products


2. Enter purchase records
3. Enter products to be sold
4. Search for the records
5. Delete record form store database
6. View sales, purchase and profit
7. Print records
8. Barograph of quantity\ profit
9. Help
10. Profit

In detail
1) Information about products
To view this option you have to press 1 on keyboard. Then a page will be
displayed which will have two choices.
Edibles
General products
These two choices contain the product list. Each product will be having a
product id, company name and rack number.

2) Enter purchase records


To view this option you have to press 2 on the keyboard. A page will appear
asking for product id (enter) \ then for description \ rack number \
cabinet number \ unit cost \ sale price \ total cost.

3) Enter products to be sold


To view this option you have to press 3 on the keyboard. It will ask you for
product that are sold .If the product id that you enter does not match the
record then it will show that the product is not in stock.

4) Search for records


To view this option you have to press 4 on the keyboard. Then a page will
appear which will give you option to search a product by its product id or by
its description matches these records then it will display all the records or it
will say no records found.

5) Delete record from the database

14
To view this option you have to press 5 on the keyboard then a screen will be
displayed which will give you option to delete the record of the product by
giving its id or its description. If the id or the records matches the record it
will de deleted otherwise the record is not found.

6) View sales ,purchase and profit


To view this option you have to press 6 on the keyboard .Then a page will be
displayed which will give you three options to choose.
1 for sales
2 for purchase
3 for profit

If 1 or 2 pressed a screen will appear


Product id
Name
Unit price
Quantity
Total cost

In case of profit the screen will appear as


Product id
Description
Quantity
Profit

7) Print record
To view this option you have to press 7 on the keyboard. This option will help
in taking out a printout.

8) Barograph of quantity\profit
To view this option you have to press 8 on the keyboard. Then a screen will
appear which will sow you graphical representation of the profit earned and
products sold and purchased.

9) Retrieve information
To view this option you have to press h on the keyboard , then a page will
appear which will show how to use this application and how each application
works.

10) Exit
Press E to exit this application and return to windows.

15
16
REQUIREMENT SPECIFICATION

Requirement specifications very important part of the software


development project. IT requires the understanding of the whole project and its
objectives and hence we can say that requirement specification evolves out of the
requirement analysis task, which species what is to be done. Both software
developer and customer conduct review of a software requirement specification. The
software requirement specification is produced at the culmination of the analysis
task. Software project constraints:
1. The process should not be too cumbersome to handle.
2. Economically viable.

REQUIREMENT ANALYSIS

Requirement analysis results in the specification of software’s operational


characteristics; indicates software’s interface with other system elements and
establishes constraints that software must meet. Requirement analysis allows the
software engineer (sometimes called an analyst or modeler in this role) to elaborate
on basic requirements established during earlier requirement engineering tasks and
build, models that depict user scenario, functional activities, problem classes and
their relationships, System and class behavior, and the flow of data as it is
transformed.
Throughout analysis modeling, the software engineer’s primary focus is on
 What objects does the system manipulate.
 What functions must the system perform.
 What behavior does the System exhibit.
 What interfaces are defined.
 What constraints apply.

OBJECTIVES OF ANALYSIS MODEL

 To describe what the customer requires.


 To establish a basis for the creation of a software design.
 To define a set of requirements that can be validated once the software is
built.

System Analysis Design


Description Model Model
17
Analysis model bridges the gap between a system- level, description that
describes overall system functionality as it is achieved by applying software,
hardware, data, human and other System elements and a software design that
describes the software’s application architecture, user interface and component level
structure.

REQUIREMENT DOCUMENTATION

Requirement documentation is very important activity after the requirements


elicitation and analysis. This is the way to represent requirements in a consistent
format. Requirement documents is called software Requirements Specification
(SRS).
The SRS is a specification for a particular software product, program or set
of programs that performs certain functions in a specific environment. It serves a
number of purposes depending on who is writing it. First, the SRS could be written
by the customer of a System second, the SRS could be written by developer of the
system. The two scenarios establish different purpose and serves as a contract
document between customer and developer.

NATURE OF THE SRS

1) FUNCTIONALITY: What software is supposed to do?

2) EXTERNAL INTERFACES: How does the software interact with people,


the System’s hardware, other hardware and other software?

3) PERFORMANCE: What is the speed availability, response time, recovery


time, etc of various software functions?

4) ATTRIBUTES: What are the considerations for portability, correctness,


maintainability, security, reliability etc?

5) DESIGN CONSTRAINTS IMPOSED ON AN IMPLEMENTATION : Are


there any required standards in effect, implementation language, policies for dbase
integrity, resource limits, operating environments etc.

18
SOFTWARE REQUIREMENT SPECIFICATION

STEP I: PRODUCT OVERVIEW AND SUMMARY


The project titled “Hospital Management System” has been prepared
for removing the time consuming manual systems. This package is designed by
taking all the aspects and need of hospital using system which is very easy to handle
and easy to maintain. Basically the purpose of this project is to provide necessary
things like individual admission, discharge, availability of rooms etc. to each and
every patient in a computerized form, so that no patient has to wait in a long queues
for admission and discharge as they did earlier.

STEP II : DEVELOPMENT,OPERATING AND MAINTENANCE ENVIRONMENT


The development, operating and maintenance environment of the
product consists of the following:

SOFTWARES REQUIREMENTS
1. Operating System : - Windows 98,99,2000,XP, NT
2. C compiler : - Turbo, Borland

HARDWARE REQUIREMENTS
SYSTEM TYPE : Pentium
MEMORY : 256 MB
HARD DISK : 20 GB
PRINTER : LASER

STEP III : FUNCTIONAL REQUIRMENTS


Since, the project is prepared on the computerized Hospital
Management System and the end user who will use this software must have some
basic knowledge. So, a good level of user friendliness is the requirement.

STEP IV : PERFORMANCE REQUIREMENTS


The records in it should not overlap and we can able to get the
record by providing the room number and somehow the proper security of all the
records should be maintained.

STEP V : EXCEPTIONAL HANDLING


The software must be able to display proper error messages in
case if some error encounters.

STEP VI : FORESEEABLE MODIFICATIONS AND ENHANCEMENTS


This project is very flexible i.e. we can modify it in future in
case if some need arises.

19
20
SYSTEM ANALYSIS

System analysis describes the detailed description of the scenario, and the
functioning of the system. The transaction and input/output requirements are also
presented. The problems in the current system are discussed and the necessary
improvements are recommended.

Systems Development can generally be thought of as having two major


components :
o System Analysis

o System Design

System Design :

System Design is the process of planning a new business system or one


to replace or complement an existing system. But before this planning can be
done, we must thoroughly understand the old system and determine how computers
can best be used (if at all) to make its operation more effective.

System Analysis :

System Analysis is the process of gathering and interpreting facts,


diagnosing problems , and using the information to recommend improvements to the
system.

SOFTWARE MODEL

WATERFALL MODEL

Waterfall model sometimes called classic life cycle, suggests a Systematic


sequential approach to software development that begins with customer
specification of requirements and progresses through planning, modeling,
construction and deployment, culminating is on going support of the completed
software.
The waterfall model is a popular version of the system development life cycle
model for software engineering. Waterfall development has distinct goals for each
phase of development.

21
COMMUNICATION
project
Initiation
requirements
gathering PLANNING
Estimating
Scheduling
Tracking
MODELING
Analysis
Design

CONSTRUCTION
Code
Test
DEPLOYMENT
Delivery
Support
Feedback

THE WATERFALL MODEL

PHASES OF WATERFALL MODEL

This model has five phases :


 Requirement analysis and specification.
 Design
 Implementation and unit Testing
 Integration and system testing.
 Operation and maintenance.

The phases always occur in this order that they do not overlap. The developer
must complete each phase before the next phase begins. This model is named
“Waterfall Model” because its diagrammatic representation resembles a cascade of
waterfalls.

22
Requirement analysis
and specification

Design

Implementation and
unit testing

Integration and system


Testing

Operation and
Maintenance

23
 REQUIREMENT ANALYSIS AND SPECIFICAION PHASE

The goal of this phase is to understand the exact requirements of the


customer and to documents them properly. This activity is usually executed together
with the customer, as the goal is to document all functions, performance and
interfacing requirements for the software. The requirements describe the “what” of a
system, not the “how”. This phase produces a large document, written in a natural
language, contains a description of what the System will do without describing how
it will be done. The resultant document is known as software requirement
specification document (SRS).

 DESIGN PHASE:

The SRS document contains the exact requirements of the customer. The
goal of this phase is to transform the requirements specification into a structure that
is suitable for implementation in some programming language. Here overall
software architecture is defined, and the high level and detailed design work is
performed. This work is documented and known as software design description
(SDD) document. The information contained in the SDD should be sufficient to
begin the coding phase.

 IMPLEMENTING AND UNIT TESTING PHASE :

During this phase, design is implemented. If the SDD is complete, the


implementation or coding phase proceeds smoothly, because all the information
needed by the software developers is contained in SDD. During testing, the major
activities are centered the exam and modification of code. Initially, small modules
are tested in isolation from the rest of the software product. The problem that are
encountered while testing a module in isolation are solved in this phase and modules
are tested after writing some overhead code.

 INTEGRATION AND SYSTEM TESTING PHASE :

This is a very important phase effective testing will contribute to the delivery
of higher quality software products, more satisfied users, lower maintenance costs
and more accurate and reliable results. Unit testing is used for implementing each
independent module correctly, due to which there are less chances that whether the
interface between modules are correct, for this reason integration testing is
performed. System testing involves the testing of the entire System, where as
software is the part of the System.

24
 OPERATION AND MAINTENANCE PHASE :

Software maintenance is a task that every development group has to face,


when the software is delivered to the customer’s site, installed and is operational.
Therefore, release of software inaugurates the operation and maintenance phase of
the life cycle. Software maintenance includes error correction, enhancement of
capabilities, deletion of obsolete capabilities and optimization. The purpose of this
phase is to preserve the value of the software over time

MODEL CHOSEN

The model chosen for this project is “Waterfall Model” because of the
following reasons:-

ADVANTAGES OF WATERFALL MODEL

 It can serve as a useful process model in situations where requirements are


fixed and work is to proceed to completion in a linear manner.
 Testing is inherent to every phase of the waterfall model.
 It is a simple and elegant model which can be used in testing projects.
 It is an enforced disciplined approach
 It is not costly
 It is documentation driven, i.e. documentation is produced at every stage.

25
FEASIBILITY STUDY

All the projects are feasible given unlimited resources and infinite time.
Unfortunately, the development of a computer based system is more likely to be
played by a scarcity of resources and difficult delivery date. It is both necessary and
prudent to evaluate the feasibility of a project at the earliest possible time. In the
development of the present project, no such limitation was imposed that was not
feasible, s all the resources where easily available and time given was sufficient
enough.

OBJECTIVES OF FEASIBILITY STUDY

 What are the problems with conventional System?

This involves question such as whether the technology needed for the system
exists, how difficult it will be to build and whether the firm has enough experience
using that technology.
The software made is on C++ which is a very common language, so we can
get the experienced persons in it very easily.

1. ECONOMIC FEASIBILITY

This involves questions such as whether the form can afford to built the
system, whether its benefits should substantially exceed its costs, and whether the
project has higher priority and profits than other projects that might use the same
resources.
Since, our project is made on C++ it is not very costly as it is very common
available software. We don’t need any extra software or hardware requirements or
any GUI (Graphic user interface)

2. TECHNICAL FEASIBILITY

This involves question such as whether the technology needed for the system
exists, how difficult it will be to build and whether the firm has enough experience
using that technology.
The software made is on C++ which is a very common language, so we can
get the experienced persons in it very easily.

26
3. LEGAL FEASIBILITY

All projects must face legal scrutiny. When an organization either has legal
council on staff or on retainer, such reviews are typically standard. However, any
project may face legal issue after completing too. Our software is legally feasible.

4. ORGANISATIONAL FEASIBILITY

This involves question such as whether the System has enough support to be
implemented successfully, whether it brings an excessive amount of change, and
whether the organization is changing too rapidly to absorb it.
Since, it is a very small project its purpose is for submission of BCA (3 year)
degree and all the members are equally include for the submission of project. So,
there is a good Coordinating among all the members.

5. ENVIRONMENTAL FEASIBILITY

People are inherently resistant to change and computers have been known to
facilitate change. An estimate should be made of how strong a reaction the user staff
is likely to have towards the development of a computerized system.

27
SCHEDULING

Scheduling of a software project does not greatly from scheduling of any


multitask engineering effort. Therefore, generalized project scheduling tools and
techniques can be applied with little modification for software projects.
Program Evaluation and Review technique (PERT) and the critical path
method (CPM) are two project scheduling methods that can be applied to software
development. Both technique are driven by information already developed in
earlier project planning activities.
• Estimated of effort.
• A Decomposition of the product function model and task set.
• Decomposition of tasks.

Interdependencies among tasks may be defined using a task network. Tasks,


sometimes called the project work breakdown structure (WBS), are defined for the
product as a whole or for individual functions.
Both PERT and CPM provide quantitative tools that allow the software planner
to (1)Determines the critical path the chain of tasks that determines the duration of
the project; (2) Establish most likely time estimates for individual tasks by applying
statistical models; and (3) Calculate “Boundary times” that define “window” for a
particular task.

PERT CHART

The program (or project) Evaluation and review Technique (PERT) is


a model for a project management designed to analyze and represent the tasks
involved in completing a given project.

T=1mo t=3mo

D F
T=2mo
T=3mo

A E
B
T=4mo C T=3mo

28
PERT model was invented by BOOZ Allen Hamilton, inc. under contract of
United States Department of Defence’s US NAVY special projects office in 1958 as
a part of the Polaris mobile submarine launched ballistic missile project
PERT was developed primarily to simplify the planning and scheduling of
large and complex projects.

BENEFITS OF PERT

PERT is useful because of the following reasons:


• Expected project completion time.
• Probability of completion before a specified date.
• Critical path activities that directly impart the completion
time.
• The activities that have stack time and that can lend resources
to critical path activities.
• Activity start and end dates.

LIMITATIONS OF PERT

Some of PERT Weakness are:-


 The activity time estimates are somewhat subjective and depend
judgment. In cases where there is little experience in performing an activity, the
numbers may be only a guess. In other cases, if the person or group performing the
activity estimates the time there may be bias in the estimate.
 Even if the activity times are well-estimated, PERT assumes a
beta distribution for these time estimates, but the actual distribution may be
different.
 Even if the beta distribution assumption holds, PERT assumes
that the portability distribution of the project completion time is same as that of the
critical path because other parts can become the critical path because other parts can
become the critical path if there is associated are delayed, PERT consistently
underestimates the expected project completion time.

STEPS IN PERT PLANING PROGRESS

PERT planning involves the following steps:-


1) Identify the specific activities & milestone.
2) Determines the proper sequence of the activities.
3) Construct a network diagram.
4) Estimate the time required for each activity.

29
5) Determine the critical path.
6) Update the PERT chart as the project progresses.

GANTT CHART

A timeline chart, also called Gantt chart is a graphical representation of


time. A Gantt chart is a useful tool for planning & scheduling project.
A Gantt chart is helpful when monitoring a project’s progress.

PLANNIG AND SCHEDULING

o A Gantt chart allows you to asses how long a project should take.
o A Gantt chart lays out the order in which tasks need to be carried
out.
o A Gantt chart helps manage the dependencies between tasks.

MONITORING A PROJECT
o A Gantt chart allows you to see immediately what should have been achieved
at a point in time.
o A Gantt chart allows you to see how remedial action may bring the
project back on course.

A Gantt chart is constructed with a horizontal axis representing the total


time span of the project, broken down into increments (days, weeks or months)

TIMELINE/GANTT CHART

A figure illustrates the format of a timeline chart. It depicts a part of a software


project schedule that emphasizes the concept scoping task for a word-processing
(WPS) software product. All project tasks (for concept scoping) are listed in the lefts-
hand column. The horizontal bars indicate the duration of each task. Where multiple
bars occur at the same time on the calendar, task concurrency is implied. The
diamonds indicates milestone.

30
Time in days
0 15 30 45 60 75 90 105 120
Activity
1. v

1.1
1.2
1.3
1.4
v
2.
2.1
2.2
2.3
2.4

3 v

4 v

5 v

Form Prog Link Testing


Design Design Establishment

31
32
Important factors to be considered while working on interfaces:

• Use of a consistent format for menu, command input, and data


display.
• Provide the riser with visual and auditory feedback to ensure that
two-communication is established.
• Provide undo or reversal functions.
• Reduce the amount of information that must be memorized
between actions.
• Provide help facilities that are context sensitive.
• Use simple action verbs or short verb phrases to name
commands.
• Display only that information that is relevant to the current context.
• Produce meaningful error messages.
• Use upper and lower case, indentation, and text grouping to aid in
understanding.
• Minimize the number of input actions required of the user.

Maintain consistency between information display and data input.


The visual characteristics of the display (e.g., text size, color, and
placement) should be carried over to the input domain.

Interaction should be flexible but also tuned to user's preferred mode


of input.

Deactivate commands that are inappropriate in the context of current


actions.

Provide help to assist with all input actions.

Now that we are familiar with the various design elements, let us take
a look at the modeling techniques that are used for designing the
systems. Data Flow Diagrams are used for functional modeling. As
the name suggests, it is a diagram depicting the flow of data through
the system. In the next section, we'll explore this technique in detail.

33
A Data Flow Diagram (DFD) is used to describe the logical operation
of a system, i.e. what a system does. DFD shows the flow of data
through a system and the work or processing performed by, that
system

DFDs only represent the flow of data through the system and do not
describe the physical functioning of' the system. DFDs are basically
of 2 types: Physical and logical ones. Physical DFDs are used in the
analysis phase to study the functioning of the current system. Logical
DFDs are used in the design phase for depicting the flow of data in
proposed system.

Elements of Data Flow Diagrams

Data Flow Diagrams are composed of the four basic symbols shown
below.

• The External Entity symbol represents sources of data to the


system or destinations of data from the system.
• The Data Flow symbol represents movement of data,
• The Data Store symbol represents data that is not moving
(delayed data at rest).
• The Process symbol represents an activity that transforms or
manipulates the data (combines, reorders, converts, etc.).

Any system can be represented at any level of detail by these four


symbols.

Processes
Processes are work or actions performed on incoming data flows to
produce outgoing data flows. These show data transformation or
change. Data coming into a Process must be "worked on" or
transformed in some way. Thus, all processes must have inputs and
outputs. In some (rare) cases, data inputs or outputs will only be

34
shown at more detailed levels of the diagrams. Each process in
always "running" and ready to accept data.

Major functions of processes are computations and making decisions.


Each process may have dramatically different timing: yearly, weekly,
daily.

Naming Processes

Processes are named with one carefully chosen verb and an object of
the verb. There is no subject. Name is not to include the word
"process". Each process should represent one function or action. If
there is an "and" in the name, you likely have more than one function
(and process). For example, get invoice update customer and create
Order

Processes are numbered within the diagram as convenient. Levels of


detail are shown by decimal notation. For example, top level process
would be Process 14, next level of detail Processes 14.1-14.4, and
next level with Processes 14.3.1-14.3.6.

Processes should generally move from top to bottom and left to right.
External entities
External entities determine the system boundary. they are external to the
system being studied. They are often beyond the area of Influence of the
developer. These can represent another system or Subsystem. These go on
margins/edges of data flow diagram.
External entities are named with appropriate name.

Data Flow

Data flow represents the input (or Output) of data to (or from) a
Process ("data in motion"). Data flows only data, not control.
Represent the minimum essential data the process needs. Using
only the minimum essential data reduces the dependence between
processes. Data flows must begin and/or end at a process.

35
Data flows are always named. Name is not to include the word "data".
Should be given unique names. Names should be some identifying noun.
For example, order, payment, complaint.

Data stores

Data Stores are repository for data that are temporarily or


permanently recorded within the system. It is an "inventory" of data.

These are common link between data and process models. Only
processes may connect with data stores.

There can be two or more systems that share a data store. This can
occur in the case of one system updating the data store, while the
other system only accesses the data.

Data stores are named with an appropriate name, not to include the
word "file", Names should consist of plural nouns describing the
collection of data. Like customers, orders, and products.

These may be duplicated. These are detailed in the data dictionary


or with data description diagrams.

36
DFD Showing rank calculation process of a university

CGP Rules Result Data


Data Stores Store

Rank Status
Marks Comput Comput
e CGP e
CGP Rank

Different Levels of DFDs


The DFD may be used to represent a system or software at any level
of abstraction. In fact, DFDs may be partitioned into levels that
represent increasing information flow and functional details.

A 0 level DFD, also called a context model, represents the entire


software elements as a single bubble with input and output data
indicated by incoming and outgoing arrows, respectively. Additional
processes and information flow paths are represented as the 0 level
DFD is partitioned to reveal more information. For example, a 1 level
DFD might contain five or six bubbles with interconnecting arrows.

37
Making DFDs

Data Flow Diagramming is a means of representing a system at any


level of detail with a graphic network of symbols showing data flows,
data stores, data processes, and data sources/destinations.

The goal of data flow diagramming is to have a commonly understood


model of a system. The diagrams are the basis of structured systems
analysis. Data flow diagrams are supported by other techniques of
structured systems analysis such as data structure diagrams, data
dictionaries, and procedure-representing techniques such as decision
tables. decision trees, and structured English.

The purpose of data flow diagrams is to provide a semantic bridge


between users and systems developers. The diagrams are graphical,
eliminating thousands of words. These are logical representations,
modeling what a system does, rather than physical models showing
how it does it. DFDs are hierarchical, showing systems at any level
of detail. Finally, it should be jargon less, allowing user
understanding and reviewing.

Also, data flow diagrams have the objective of avoiding the cost of :

• user/developer misunderstanding of a system, resulting in a


need to redo systems or in not using the system.

• having to start documentation from scratch when the physical


system changes since the logical system, what gets done, often
remains the same when technology changes.

• systems inefficiencies because a, system gets "computerized"


before it gets systematized".

• being unable to evaluate system project boundaries or degree


of automation, resulting in a project of inappropriate scope.

38
The procedure for producing a data flow diagram is to:

• identify and list external entities providing inputs/receiving


outputs from system;
• identify and list inputs from/outputs to external entities;
• Draw a context DFD
Defines the scope and boundary for the system and project
1. Think of the system as a container (black box)
2. Ignore the inner workings of the container
3. Ask end-users for the events the system must respond to
4. For each event, ask end-users what responses must be produced
by the
system
5. Identify any external data stores
6. Draw the context diagram
 Use only one process
 Only show those data flows that represent the main
objective or most common inputs/outputs

• identify the business functions included within the system


boundary;
• identify the data connections between business functions;
• confirm through personal contact sent data is received and
vice-versa";
• trace and record what happens to each of the data flows
entering the system (data movement, data storage, data
transformation/processing)
• Draw an overview DFD
 Shows the major subsystems and how they interact
with one another
 Exploding processes should add detail while
retaining the essence of the details from the more
general diagram
 Consolidate all data stores into a composite data
store

39
• Draw middle-level DFDs
 Explode the composite processes

• Draw primitive-level DFDs


 Detail the primitive processes
 Must show all appropriate primitive data stores and
data flows

• Verify all data flows have a source and destination,


• Verify data coming out of a data store goes in,
• review with "informed",
• explode and repeat above steps as needed.

Balancing DFDs

• Balancing: child diagrams must maintain a balance in data


content with
their parent processes
• Can be achieved by either:

• exactly the same data flows of the parent process enter and
leave the child diagram, or

• the same net contents from the parent process serve as the
Initial inputs and final outputs for the child diagram or

• the data in the parent diagram is split in the child diagram

Rules for Drawing DFDs


· A process must have at least one input and one output data flow
· A process begins to perform its tasks as soon as It receives the
necessary input data flows
· A primitive process performs a single well-defined function
· Never label a process with an IF-THEN statement
· Never show time dependency directly on a DFD
· Be sure that data stores, data flows, data processes have descriptive
titles. Processes should use imperative verbs to project action.
· All processes receive and generate at least one data flow.

40
· Begin/end data flows with a bubble.

Rules for Data Flows

1. A data store must always be connected to a process


2. Data flows must be named
3. Data flows are named using nouns
.Customer ID, Student information

4. Data that travel together should be one data flow


5. Data should be sent only to the processes that need the data

Use the following additional guidelines when drawing DFDS.

Identify the kev processing steps in a system. A processing step is


an activity that transforms one piece of data into another form.

Process bubbles should be arranged from top left to bottom right of


page.

Number each process ( 1.0, 2.0, etc). Also name the process with a
verb that describes the information processing activity.

Name each data flow with a noun that describes the information
going into and out of a process. What goes in should be different
from what comes out,

Data stores, sources and destinations are also named with nouns.

Realize that the highest level DFD is the context diagram. It


summarizes the entire system as one bubble and shows the inputs
and outputs to a system

Each lower level DFD must balance with its higher level DFD. This
means that no inputs and outputs are changed.

Think of data flow not control flow- Data flows are pathways for data.
Think about what data is needed to perform a process or update a data store.
A data flow diagram is not a flowchart and should not have loops or transfer

41
of control. Think about the data flows, data processes, and data storage that
are needed to move a data structure through a system.

Do not try to put everything you know on the data flow diagram. The
diagram should serve as index and outline. The index/outline will be
"fleshed out" in the data dictionary, data structure diagrams, and
procedure specification techniques.

42
43
E-R Diagrams

E-R Diagram of the store

Description

Profi
t Rac
k

Cos
t STORE
Product
ID
Tot
cabni
al
t

Purchase Quantity
Sal
e

The entities of the STORE are:


1) Description
2) Rack
3) Product ID
4) Cab nit
5) Quantity
6) Sale
7) Total
8) Cost
9) Profit

44
E-R Diagram of purchase

Description
Cost
Rack

Quantity
Purchase

Cabnit
Unit

Product ID

The entities of Purchase:


1) Description
2) Rack
3) Product ID
4) Cab nit
5) Quantity
6) Cost
7) Unit

45
E-R Diagram of Sale

Description
Cost
Rack

Sale
Quantity

Cabnit
Unit

Product ID

The entities of Sale:


1) Description
2)Rack
3)Product ID
4)Cab nit
5)Quantity
6)Cost
7)Unit

46
E-R DIAGRAMS

E-R Model concept

The ER data modeling techniques is based on the perception of a real world


that consists of a set of basic objects called entities, and of relationships
among these objects.
In ER modeling, data is described as entities, relationships, and attributes.
In the following section, entities and attributes are discussed. Later, entity
types, their key attributes, relationship types, their structural constraints, and
weak entity types are discussed. In the last, we will apply ER modeling to
our case study problem "Library management system".

Entities and Attributes

One of the basic components of ER model is entity. An entity is any


distinguishable object about which information is stored. These objects can
be person, place, thing, event or a concept. Entities contain descriptive
information. Each entity is distinct.

An entity may be physical or abstract. A person, a book, car, house,


employee etc. are all physical entities whereas a company, job, or a
university course, are abstract entities.

Physical and Abstract entity:-

Employee Loan

Physical Abstract

Another classification of entities can be independent or dependent (strong or


weak)entity.

47
Entities are classified as independent or dependent (in some methodologies,
the terms used are strong and weak, respectively). An independent entity is
one, which does not rely on another entity for identification. A dependent
entity is one that relies on another entity for identification. An independent
entity exists on its own whereas dependent entity exists on the existence of
some other entity. For example take an organization scenario. Here
department is independent entity. Department manager is a dependent
entity. It exists for existing depts. There won’t be any department manager
for which there is no dept.

Some entity types may not have any key attributes of their own. These are
called weak entity types. Entities belonging to a weak entity type are
identified by being related to specific entities from another entity type in
combination with some of their attribute values. For example, take the
license entity. It can't exist unless it is related to a person entity.

Attributes

After you identify an entity, then you describe it in real terms, or through its
attributes. Attributes are basically properties of entity. We can use
attributes for identifying and expressing entities. For example, Dept entity
can have DeptName, DeptId, and

DeptManager as its attributes. A car entity can have modeino, brand name,
and color as its attributes.

A particular instance of an attribute is a value. For example, "Bhaskar" is


one value of

the attribute Name. Employee number 8005 uniquely identifies an employee


in a company.

Types of Attributes

Attributes can be of various types. In this section, we'll look at different


types of attributes. Attributes can be categorized as:

48
• Key or non key attributes
• Required or optional
• Simple or composite
• Stored or derived

Key or non-key attributes

Attributes can be classified as identifiers or descriptors. Identifiers, more


commonly called keys or key attributes uniquely identify an instance of an
entity. If such an attribute doesn't exist naturally, a new attribute is defined
for that purpose, for example an ID number or code. A descriptor describes
a non-unique characteristic of an entity instance.

An entity usually has an attribute whose values are distinct for each
individual entity. This attribute uniquely identifies the individual entity.
Such an attribute is called a key attribute. For example, in the Employee
entity type, EmpNo is the key attribute since no two employees can have
same employee number. Similarly, for Product entity type, prodded is the
key attribute.

There may be a case when one simple attribute is not sufficient to identify
entities. Then a combination of attributes can solve this purpose. We can
form a group of more than one attribute and use this combination as a key
attribute. That is known as a composite key attribute. When identifying
attributes of entities, identifying, key attribute is very important.

Attributes that describe an entity are called non-key attributes.

Required or optional

An attribute can be required or optional When it's required, we must have a


value for it, a value must be known for each entity occurrence. When it's
optional, we could have a value for it, a value may be known for each entity
occurrence. For example, there is an attribute Employ (for employee no) of
entity employee. This is required attribute since

49
here would be no employee having no employee no. Employee's spouse is
optional attribute because a employee may or may not have a spouse.

Simple and composite

Composite attributes can be divided into smaller subparts. These subparts


represent basic attributes with independent meanings of their own. For
example, take Name attributes. We can divide it into subparts like First
name, Middle name, and Last name.

Attributes that can't be divided into subparts are called Simple or Atomic
attributes. For example Employee Number's a simple attribute. Age of a
person is a simple attribute.

Entity Types

An entity set is a set of entities of the same type that share the same
properties, or attributes. For example, all software engineers working in the
department involved in the Internet projects can be defined as the entity set
internet group. The individual entities that constitute a set are called
extension of the entity, set. Thus, all individual software engineers of in the
Internet projects are the extensions of the entity set IntemetGroup.
Entity sets don't need to be disjointed. For example, we can define an entity
set Employee. An employee may or may not be working on some Internet
projects. In Internet Group we will have some entries that are there in
Employee entity set. Therefore, entity sets Employee and Internet Group are
not disjoint.

A database usually contains groups of entities that are similar. For example, employees
of a company share the same attributes. However, every employee entity has its own
values for each attribute. An entity type defines a set of entities that have same
attributes. A name and a list of attributes describe each entity type.

An entity type is represented in ER diagrams as rectangular box and the


corresponding attributes are shown in ovals attached to the entity type by
straight lines.

50
An entity type is basically the schema or intension or structure for the set of
entities that share the same structure whereas the individual entities of a
particular entity type are collectively called entity set. 'I’ lie entity set is also
called the extension of the entity type.

Connectivity and Cardinality


By connectivity we mean how many instances of one entity are associated
with how many instances of other entity in relationship Cardinality is used to
specify such connectivity. I

The connectivity of a relationship describes the mapping of associated entity instances in


the relationship. The values of connectivity are Alone" or lemony". The cardinality of a
relationship is the actual number of related occurrences for each of the two entities. The
basic types of connectivity for relations are: one-to-one, one-to-many, and many-to-
many.

A one-to one (1: 1) relationship is when at most one instance of an entity A


is associated with one instance of entity B. For example, each book in a
library is issued to only one member at a particular time.
A one-to-many (1:N) relationship is when for one instance of entity A, there are zero,
one, or many instances of entity B but for one instance of entity B, there is only one
instance of entity A. An example of a I:N relationships is a department has many
employees; each employee is assigned to one department.

A many-to-many (M:N) relationship, sometimes called non-specific, is


when for one instance of entity A, there are zero, one, or many instances of
entity B and for one instance of entity B there are zero, one, or many
instances of entity A. An example is:-
employees may be assigned to no more than three projects at a time every
project has at least two employees assigned to it.

51
52
Flow Chart

Start
menu Menu
Choices 1) 7)
2) 8)
3) 9)
4) H
5) E
6)

Input choice

If
No yes 1
choice=
)
1)

2 yes 2)
)

No
yes
If
choice=3 3)
) No =1)

53
No

If Yes
choice=4)
4)

No

Yes
If 5)
choice=5)

No

Yes
If 6)
choice=6)

No

Yes
If 7)
choice=7)

No

54
Yes
If 8)
choice=8)

No

If
choice=9) 9)

55
Yes

56
No

Yes H
If
choice=H

No

If
choice=E
Wrong
choice No
entere
d

Yes

Stop

Choice=1)

Information

If 57If
Wrong choice
choice
choice General
MEN entered = 2Enter
=1 Items
Choice Edibles
U
Yes

Yes

No

Enter product
Id-
Enter
Choice=2)
Description-
Enter rack No-
Output
DoEnter
you want
58addNo-
Cabnit
more records(y/n)
Enter
TotalUnit Cost- Men
Enter
Price=Sales Price-
Purchase u
Yes
No

59
Choice=3)

Enter the Product


ID-

Yes Produ
If the record
matches ct
Sold

no

No In
Stock

Men
u

Choice=4)
60
Search a
Record

Enter the
choice for
search

If Search
choice=1 found Yes
)

No

If
choice=2 Search
Yes ) found

No

Men
u

61
Choice=5)

Delete
Records

Enter Delete
Option

If
Record
Yes choice=1
DeleteYes
)
Record

NOT
No
Found If
Record
choice=2
Delete
) Yes Yes

Men
No u

62
Choice=6)

View
Record

Enter Choice for


View

If View
choice=1 Sales
Yes ) record

No
If View
choice=2 Purchase
Yes
) record

View
If profit
No choice=3 record
)

Men
u No

63
Choice=8)

View Bar
Graph

Enter The
Option

If
View
choice=1
Bar
) Yes
Graph Of
Quantity

No
View
If
choice=2 Bar
) Graph Of
Yes Profit

Men
u No

64
Choice=9)

Retrieve
Record

View the
Last
Record

Me
nu

65
66
67
#include <stdio.h>
#include <conio.h>
#include <ctype.h>
#include <string.h>
#include <dos.h>
#include <math.h>
#include <time.h>
#include<stdlib.h>
#include <bios.h>
void show_mouse();
int t();
void edit();
void infor();
void entry();
void display();
void search();
void search_id();
void search_name();
void del();
void deletion();
void deletion_id();
void print();
void help();
void eat();
void general();
void exit();
void seteefect(int, int);
void graph();
void bar(int inscor);
void graph2();
void bar2(int inscore2);
void report();
void report2();
void report3();
void pur();
void graph1();
void design();
void bbox();
void ventry(char t[],int);

struct shop
{
char desc[20];
int rack;
char ch;
int cabnit;

68
int quantity;
float sale;
char id[6];
float total;
float unit;
float cost;
float profit;
float bye;
int qty;
int ost;
int b;
};

struct shop temp;


struct shop x[20];
FILE *ptr;
//int age;
char a[10];
/************************************displays information
about the cars***************************/

void infor()
{
int sher;
clrscr();
textcolor(BLUE);
gotoxy(13,3);
printf("\xDB\xDB\xDB\xDB\xB2 INFORMATION ABOUT
PRODUCTS \xB2\xDB\xDB\xDB\xDB");
gotoxy(2,5);
printf("THIS SECTION IS TO TELL WHAT KIND OF PRODUCTS
ARE THERE IN STORE");
printf("\n\nENTER THE OPTION WHICH SUITS YOU.\n");
printf("\n\n1.EDIBLES.\n\n");
printf("\n2.GENERAL ITEMS.\n\n");
printf("\n\n\n\n\nOPTION:");
sher=toupper(getch());
//

switch(sher)
{
case '1':
eat();
break;

case '2':
general();

69
break;

default:
gotoxy(8,21);
cprintf("\awrong entry press any key to go main
menu..");
}
getche();

void eat()
{
clrscr();

printf("***************************************************
************\n");
printf(" ID : 123. JAM COMPANY : MITUCHELS
RACK NO 24 \n");
printf(" ID : 124. HONEY COMPANY : PAK PURE
RACK NO 25\n");
printf(" ID : 125. MILK COMPANY : HALEEB
RACK NO 26\n");
printf(" ID : 126. BREAD COMPANY : WONDER
RACK NO 27\n");
printf(" ID : 127. CHEES COMPANY : JUNAID
RACK NO 28\n");
printf(" ID : 128. JUICE COMPANY : SONS
RACK NO 29\n");
printf(" ID : 129. PEPSI COMPANY : MAJEED
RACK NO 30 \n");
printf(" ID : 130. BUTTER COMPANY : JAFFAR
RACK NO 31 \n");
printf(" ID : 131. ICECREAM COMPANY : POLKA
FREEZER 32 \n");

printf("***************************************************
***********\n\n");
printf("Press any key to continue......");
getche();
clrscr();
printf(" ID : 133. MILO COMPANY : MITUCHELS
RACK NO 24 \n");
printf(" ID : 134. KEY BRAN COMPANY : PAK PURE
RACK NO 25\n");
printf(" ID : 135. TANG COMPANY : HALEEB
RACK NO 26\n");

70
printf(" ID : 136. ALWAYS COMPANY : WONDER
RACK NO 27\n");
printf(" ID : 327. PEPPARS COMPANY : JUNAID
RACK NO 28\n");
printf(" ID : 138. JHERBAL COMPANY : SONS
RACK NO 29\n");
printf(" ID : 139. PEPSI COMPANY : MAJEED
RACK NO 30 \n");
printf(" ID : 130. ORAGD COMPANY : JAFFAR
RACK NO 31 \n");
printf(" ID : 131. ICECREAM COMPANY : POLKA
FREEZER 32 \n");

printf("***************************************************
***********\n");
printf(" ID : 143. SHAMPO COMPANY : MITUCHELS
RACK NO 24 \n");
printf(" ID : 144. AGRI COMPANY : PAK PURE
RACK NO 25\n");
printf(" ID : 145. TIMO COMPANY : HALEEB
RACK NO 26\n");
printf(" ID : 146. WASHSN COMPANY : WONDER
RACK NO 27\n");
printf(" ID : 147. LACE COMPANY : JUNAID
RACK NO 28\n");
printf(" ID : 428. YARDLY COMPANY : SONS
RACK NO 29\n");
printf(" ID : 149. MUSK COMPANY : MAJEED
RACK NO 30 \n");
printf(" ID : 140. BUTTER COMPANY : JAFFAR
RACK NO 31 \n");
printf(" ID : 141. IMPERIAL COMPANY : POLKA
FREEZER 32 \n");

printf("***************************************************
***********\n");
printf("\n\nPress enter to return to main menu");
}

void general()
{
clrscr();

printf("***************************************************
************\n");
printf(" ID : 153. DETOL COMPANY : MITUCHELS
RACK NO 24 \n");

71
printf(" ID : 154. SHAMPO COMPANY : PAK PURE
RACK NO 25\n");
printf(" ID : 155. FINERRE COMPANY : HALEEB
RACK NO 26\n");
printf(" ID : 156. CURTIS COMPANY : WONDER
RACK NO 27\n");
printf(" ID : 157. NIVKA COMPANY : JUNAID
RACK NO 28\n");
printf(" ID : 158. NIVCA COMPANY : SONS
RACK NO 29\n");
printf(" ID : 159. DETOL COMPANY : MAJEED
RACK NO 30 \n");
printf(" ID : 150. BUTTER COMPANY : JAFFAR
RACK NO 31 \n");
printf(" ID : 151. SHAVE COMPANY : POLKA
FREEZER 32 \n");

printf("***************************************************
************\n\n");
printf("Press any key to continue......");
getche();
clrscr();
printf(" ID : 163. ADDIS COMPANY : MITUCHELS
RACK NO 24 \n");
printf(" ID : 164. SKIN COMPANY : PAK PURE
RACK NO 25\n");
printf(" ID : 165. MAX COMPANY : HALEEB
RACK NO 26\n");
printf(" ID : 166. BRESCO COMPANY : WONDER
RACK NO 27\n");
printf(" ID : 167. ZABIT COMPANY : JUNAID
RACK NO 28\n");
printf(" ID : 168. COPEX COMPANY : SONS
RACK NO 29\n");
printf(" ID : 169. SOAP COMPANY : MAJEED
RACK NO 30 \n");
printf(" ID : 160. PAMOLI COMPANY : JAFFAR
RACK NO 31 \n");
printf(" ID : 161. AVA COMPANY : POLKA
FREEZER 32 \n");

printf("***************************************************
************\n");
printf(" ID : 163. CAMY COMPANY : MITUCHELS
RACK NO 24 \n");
printf(" ID : 164. SAFE COMPANY : PAK PURE
RACK NO 25\n");

72
printf(" ID : 165. GUARD COMPANY : HALEEB
RACK NO 26\n");
printf(" ID : 166. DOVE COMPANY : WONDER
RACK NO 27\n");
printf(" ID : 167. REXONA COMPANY : JUNAID
RACK NO 28\n");
printf(" ID : 168. TOUCNME COMPANY : SONS
RACK NO 29\n");
printf(" ID : 169. FORHANS COMPANY : MAJEED
RACK NO 30 \n");
printf(" ID : 160. SIGNAL2 COMPANY : JAFFAR
RACK NO 31 \n");
printf(" ID : 161. CLOSEUP COMPANY : POLKA
FREEZER 32 \n");

printf("***************************************************
************\n");
printf("\n\nPress enter to return to main menu");

///////////////////////////////
time ///////////////////////////
int t(void)
{
time_t t;

time(&t);
// clrscr();
gotoxy(15,21);
printf("Date and time: %s\n", ctime(&t));
return 0;
}

/////////////////////////////////////
validation //////////////////////////
void ventry(char t[],int code)
{
int i=0;
if(code==0)
{

while((t[i]=getch())!='\r' && i<30)


if((t[i]>=97 && t[i]<=122) || (t[i]>=65 && t[i]<=90)
|| t[i]==32 || t[i]==8)
{ printf("%c",t[i]);
i++;

73
}
}
else if(code==1)
{
while((t[i]=getch())!='\r' && i<10)
if((t[i]>=48 && t[i]<=57) || t[i]==46 || t[i]==8 )
{ printf("%c",t[i]);
i++;
}
}
t[i]='\0';
}

/******************************data
entry***********************************/

void entry()
{
char ch;
clrscr();

ptr=fopen("shop.dat","a+b");
ch='y';
while(ch=='y')
{
clrscr();
design();
textcolor(16);
t();
gotoxy(14,3);
cprintf("\xDB\xDB\xDB\xDB\xDB\xB2 PURSHASE
\xB2\xDB\xDB\xDB\xDB\xDB ");
{

gotoxy(7,5);
cprintf("\xDB\xDB\xB2 ENTER PRODUCT ID : ");
ventry(temp.id,1);
//
flushall();
gotoxy(7,7);
cprintf("\xDB\xDB\xB2 ENTER DESCRIPTION : ");
ventry(temp.desc,0);
flushall();
gotoxy(7,9);
cprintf("\xDB\xDB\xB2 ENTER RACK NO : ");
ventry(a,1);

74
temp.rack= atoi(a);

flushall();
gotoxy(7,11);
cprintf("\xDB\xDB\xB2 ENTER CABNIT NO : ");
ventry(a,1);
temp.cabnit= atoi(a);

//
flushall();
gotoxy(7,13);
///////////////////////
cprintf("\xDB\xDB\xB2 ENTER UNIT COST :$ ");
ventry(a,1);
temp.unit= atof(a);
flushall();

gotoxy(7,15);
cprintf("\xDB\xDB\xB2 ENTER SALE PRICE :$ ");
ventry(a,1);
temp.sale= atof(a);
flushall();

gotoxy(7,17);
cprintf("\xDB\xDB\xB2 ENTER QUANTITY : ");
ventry(a,1);
temp.quantity= atoi(a);
flushall();

gotoxy(7,18);
cprintf("=====================================");
temp.total=temp.quantity*temp.sale;

textcolor(10);
gotoxy(10,20);
cprintf("\xB2\xDB\xB2 TOTAL PRICE = $
%.2f",temp.total);
temp.cost=(temp.unit*temp.quantity);
gotoxy(40,20);
cprintf("\xDB\xB2 TOTAL COST = $ %.2f",temp.cost);

}
fwrite(&temp,sizeof(temp),1,ptr);
textcolor(10);
gotoxy(10,23);
cprintf("More entries [y/n]");
ch=getche();

75
}
fclose(ptr);

/*****************************data
retreivel********************************/

void display()
{

clrscr();
ptr=fopen("shop.dat","rb");
while ((fread(&temp,sizeof(temp),1,ptr))==1)

{
gotoxy(22,3);
printf("\xDB\xDB\xDB\xB2\xB2 RETRIEVE RECORD
\xB2\xB2\xDB\xDB\xDB");
gotoxy(18,5);
printf("\xDB\xDB\xB2 DESCRIPTION : %s",temp.desc);
gotoxy(18,7);
printf("\xDB\xDB\xB2 ID NUMBER : %s",temp.id);
gotoxy(18,9);
printf("\xDB\xDB\xB2 RACK NO : %d",temp.rack);
gotoxy(18,11);
printf("\xDB\xDB\xB2 CABNIT NO : %d",temp.cabnit);
gotoxy(18,13);
printf("\xDb\xDB\xB2 UNIT COST :$ %.2f",temp.unit);
gotoxy(18,15);
printf("\xDB\xDB\xB2 SALE PRICE : $
%.2f",temp.sale);
gotoxy(18,17);
printf("\xDB\xDB\xB2 QUANTITY :
%d",temp.quantity);
gotoxy(16,18);
printf("===================================");
gotoxy(16,20);
printf("\xDB\xDB\xB2 TOTAL PRICE : $
%.2f",temp.total);
gotoxy(47,20);
printf("\xDB\xB2 TOTAL COST : $ %.2f",temp.cost);
gotoxy(20,23);
printf("Press Enter to see next if any or exit ...");

getche();

76
clrscr();

fclose(ptr);
//
}

/*******************************data
search*******************************/

void search()
{
int sh;
clrscr();
design();
gotoxy(17,6);
printf("\xDB\xDB\xB2 Two options available to
search \xB2\xDB\xDB");
gotoxy(15,9);
printf("[ 1 ] - Search by ID number .");
gotoxy(15,11);
printf("[ 2 ] - Search by Description .");
gotoxy(17,15);
printf("Enter your choice:: ");
sh=toupper(getch());

switch(sh)
{
case '1':
search_id();
break;

case '2':
search_name();
break;

default:
gotoxy(18,18);
printf("\a\xDB\xDB wrong entry try again");
getch();
}
getche();

77
/*****************************search by
id*********************************/

void search_id()
{
int flag=0;
char lkf[20];
clrscr();
ptr=fopen("shop.dat","rb");
design();
gotoxy(13,4);
printf("\xDB\xDB\xB2 Enter id to be searched:");
scanf("%s",&lkf);
while((!flag)&&(fread(&temp,sizeof(temp),1,ptr))==1)
{
if(strcmp(temp.id,lkf)==0)
flag=1;
}
if(flag)
{

gotoxy(18,6);
printf("Product ID : %s",temp.id);
gotoxy(18,8);
printf("Description : %s",temp.desc);
gotoxy(18,10);
printf("Rack no : %d",temp.rack);
gotoxy(18,12);
printf("Cabnit : %d",temp.cabnit);
gotoxy(18,14);
printf("Sale price :$ %.2f",temp.sale);
gotoxy(18,16);
printf("Quantity : %d",temp.quantity);
gotoxy(16,17);
printf("============================");
gotoxy(18,19);
printf(" Total :$ %.2f",temp.total);

}
else
printf("Record not found!");
fclose(ptr);
}

78
/*****************************search by
name******************************/

void search_name()
{
int flag=0;
char lkf[20];
clrscr();
ptr=fopen("shop.dat","rb");
design();
gotoxy(13,4);
printf("\xDB\xDB\xB2 Enter description to be
searched:");
scanf("%s",&lkf);
while((!flag)&&(fread(&temp,sizeof(temp),1,ptr))==1)
{
if(strcmp(temp.desc,lkf)==0)
flag=1;
}
if(flag)
{

gotoxy(18,6);
printf("Product ID : %s",temp.id);
gotoxy(18,8);
printf("Description : %s",temp.desc);
gotoxy(18,10);
printf("Rack no : %d",temp.rack);
gotoxy(18,12);
printf("Cabnit : %d",temp.cabnit);
gotoxy(18,14);
printf("Sale price :$ %.2f",temp.sale);
gotoxy(18,16);
printf("Quantity : %d",temp.quantity);
gotoxy(16,17);
printf("============================");
gotoxy(18,19);
printf(" Total :$ %.2f",temp.total);

}
else
printf("Record not found!");
fclose(ptr);
}

79
/******************************data
deletion*****************************/
void deletion()
{
int j,n,i;
char tar[30];
int count=0;

ptr = fopen("shop.dat","rb");
clrscr();
design();
gotoxy(17,10);
printf("\xDB\xDB Enter Description to be
deleted:");
scanf("%s",&tar);
j=0;

while((fread(&temp,sizeof(temp),1,ptr))==1)
{
if((strcmp(temp.desc,tar)<0) ||
(strcmp(temp.desc,tar)>0))
{
x[j] = temp;
j++;
}
else
{
count++;
}
}
if (count==0)
{
clrscr();
design();
gotoxy(30,10);
printf("\xDB\xDB Record Not Found");
gotoxy(17,23);
printf("Press Enter to go to MAIN MENU .....");
getch();
return;
}

fclose(ptr);
n = j;
clrscr();
ptr=fopen("shop.dat","wb");

80
for(i=0; i<n; i++)
fwrite(&x[i],sizeof(x[i]),1,ptr);
fclose(ptr);
clrscr();
design();
gotoxy(20,10);
printf("Record has been deleted");
gotoxy(20,12);
printf("Check it by going to the displayed
record");
gotoxy(17,23);
printf("Press Enter to go to MAIN MENU ......");
getch();

}
/******************************data
print*********************************/
void print()
{

clrscr();
putc('\n',stdprn);
fputs("\n\t\t\tREPRT OF SALES",stdprn);
putc('\n',stdprn);
fputs("===========================",stdprn);
putc('\n',stdprn);
putc('\n',stdprn);
fputs("PRODUCT ID. NAME. SALE PRICE. QUANTITY.
TOTAL PRICE",stdprn);
fputs("==================================================
=================",stdprn);
putc('\n',stdprn);
putc('\n',stdprn);

ptr=fopen("shop.dat","rb");
while( (fread(&temp,sizeof(temp),1,stdprn))==1)

{
fprintf(stdprn," %s",temp.id);
fprintf(stdprn,"\t%s",temp.desc);
fprintf(stdprn,"\t%.2f",temp.sale);
fprintf(stdprn,"\t%ld\n",temp.quantity);
fprintf(stdprn,"\t%.2f",temp.total);
}
fclose(ptr);

81
}

/
******************************help*************************
**************/

void help()
{
clrscr();
design();
textcolor(GREEN);
gotoxy(20,4);
cprintf("\xDB\xDB\xDB\xDB\xB2 HELP ABOUT THE PROGRAM
\xB2\xDB\xDB\xDB\xDB");
gotoxy(4,6);
cprintf(" [ 2 ] - ENTER RECORDS : THIS OPTION ALLOWS
THE USER TO ENTER NEW ");
gotoxy(30,7);
cprintf("RECORDS. USER ENTERS PRODUCT ID,
DESCRIPTION,");
gotoxy(30,8);
cprintf("QUANTITY AND UNIT PRICE. THE PROGRAMM
CALCULATES");
gotoxy(30,9);
cprintf("TOTAL PRICE AND DISPLAYS ON THE SCREEN.");
gotoxy(4,11);
cprintf(" [ 3 ] - ENTER SALES : THIS OPTION ALLOWS
THE USER TO SEE PREVIOUS ");
gotoxy(30,12);
cprintf("SALE RECORDS.");
gotoxy(4,14);
cprintf(" [ 4 ] - SEARCH PURCHASE : THIS OPTION ALLOWS
THE USER TO SEARCH SPECIFIC");
gotoxy(30,15);
cprintf("RECORD BY ENTERING ID OR 'DESCRIPTION'");
gotoxy(4,17);
cprintf(" [ 5 ] - DELETE PURCHASE : THIS OPTION ALLOWS
THE USER TO DELETE A SPECIFIC");
gotoxy(30,18);
cprintf("RECORD BY ENTERING ITS 'DESCRIPTION' OR ID");
gotoxy(6,23);
cprintf("Press any key to continue .............");

getche();
clrscr();
design();
textcolor(GREEN);

82
gotoxy(4,5);
cprintf(" [ 6 ] - VIEW REPORT : THIS OPTION ALLOWS
THE USER TO PRINT PREVIOUS");
gotoxy(30,6);
cprintf("SALE RECORDS ON PRINTER");
gotoxy(4,8);
cprintf(" [ 7 ] - PRINT RECORDS : THIS OPTION ALLOWS
THE USER TO PRINT RECORDS");
gotoxy(30,9);
cprintf("OM PRINTER.");
gotoxy(4,11);
cprintf(" [ 8 ] - VIEW GRAPH : THIS OPTION ALLOWS
THE USER TO VIEW GRAPH ");
gotoxy(30,12);
cprintf("OF QUANTITY.");
gotoxy(10,23);
printf("Press any key to go to the MAIN
MENU ........");

getche();
}

/***************************main
menu*************************************/
menu()
{
int x;
do{
{
clrscr();
design();
t();
textcolor(BLUE);
gotoxy(24,3);
cprintf("\xDB\xDB\xDB\xDB\xB2 DEPARTMANTAL STORE
\xB2\xDB\xDB\xDB\xDB");
gotoxy(3,4);

cprintf("--------------------------------------------------
------------------------");
gotoxy(35,5);
cprintf("MAIN MENU");
gotoxy(26,8);
cprintf(" 1 - INFORMATION ABOUT PRODUCTS
");
gotoxy(26,9);

83
cprintf(" 2 - ENTER PURCHASE RECORDS
");
gotoxy(26,10);
cprintf(" 3 - ENTER PRODUCTS TO BE SOLD
");
gotoxy(26,11);
cprintf(" 4 - SEARCH FOR RECORD
");
gotoxy(26,12);
cprintf(" 5 - DELETE RECORD FROM STORE DATABASE
");
gotoxy(26,13);
cprintf(" 6 - VIEW SALES , PURCHASE & PROFIT REPORT
");
gotoxy(26,14);
cprintf(" 7 - PRINT RECORDS
");
gotoxy(26,15);
cprintf(" 8 - BAR GRAPH OF QUANTITY / PROFIT
");
gotoxy(26,16);
cprintf(" 9 - RETRIEVE INFORMATION ");
gotoxy(26,17);
cprintf(" H - HELP
");
gotoxy(26,18);
cprintf(" E - EXIT
");
gotoxy(26,23);
//
cprintf("ENTER YOUR CHOICE :: ");
gotoxy(47,23);
x=toupper(getch());
switch(x)
{
case '1':
infor();
break;

case '2':
entry();
break;

case '3':
edit();
break;

84
case '4':
search();
break;

case '5':
del();
break;

case '6':
report2();
break;

case '7':
print();
break;

case 'h': case'H':


help();
break;

case'8':
graph1();
break;

case '9':
display();
break;

case 'e': case 'E':


exit(0);
break;

default:
clrscr();
design();
gotoxy(17,12);
printf("\a\xDB\xB2 WRONG ENTRY : PRESS ANY KEY AND
TRY AGAIN");
getche();
}
}
}while((x!='e')||(x!='E'));
return x;
}

void main()

85
{
textbackground(14);
show_mouse();
menu();
}
/************************************* graph
***********************************/

void graph()
{
int inscor=1;
char ch;
clrscr();
design();
gotoxy(20,23);
printf("Press enter to go to MAIN MENU .....");
textcolor(10);
gotoxy(15,4);
cprintf("************* GRAPH OF PRODUCT QUANTITY
*************");
textcolor(14);
gotoxy(3,5);
cprintf(" PRODUCT NAME");
ptr=fopen("shop.dat","rb");
while((fread(&temp,sizeof(temp),1,ptr))==1)
{

printf("\n \xBA %s \t:",temp.desc);


bar(inscor);

fclose(ptr);
getche();
}
void bar()
{
int j;
for(j=1;j<=temp.quantity;j++)
printf("\xDB");
printf(" %d",temp.quantity);
printf("\n");
}
/*********************************** view report
****************************/
void report()
{

86
char ch;
clrscr();
design();
gotoxy(20,23);
printf("Press Enter to go to MAIN MENU ........");
textcolor(GREEN);
gotoxy(25,4);
cprintf("\xDB\xDB\xDB\xDB\xDB\xB2 VIEW OF SALES
\xB2\xDB\xDB\xDB\xDB\xDB");
textcolor(RED);
gotoxy(4,7);
cprintf("PRODUCT ID. NAME. SALE PRICE.
QUANTITY. TOTAL PRICE");
gotoxy(4,9);
printf("=================================================
=======================");

ptr=fopen("shop.dat","rb");
while((fread(&temp,sizeof(temp),1,ptr))==1)

{
//
printf("\n \xBA %s\t",temp.id);
printf("\t%s",temp.desc);
printf("\t\t$%.2f",temp.sale);
// printf("\t\t%d",temp.qty);
printf("\t\t%d",temp.quantity);
// printf("\t\t%d",temp.bye);
printf("\t\t $%.2f",temp.total);

getche();
}
void seteffect(int b, int f)
{
clrscr();
textbackground(b);
textcolor(f);
}

/********************************** purchase report


**********************/

void pur()
{
char ch;

87
clrscr();
design();
show_mouse();
gotoxy(20,23);
printf("Press Enter to go to MAIN MENU ...........");
textcolor(GREEN);
gotoxy(25,4);
cprintf("\xDB\xDB\xDB\xDB\xDB\xB2 VIEW OF PURCHASES
\xB2\xDB\xDB\xDB\xDB\xDB");
textcolor(RED);
gotoxy(4,7);
cprintf("PRODUCT ID. NAME. UNIT PRICE.
QUANTITY. TOTAL COST");
gotoxy(4,9);
printf("=================================================
=======================");

ptr=fopen("shop.dat","rb");
while((fread(&temp,sizeof(temp),1,ptr))==1)
{
//
printf("\n \xBA %s\t\t",temp.id);
printf(" %s",temp.desc);

printf("\t\t4%.2f",temp.unit);
printf("\t\t%d",temp.quantity);
printf("\t\t $%.2f",temp.cost);
}
getche();
}

/*********************************** purchase graph


***********************/

void graph2()
{
int inscor2=1;
char ch;
clrscr();
design();
gotoxy(20,23);
printf("Pres Enter to go to MAIN MENU ...........");
textcolor(10);
gotoxy(15,4);
cprintf("************* GRAPH OF PROFIT *************");
textcolor(14);
gotoxy(4,5);

88
cprintf("PRODUCT NAME");
ptr=fopen("shop.dat","rb");
while((fread(&temp,sizeof(temp),1,ptr))==1)
{

printf("\n \xBA %s \t:",temp.desc);


bar2(inscor2);

fclose(ptr);
getche();
}
void bar2()
{
int j;
temp.profit=(temp.total-temp.cost);
//
for(j=1;j<=temp.profit;j++)
printf("\xDB");
printf(" %.1f$",temp.profit);
printf("\n");
}

/********************************* both graphs call


****************************/

void graph1()
{
int sher;
clrscr();
textcolor(WHITE);
gotoxy(24,3);
printf("\xDB\xDB\xDB\xDB\xB2 BAR GRAPH
\xB2\xDB\xDB\xDB\xDB");
gotoxy(10,5);
printf("THIS SECTION IS TO show the graph of quantity
and profit ");
printf("\n\n\t ********* ENTER THE OPTION WHICH
SUITS YOU. *******\n");
printf("\n\n\t\xDB\xDB\xB2 1.QUANTITY.\n\n");
printf("\n\t\xDB\xDB\xB2 2.PROFIT.\n");
printf("\n\n\n\t\t\xDB\xDB\xB2 OPTION:");
sher=toupper(getch());

switch(sher)

89
{
case '1':
graph();
break;

case '2':
graph2();
break;

default:
gotoxy(9,20);
textcolor(RED);
cprintf("\a\xDB\xB2 WRONG ENTRY : PRESS ENTER TO GO
TO MAIN MENU... ");
getche();
}

}
/************************** report of profit
**********************/

void report3()
{
char ch;
clrscr();
design();
gotoxy(20,23);
printf("Press Enter to go to MAIN MENU .... ");
textcolor(GREEN);
gotoxy(25,4);
cprintf("\xDB\xDB\xDB\xDB\xDB\xB2 VIEW OF PROFIT
\xB2\xDB\xDB\xDB\xDB\xDB");
textcolor(RED);
gotoxy(4,7);
cprintf("PRODUCT ID. DESCRIPTION. QUANTITY.
PROFIT.");
gotoxy(4,9);
printf("=================================================
===========");

ptr=fopen("shop.dat","rb");
while((fread(&temp,sizeof(temp),1,ptr))==1)
{

printf("\n \xBA %s.",temp.id);


printf("\t\t%s",temp.desc);
printf("\t\t%d",temp.quantity);

90
temp.profit=(temp.total-temp.cost);
printf("\t\t $%.2f",temp.profit);

}
getche();
}

/************************* SALE , PURCHASE AND PROFIT


REPORT CALL***************/

void report2()
{

int sher;
clrscr();
bbox();
textcolor(WHITE);
gotoxy(21,3);
printf("\xDB\xDB\xDB\xDB\xB2 REPORT OF SALES /
PURCHASE \xB2\xDB\xDB\xDB\xDB");
gotoxy(5,5);
printf("\tTHIS SECTION IS VIEWING SALES, PURCHASE and
PROFIT REPORTS ");
gotoxy(10,7);
printf(" ********* ENTER THE OPTION WHICH SUITS
YOU. **********\n");
gotoxy(12,10);
printf("\xDB\xDB\xB2 1.SALES.");
gotoxy(12,12);
printf("\xDB\xDB\xB2 2.PURCHASE.");
gotoxy(12,14);
printf("\xDB\xDB\xB2 3.PROFIT.");
gotoxy(14,17);
printf("\xDB\xDB\xB2 OPTION:");
sher=toupper(getch());

switch(sher)
{
case '1':
report();
break;

case '2':
pur();
break;

91
case '3':
report3();
break;

default:
gotoxy(9,20);
textcolor(RED);
cprintf("\a\xDB\xB2 WRONG ENTRY : PRESS ENTER TO GO
TO MAIN MENU....");
getche();

/************************************ design module


**********************/

void design()
{
int i;
clrscr();
textcolor(14);
/****************************** table design
*********************/
gotoxy(2,2);
cprintf("\xC9");
gotoxy(3,2);
for(i=1;i<=74;i++)
cprintf("\xCD");
gotoxy(77,2);
cprintf("\xBB");
gotoxy(2,3);

cprintf("\xBA");gotoxy(2,4);cprintf("\xBA");gotoxy(2,5);cpr
intf("\xBA");

gotoxy(2,6);cprintf("\xBA");gotoxy(2,7);cprintf("\xBA");got
oxy(2,8);cprintf("\xBA");

gotoxy(2,9);cprintf("\xBA");gotoxy(2,10);cprintf("\xBA");go
toxy(2,11);cprintf("\xBA");gotoxy(2,12);cprintf("\xBA");

gotoxy(2,13);cprintf("\xBA");gotoxy(2,14);cprintf("\xBA");g
otoxy(2,15);cprintf("\xBA");gotoxy(2,16);cprintf("\xBA");

92
gotoxy(2,17);cprintf("\xBA");gotoxy(2,18);cprintf("\xBA");g
otoxy(2,22);cprintf("\xCC");

gotoxy(2,19);cprintf("\xBA");gotoxy(2,20);cprintf("\xBA");g
otoxy(2,21);cprintf("\xBA");gotoxy(2,24);cprintf("\xC8");
gotoxy(2,23);cprintf("\xBA");
gotoxy(3,24);
for(i=1;i<=74;i++)
cprintf("\xCD");

gotoxy(77,18);cprintf("\xBA");gotoxy(77,19);cprintf("\xBA")
;gotoxy(77,20);cprintf("\xBA");gotoxy(77,21);cprintf("\xBA"
);gotoxy(77,24);cprintf("\xBC");
gotoxy(77,23);
cprintf("\xBA");
gotoxy(3,22);
for(i=1;i<=74;i++)
cprintf("\xCD");
gotoxy(77,22);
cprintf("\xB9");
//*****************
gotoxy(77,3);

cprintf("\xBA");gotoxy(77,4);cprintf("\xBA");gotoxy(77,5);c
printf("\xBA");

gotoxy(77,6);cprintf("\xBA");gotoxy(77,7);cprintf("\xBA");g
otoxy(77,8);cprintf("\xBA");

gotoxy(77,9);cprintf("\xBA");gotoxy(77,10);cprintf("\xBA");
gotoxy(77,11);cprintf("\xBA");gotoxy(77,12);cprintf("\xBA");

gotoxy(77,13);cprintf("\xBA");gotoxy(77,14);cprintf("\xBA")
;gotoxy(77,15);cprintf("\xBA");gotoxy(77,16);cprintf("\xBA"
);
gotoxy(77,17);cprintf("\xBA");
textcolor(RED);
//

void bbox()
{
int c,r;
for(c=1;c<=79;c++)
{

93
gotoxy(c,1);
printf("ß");
gotoxy(c,25);
printf("ß");
}
for(r=1;r<=24;r++)
{
gotoxy(1,r);
printf("Û");
gotoxy(79,r);
printf("Û");
}
}

////////////////////////////////// by id
deletion ////////////////////////////

void deletion_id()
{
int j,n,i;
char tar[30];
int count=0;

ptr = fopen("shop.dat","rb");
clrscr();
design();
gotoxy(15,8);
printf("\xDB\xDB Enter ID be deleted:");
scanf("%s",&tar);
j=0;

while((fread(&temp,sizeof(temp),1,ptr))==1)
{
if((strcmp(temp.id,tar)<0) ||
(strcmp(temp.id,tar)>0))
{
x[j] = temp;
j++;
}
else
{
count++;
}
}
if (count==0)
{

94
clrscr();
design();
gotoxy(30,10);
printf("\xDB\xDB Record Not Found");
gotoxy(17,23);
printf("Press Enter to go to MAIN MENU ......");
getch();
return;
}

fclose(ptr);
n = j;
clrscr();
ptr=fopen("shop.dat","wb");
for(i=0; i<n; i++)
fwrite(&x[i],sizeof(x[i]),1,ptr);
fclose(ptr);
clrscr();
design();
gotoxy(15,10);
printf("Record has been deleted");
gotoxy(15,12);
printf("Check it by going to the displayed
record");
gotoxy(17,23);
printf("Press Enter to go to MAIN MENU ......");
getch();

///////////////////////////////// both deletion


call ///////////////////////

void del()
{
int sh;
clrscr();
design();
gotoxy(17,6);
printf("\xDB\xDB\xB2 Two options available to delete
\xB2\xDB\xDB");
gotoxy(16,9);
printf("[ 1 ] - Delete by ID number ");
gotoxy(16,11);
printf("[ 2 ] - Delete by Description ");
gotoxy(18,15);
printf("Enter your choice :: ");

95
sh=toupper(getch());

switch(sh)
{
case '1':
deletion_id();
break;

case '2':
deletion();
break;

default:
gotoxy(18,18);
printf("\a\xDB\xDB Wrong entry ");
gotoxy(17,23);
printf("Press Enter to go to MAIN MENU .....");
getch();
}
getche();

///////////////////////////////////// update
record //////////////////////

void edit()
{
int j,n,i,a;
float b;
char tar[30],ch;
int count=0;
ch='y';
while(ch=='y')
{
ptr = fopen("shop.dat","rb");
clrscr();
design();
gotoxy(15,9);
printf("\xDB\xDB ENTER ID OF THE PRODUCT TO BE
SOLD:");
scanf("%s",&tar);
j=0;

while((fread(&temp,sizeof(temp),1,ptr))==1)
{

96
if((strcmp(temp.id,tar)<0) ||
(strcmp(temp.id,tar)>0))
{
x[j] = temp;
j++;
}
else
{
design();
gotoxy(8,7);
printf("\xDB\xDB Description =
%s",temp.desc);
gotoxy(8,9);
printf("\xDB\xDB Quantity in stock =
%d",temp.quantity);
gotoxy(8,11);
printf("\xDB\xDB Sales price =
%.2f",temp.sale);
gotoxy(8,13);
printf("\xDB\xDB Quantity want to sale : ");
scanf("%d",&a);

x[j]=temp;
x[j].quantity=(x[j].quantity-a);
x[j].total=(x[j].quantity*temp.sale);
x[j].cost=(x[j].quantity*temp.unit);
x[j].bye=(x[j].sale*a);
b=x[j].bye;
x[j].qty=a;
j++;
count++;
}
}
if (count==0)
{
clrscr();
design();
gotoxy(33,10);
printf("\a\xDB\xDB\xB2 Not in stock");
getch();
return;
}

fclose(ptr);
n = j;
clrscr();
ptr=fopen("shop.dat","wb");

97
for(i=0; i<n; i++)
fwrite(&x[i],sizeof(x[i]),1,ptr);
fclose(ptr);
clrscr();
design();
gotoxy(8,9);
printf("\xDB\xDB Price paid by customer =
%.2f",b);
gotoxy(8,11);
printf("\xDB\xDB Quantity sold = %d",a);
getch();
printf("more enteries=(y/n)");
ch=getche();
}
}

///////////////////////////////////
end ///////////////////////////
void show_mouse(void)
{
union REGS in, out;

in.x.ax = 0x1;
int86(0x33, &in, &out);
}

98
99
OUTPUT
--------------------------------------------------------------------------
DEPARTMANTAL STORE
--------------------------------------------------------------------------
MAIN MENU

1 - INFORMATION ABOUT PRODUCTS


2 - ENTER PURCHASE RECORDS
3 - ENTER PRODUCTS TO BE SOLD
4 - SEARCH FOR RECORD
5 - DELETE RECORD FROM STORE DATABASE
6 - VIEW SALES , PURCHASE & PROFIT REPORT
7 - PRINT RECORDS
8 - BAR GRAPH OF QUANTITY / PROFIT
9 - RETRIEVE INFORMATION
H - HELP
E - EXIT

--------------------------------------------------------------------------
ENTER YOUR CHOICE ::
--------------------------------------------------------------------------

INFORMATION ABOUT PRODUCTS

THIS SECTION IS TO TELL WHAT KIND OF PRODUCTS ARE THERE IN STORE

ENTER THE OPTION WHICH SUITS YOU.

1.EDIBLES.

2.GENERAL ITEMS.

OPTION:

100
Figure 1 Information about products

PURSHASE

ENTER PRODUCT ID : 126

ENTER DESCRIPTION : shampoo


ENTER RACK NO : 24

ENTER CABNIT NO : 5

ENTER UNIT COST :$ 53

ENTER SALE PRICE :$ 55

ENTER QUANTITY : 3
=====================================

TOTAL PRICE = $ 165.00 TOTAL COST = $ 159.00


Date and time: Fri May 31 10:34:38 2002
--------------------------------------------------------------------------
More entries [y/n]
--------------------------------------------------------------------------

101
Figure 2 Enter purchase records

SALE

ENTER ID OF THE PRODUCT TO BE SOLD:

Price paid by customer = 165.00

Quantity sold =3

102
Figure 3 Enter products to be sold

103
SEARCH RECORD

Two options available to search


[ 1 ] - Search by ID number .

[ 2 ] - Search by Description .

Enter your choice::

Enter id to be searched:126

Product ID : 126

Description : shampoo

Rack no : 24

Cabnit : 5

Sale price :$ 55.00

Quantity : 0
============================

Total :$ 0.00

104
Figure 4 Search for record

105
DELETE RECORD

Two options available to delete

[ 1 ] - Delete by ID number

[ 2 ] - Delete by Description

Enter your choice ::

Record has been deleted

Check it by going to the displayed record

--------------------------------------------------------------------------
Press Enter to go to MAIN MENU ......
--------------------------------------------------------------------------

106
Figure 5 Delete record from store data base

107
REPORT OF SALES / PURCHASE

THIS SECTION IS VIEWING SALES, PURCHASE and PROFIT REPORTS

********* ENTER THE OPTION WHICH SUITS YOU. **********

1.SALES.

2.PURCHASE.

3.PROFIT.

OPTION:

VIEW OF SALES

PRODUCT ID. NAME. SALE PRICE. QUANTITY. TOTAL PRICE

========================================================

--------------------------------------------------------------------------
Press Enter to go to MAIN MENU ........

108
Figure 6 View sales, purchase and profit report

109
BAR GRAPH

THIS SECTION IS TO show the graph of quantity and profit

********* ENTER THE OPTION WHICH SUITS YOU. *******

1.QUANTITY.

2.PROFIT.

OPTION:

************* GRAPH OF PRODUCT QUANTITY *************


PRODUCT NAME
:0

shampoo :2

¦ Press enter to go to MAIN MENU .....

110
Figure 7 Bar graph of quantity / profit

111
RETRIEVE RECORD

DESCRIPTION :

ID NUMBER :

RACK NO : 0

CABNIT NO : 0

UNIT COST :$ 0.00

SALE PRICE : $ 0.00

QUANTITY : 0
===================================

TOTAL PRICE : $ 0.00 __ TOTAL COST : $ 0.00

Press Enter to see next if any or exit ...

112
Figure 8 Retrieve information

113
HELP ABOUT THE PROGRAM

[ 2 ] - ENTER RECORDS : THIS OPTION ALLOWS THE USER TO ENTER NEW


RECORDS. USER ENTERS PRODUCT ID, DESCRIPTION,
QUANTITY AND UNIT PRICE. THE PROGRAMM CALCULATES
TOTAL PRICE AND DISPLAYS ON THE SCREEN.

[ 3 ] - ENTER SALES : THIS OPTION ALLOWS THE USER TO SEE PREVIOUS


SALE RECORDS.

[ 4 ] - SEARCH PURCHASE : THIS OPTION ALLOWS THE USER TO SEARCH


SPECIFIC
RECORD BY ENTERING ID OR 'DESCRIPTION'

[ 5 ] - DELETE PURCHASE : THIS OPTION ALLOWS THE USER TO DELETE A


SPECIFIC
RECORD BY ENTERING ITS 'DESCRIPTION' OR ID

--------------------------------------------------------------------------
Press any key to continue .............
--------------------------------------------------------------------------

[ 6 ] - VIEW REPORT : THIS OPTION ALLOWS THE USER TO PRINT


PREVIOUS
SALE RECORDS ON PRINTER

[ 7 ] - PRINT RECORDS : THIS OPTION ALLOWS THE USER TO PRINT


RECORDS ¦
OM PRINTER.

[ 8 ] - VIEW GRAPH : THIS OPTION ALLOWS THE USER TO VIEW GRAPH


OF QUANTITY.

--------------------------------------------------------------------------
Press any key to go to the MAIN MENU ........
--------------------------------------------------------------------------

114
Figure 9 Help

115
116
TESTING
“Testing is the process of executing a program with the intent of finding
errors” in software development process, errors can be injected at any stages
during development. There are various techniques that are used for detecting and
eliminating errors but no method is perfect because most of the verification
methods of earlier phases are manual.
During testing, the program to be tested is executed with a test case is
evaluate to determine if the program is performing as expected. Testing is a set of
activities that can be planned in advance and conducted systematically. It’s a
process of analyzing a software item to detect the difference between existing and
required conditions (i.e. bugs) and to evaluate the features of the software items.

Test case designs are constructed for each path and for all logical decisions,
and boundary values conditions. There are four paths in the process flow and
therefore four test case designs would be built to test path processing. A test case
will test whether logical decisions are made through condition testing and on that
result whether control of process moves to the appropriate branch.

The white-box testing can be applied to the operations defined for a class
basis path, loop testing, or data flow techniques can help to ensure that every
statement in an operation has been tested. However, the concise structure of many
class operations causes some to argue that the effort applied to white box testing
might be better redirected to tests at a class level.

Black box testing methods are as appropriate for Object Oriented System
as they are for Systems developed using conventional Software engineering
methods.

UNIT TESTING

Unit testing focuses verification effort on the smallest unit of software


design the software component or module. Using the component – level design
description as a guide, important control paths are tested to uncover errors within
the boundary of the module. The relative complexity of tests and the errors those
tests uncover is limited by the constrained scope established for unit testing. The
unit test focuses on the internal processing login and data structures within the
boundaries of a component. This type of testing can be conducted in parallel for
multiple components.

117
Interface
Local data structures
Module Boundary Conditions
Independent paths
Error handling paths

Test Codes

The module interface is tested to ensure that information properly flows


into and out of the program unit under test local data structures are examined to
ensure that data stored temporarily maintains its integrity during all steps an
algorithm execution. All independent paths through the control structure are
exercised to ensure that all statements in a module have been executed at once.
For unit testing two testing techniques are applied : white box testing and
black box testing.

WHITE BOX TESTING

White box testing, sometimes called glass box testing, uses the flow and
control structure of the process to derive the test case design white box testing is
carried out to test whether .

118
a) All paths in a process are correctly operational.
b) All logical decisions are executed with true or false conditions.
c) All loops are executed with their limit values tested.
d) To ascertain whether input data structure specifications are tested
and then used for other processing. In order to handle complexities of unit level
processing, test case designs are built after drawing process flow charts and flow
graphs.

PROCESS FLOW CHART PROCESS FLOW GRAPH

Logical
Sequence 7
Sta Sequence
rt
Loop
7

1 Logical
Design If 7
1
Branching on
2 Process 7 7 condition

stop
7 3 Logical design 7 7

1 Unit
7
Terminal case
4 5 While
7 7 7 7

6
Back to the next 7 7
Element of data
8 In a loop until.
stop 7

Stop

Analysis of process flow chart reveals following process paths:-


 Start -1 – 7 – stop
 Start – 1 -2 – 3 -3 – 4 - 8 – stop
 Start – 1 – 2 – 3 – 6 - 1 (Loop)
 Start – 1 – 2 – 3 – 5 – 1 (Loop)

119
BLACK BOX TESTING

Black box testing is also called behavioral testing, concentrates on


functions and features of the software. Black box testing is not an alternative to
white box testing, but is complementary to it. Black box testing confirms whether
for a give valid input, the software executes correctly to produce the required
results. Black box testing discovers errors that are not revealed by white box
testing. The errors discovered through black box testing are:-
Incorrect function

 Missing function
 Interface errors not able to receive or send the data to other Systems.
 Incorrect pre – conditions resulting into incorrect function
processing
 Incorrect terminal conditions not responding to stoppage or
continues to execute the function.
 Erroneous processing even though data structure is not correct.

CONCLUSION

As a student of BCA (3 years) I have done this project according to my


level of technical knowledge and expertise but in future this project can be
enhanced by using advanced technology so that it can become more user friendly
and technically advanced besides that more functionalities can also be given to the
software.

120
121
122
BIBLIOGRAPHY

Rajeev Mall, Waman S Jawadekar “Fundamentals of Software


Engineering”

E Balagurusamy Kanitkar “Object Oriented Programming C++”

Robert S Pressman “Practicing Software Engineering”

Jawadekar “Software Engineering Practices AND Principles”

Jawadekar “For Diagrams Project Practices”

Study material provided by Jamia Hamdard University

Study notes provided by Study Center Soft dot Hi-tech

123
WEBSITES

http://www.syncfusion.com/FAQ/winForm/

http://www.codeproject.com

http://msdn.microsoft.com

http://www.google.com

http://www.codehelper.com

www.tatamcgrawhill.com

124
C's Standard Libraries

Objectives

This section is only for reference! It contains the following information:


Names of all C's Standard Libraries
The functions they contain

Input and Output: <stdio.h>


FILE *fopen(const char *filename, const char *mode)
FILE *freopen(const char *filename, const char *mode, FILE
*stream)
int fflush(FILE *stream)
int fclose(FILE *stream)
int remove(const char *filename)
int rename(const char *oldname, const char *newname)
FILE *tmpfile(void)
char *tmpnam(char s[L_tmpnam])
int setvbuf(FILE *stream, char *buf, int mode, size_t size)
void setbuf(FILE *stream, char *buf)
int fprint(FILE *stream, const char *format, ...)
int sprintf(char *s, const char *format, ...)
vprintf(const char *format, va_list arg)
vfprintf(FILE *stream, const char *format, va_list arg)
vsprintf(char *s, const char *format, va_list arg)
int fscanf(FILE *stream, const char *format, ...)
int scanf(const char *format, ...)
int sscanf(char *s, const char *format, ...)
int fgetc(FILE *stream)
char *fgets(char *s, int n, FILE *stream)
int fputc(int c, FILE *stream)
int fputs(const char *s, FILE *stream)
int getc(FILE *stream)
int getchar(void)
char *gets(char *s)
int putc(int c, FILE *stream)
int putchar(int c)
int ungetc(int c, FILE *stream)
size_t fread(void *ptr, size_t size, size_t nobj, FILE
*stream)
size_t fwrite(const void *ptr, size_t size, size_t nobj,
FILE *stream)
int fseek(FILE *stream, long offset, int orogin)

125
long ftell(FILE *stream)
void rewind(FILE *stream)
int fgetpos(FILE *stream, fpos_t *ptr)
int fsetpos(FILE *stream, const fpos_t *ptr)
void clearerr(FILE *stream)
int feof(FILE *stream)
int ferror(FILE *stream)
void perror(const char *s)

Character Class Tests: <ctype.h>


isalnum(c)
isalpha(c)
iscntrl(c)
isdigit(c)
isgraph(c)
islower(c)
isprint(c)
ispunct(c)
isspace(c)
isupper(c)
isxdigit(c)

String Functions: <string.h>


char *strcpy(s , ct)
char *strncpy(s , ct , n)
char *strcat(s , ct)
char *strncat(s , ct , n)
int strcmp(cs , ct)
int strncmp(cs , ct ,n)
char *strchr(cs , c)
char *strrchr(cs , c)
size_t strspn(cs , ct)
size_t strcspn(cs , ct)
char *strstr(cs , ct)
size_t strlen(cs)
char *strerror(n)
char *strtok(s , ct)

Mathematical Functions: <math.h>


sin(x)
cos(x)
tan(x)
asin(x)
acos(x)
atan(x)

126
atan2(x)
sinh(x)
cosh(x)
tanh(x)
exp(x)
log(x)
log10(x)
pow(x,y)
sqrt(x)
ceil(x)
floor(x)
fabs(x)
ldexp(x)
frexp(x,double *ip)
modf(x,double *ip)
fmod(x,y)

Utility Functions: <stdlib.h>


double atof(const char *s)
int atoi(const char *s
long atol(const char *s)
double strrod(const char *s, char **endp)
long strtol(const char *s, char **endp, int base)
unsigned long strtoul(const char *s, char **endp, int base)
int rand(void)
void srand(unsigned int seed)
void *calloc(size_t nobj, size_t size)
void *malloc(size_t size)
void *realloc(void *p, size_t size)
void free(void *p)
void abort(void)
void exit(int status)
int atexit(void (*fcn)(void))
int system(const char *s)
char *getenv(const char *name)
void *bsearch(const void *key, const void *base, size_t n,
size_t size, int (*cmp)(const void *keyval, const void
*datum))
void qsort(void *base, size_t n, size_t size, int (*cmp)
(const void *, const void *))
int abs(int n)
long labs(long n)
div_t div(int num, int denom)
ldiv_t ldiv(long num , long denom)

Diagnostics: <assert.h>
void assert(int expression)

127
Non-local Jumps: <setjmp.h>
int setjmp(jmp_buf env)
void longjmp(jmp_buf env, int val)

Signals: <signal.h>
void (*signal(int sig, void (*handler)(int)))(int)

Data and Time Functions: <time.h>


clock_t clock(void)
time_t time(time_t , *tp
double difftime(time_t time2 , time_t time1)
time_t mktime(struct tm *tp)
char *asctime(const time_t *tp)
char *ctime(const time_t *tp)
struct tm *gmtime(const time_t *tp)
struct tm *localtime(const time_t *tp)
size_t strftime(char *s, size_t smax, const char *fmt,
const struct tm *tp)

128

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