Examples of DFD
1. (Tic-Tac-Toe Computer Game ) Tic-tac-toe is a computer game in which a
human player and the computer make alternate moves on a 3 × 3 square. A
move consists of marking a previously unmarked square. The player who is
first to place three consecutive marks along a straight line (i.e., along a row,
column, or diagonal) on the square wins. As soon as either of the human
player or the computer wins, a message congratulating the winner should be
displayed. If neither player manages to get three consecutive marks along a
straight line, nor all the squares on the board are filled up, then the game is
drawn. The computer always tries to win a game.
2. (Trading-house Automation System (TAS)) A trading house wants us to
develop a computerized system that would automate various bookkeeping
activities associated with its business. The following are the salient features
of the system to be developed:
The trading house has a set of regular customers. The customers
place orders with it for various kinds of commodities. The trading
house maintains the names and addresses of its regular customers.
Each of these regular customers should be assigned a unique
customer identification number (CIN) by the computer. The
customers quote their CIN on every order they place.
Once order is placed, as per current practice, the accounts department
of the trading house first checks the credit-worthiness of the
customer. The credit-worthiness of the customer is determined by
analysing the history of his payments to different bills sent to him in
the past. After automation, this task has been done by the computer.
If a customer is not credit-worthy, his orders are not processed any
further and an appropriate order rejection message is generated for
the customer. If a customer is credit-worthy, the items that he has
ordered are checked against the list of items that the trading house
deals with. The items in the order which the trading house does not
deal with, are not processed any further and an appropriate apology
message for the customer for these items is generated. The items in
the customer’s order that the trading house deals with are checked for
availability in the inventory. If the items are available in the
inventory in desired quantity, then:
– A bill is with the forwarding address of the customer is printed.
– A material issue slip is printed. The customer can produce this
material issue slip at the store house and take delivery of the items.
– Inventory data is adjusted to reflect the sale to the customer.
If any of the ordered items are not available in the inventory in
sufficient quantity to satisfy the order, then these out-of-stock items
along with the quantity ordered by the customer and the CIN are
stored in a “pending-order” file for further processing to be carried
out when the purchase department issues the “generate indent”
command.
The purchase department should be allowed to periodically issue
commands to generate indents. When a command to generate indents
is issued, the system should examine the “pending-order” file to
determine the orders that are pending and determine the total quantity
required for each of the items. It should find out the addresses of the
vendors who supply these items by examining a file containing
vendor details and then should print out indents to these vendors.
The system should also answer managerial queries regarding the
statistics of different items sold over any given period of time and the
corresponding quantity sold and the price realized.
Fig: Level 0 diagram
Fig: Level 1 Diagram