0% found this document useful (0 votes)
24 views23 pages

Designing Program Logic Sumer

The document outlines a module on Designing Program Logic, focusing on the Systems Development Life Cycle (SDLC) and design documentation. It covers key phases of SDLC, including preliminary investigation, analysis, design, implementation, deployment, and maintenance, along with the importance of design documentation and program logic. Additionally, it introduces algorithm development, pseudo-code, and flowcharting as essential tools for coding and program planning.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views23 pages

Designing Program Logic Sumer

The document outlines a module on Designing Program Logic, focusing on the Systems Development Life Cycle (SDLC) and design documentation. It covers key phases of SDLC, including preliminary investigation, analysis, design, implementation, deployment, and maintenance, along with the importance of design documentation and program logic. Additionally, it introduces algorithm development, pseudo-code, and flowcharting as essential tools for coding and program planning.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 23

Debre Markos Polytechnic College

Department of Web Development and Database


Administration

Level III

Module Title: Designing Program Logic


Module code: EIS WDDBA3 M04 0323
Nominal duration: 50 Hours

1
Designing Program Logic
Table of contents
Acronym.....................................................................................................................................................3
1.1.1 Overview.............................................................................................................................4
1.1.2 1.1. Systems Development Life Cycle (SDLC).................................................................4
1.1.3 A. Preliminary Investigation.............................................................................................4
1.1.4 B. Analysis (Requirement Gathering)..............................................................................4
1.1.5 C. Design Phase..................................................................................................................5
1.1.6 D. Implementation.............................................................................................................5
1.1.7 E. Deployment and Testing...............................................................................................5
1.1.8 F. Maintenance...................................................................................................................5
1.1.9 Benefits of SDLC:..............................................................................................................5
1.1. Design Documentation................................................................................................6
Importance of Design Documentation:........................................................................6
Logic Model:........................................................................................................................................6
Program of Requirements:..................................................................................................7
Understanding the Programming Process:................................................................7
1.2 Design Approach to Coding........................................................................................8
Example 1: Pseudo-code to Calculate Bonus.................................................................................10
Example 2: Pseudo-code to Calculate Interest Rate......................................................................11
Sequence in Pseudo-code.................................................................................................................11
Pseudo-code with Loop....................................................................................................................11
Pseudo-code with Selection (IF-THEN-ELSE)..............................................................................12
Example 3: Pseudo-code to Calculate Grade.................................................................................12
Key Concepts Recap........................................................................................................................13
What is a Data Flow Diagram (DFD)?................................................................................................16
DFD Example: Food Ordering System...............................................................................................19
1.2.2 Conclusion.........................................................................................................................19
1.2.3 Hierarchy Input Process Output (HIPO) Diagram.......................................................19
1.2.4 RAD (Rapid Application Development) Model.............................................................20
Prototyping Model.............................................................................................................................20
1.2.5 CASE (Computer-Aided Software Engineering) Tools.................................................21

2
Designing Program Logic
1.2.6 Summary Comparison: RAD, Prototyping, and CASE Tools................................................22
1.2.7 Conditions for Operations:.................................................................................................22
1.2.8 Equipment, Tools, and Materials:......................................................................................22
1.2.9 Steps to Create a Flowchart in Microsoft Visio:.................................................................23
1.2.10 Flowchart Proposal Development Process:........................................................................23
1.2.11 Quality Criteria:..................................................................................................................23
1.2.12 Lap Tests Instructions:.......................................................................................................24
Group Assignment: Systems Development Life Cycle (SDLC) and Program Logic Design......24
Group Formation and Topics.........................................................................................................24
Group 1: Systems Development Life Cycle (SDLC) Overview....................................................24
Group 2: Feasibility Study & Requirement Analysis....................................................................24
Group 3: System Design & Coding Approach...............................................................................24
Group 4: Implementation & Testing Phase...................................................................................25
Group 5: Deployment & Maintenance...........................................................................................25
Deliverables & Evaluation..............................................................................................................25

Acronym
CASE-----------------------------------------------computer-aided software engineering
CRUD-----------------------------------------------Create, Read, Update, and Delete
DFD--------------------------------------------------Data Flow Diagram
HIPO------------------------------------------------Hierarchy Input Process Output Diagram
MDS------------------------------------------------- Master Data Services
RAD --------------------------------------------------Rapid Application Development model.
SDLC-------------------------------------------------Systems development life cycle
SOW---------------------------------------------------scope of work
UML----------------------------------------------------Uniform Modeling Language

3
Designing Program Logic
Unit One: Program Logic Design

1.1.1 Overview

This unit introduces the Systems Development Life Cycle (SDLC), design documentation, and
coding approaches. The goal is to enable you to:

 Develop a Systems Development Life Cycle (SDLC)


 Understand and create design documentation
 Demonstrate a design approach for coding

1.1.2 1.1. Systems Development Life Cycle (SDLC)

The Systems Development Life Cycle (SDLC) is a project management model that outlines the
stages involved in developing an information system, from initial feasibility studies to the
maintenance of the completed system. It can apply to both technical and non-technical
systems.

1.1.2.1 Key Phases of SDLC:

1. Preliminary Investigation
2. Analysis (Requirement Gathering)
3. Design
4. Implementation
5. Deployment and Testing
6. Maintenance

1.1.3 A. Preliminary Investigation

 Purpose: Identify whether the problem with the current system exists and assess whether it’s
feasible to solve.
 Steps:
o Defining the problem: Analyze documents, observe operations, and interview key users.
o Suggesting solutions: Improve existing systems or develop new solutions.
o Feasibility studies: Assess:
 Technical Feasibility: Can the solution be implemented with available
resources?
 Economic Feasibility: Do the benefits outweigh the costs?
 Operational Feasibility: Is the solution viable within the current organization?

1.1.4 B. Analysis (Requirement Gathering)


 Purpose: Analyze business requirements and translate them into system functions.
 Steps:
o Understand business operations: what activities are done and how.

4
Designing Program Logic
o Identify the specific information needs: who needs what information, where, when, and
how.
1.1.5 C. Design Phase
 Purpose: Describe the system’s desired features and operations.
 Key Components:
o Business Rules: Define how the system operates.
o Pseudo-code: High-level representation of system logic.
o Screen Layouts: Design how the user interface will look.
o Other necessary documentation.
1.1.6 D. Implementation
 Purpose: Code the system based on design and requirements.
 Steps:
1. Break down the tasks into smaller coding actions to be done daily.
2. Install hardware and software, integrate the system into daily workflows.
3. Monitor system performance against predefined objectives.
1.1.7 E. Deployment and Testing
 Purpose: Test and deploy the software in a controlled environment before releasing to users.
 Key Concepts:
o Build Environment: Where development and testing occur.
o Production Environment: The version used by end-users.
o Perform thorough testing to ensure the system meets the performance objectives.
1.1.8 F. Maintenance
 Purpose: Ongoing support for the system after deployment.
 Tasks:
1. Fix bugs and resolve customer issues.
2. Monitor system performance, security, and user feedback.
3. Implement improvements to enhance the system.
1.1.9 Benefits of SDLC:
 Increased Visibility: Stakeholders can track project progress.
 Better Planning: More efficient estimation of time, costs, and resources.
 Improved Risk Management: Better management of potential risks and costs.
 Systematic Delivery: Ensures organized software delivery.
 Customer Satisfaction: Leads to better user experiences and system quality.
1.1. Design Documentation
Overview: Design documentation is a critical part of the programming process, created before
writing the actual code. It helps ensure the program meets the customer's needs, allows for
project continuity, and clarifies the design before implementation. Without solid design
documentation, you might end up implementing a solution that doesn't meet user needs or
expectations.
Importance of Design Documentation:
 Clarifies Requirements: Helps ensure you're doing what the customer wants.
 Project Continuity: Provides a reference in case of personnel changes.
 Guides Implementation: Assures that the implementation matches the intended design.
Program Logic:
 Definition: Program logic is the implementation of the program’s requirements and design.

5
Designing Program Logic
 If the design is poor, the program can still be implemented, but the functionality (e.g., user
interface) may be weak.

6
Designing Program Logic
Key Points About Program Logic:
 Logical Operations on Data: Program logic follows logical principles, resulting in quantifiable
outcomes.
 Foundation of Computational Logic: Programming logic is based on logic that is understandable
by both humans and machines.
Understanding Program Logic:
 Program logic is the reasoning behind how and why a program works.
 It demonstrates the design and competence needed to implement the program.
 A series of “if-then” statements that lead to the desired outcomes when implemented
correctly.
Logic Model:
A Logic Model is a tool that visualizes the relationship between program activities and desired
outcomes.
 Questions to Consider:
o Where are you going?
o How will you get there?
o What will tell you that you have arrived?
Benefits of Logic Models:
 Program Planning: Helps organize and structure program activities.
 Program Implementation: Provides a clear roadmap for execution.
 Monitoring and Evaluation: Tracks progress and assesses the effectiveness of the program.
Uses of a Logic Model:
 Clarifies Assumptions: Helps identify gaps and clarify assumptions about how the program
works.
 Builds Consensus: Promotes understanding among stakeholders.
 Improves Communication: Summarizes complex programs for effective communication.
 Evaluation: Clarifies when and what to evaluate.
Program of Requirements:
The Program of Requirements (PoR) is a document that specifies the functional and non-
functional requirements for a system. It serves as a guideline for designers and developers to
understand the needs and expectations of the project.
 Purpose: Ensures that the project meets the desired outcome.
 Framework: Lays out clear criteria and expectations for all stakeholders.

Understanding the Programming Process:


The programming process can be broken down into six phases:
1. Understand the Problem
2. Plan the Logic
3. Code the Program
4. Use Software to Translate the Program into Machine Language
5. Test the Program
6. Deploy the Program into Production

A. Understanding the Problem:


 Challenge: Users may struggle to articulate their needs clearly.
 Dynamic Needs: User requirements might change frequently.
 Learning Curve: Programmers may need to learn the user’s tasks and context.

7
Designing Program Logic
 Major Cause of Failures: Misunderstanding the problem is a key factor in project failure.
B. Planning the Logic:
 Purpose: Plan out the steps the program will take.
 Tools:
o Flowcharts: Visual representation of the program’s logic.
o Pseudo Code: English-like description of the program’s steps.
 Desk-Checking: Walk through the logic before actual coding to ensure it works.
C. Coding the Program:
 Select the Language: Choose the appropriate programming language for the task.
 Write Instructions: Translate the planned logic into actual code.
D. Using Software to Translate into Machine Language:
 Compilers/Interpreters: Translate high-level code into machine language.
 Syntax Errors: These are detected during the translation process and need to be fixed.
E. Testing the Program:
 Execute with Sample Data: Run the program with test data to see if it performs correctly.
 Identify Logic Errors: If there are errors, fix them.
 Test Data: Carefully choose test data that exercises all branches of the logic.
F. Putting the Program into Production:
 Deployment: After testing and correcting errors, the program is deployed.
 Coordination: This may require coordinating with other software or systems to ensure
everything works smoothly.
1.2 Design Approach to Coding

Program Algorithm
Definition: An algorithm is a set of instructions or steps designed to perform a specific task.
Algorithms can range from simple operations (e.g., multiplying two numbers) to complex
processes (e.g., video compression or search engine ranking).
Key Points:
 Algorithms are often created as functions in programming. These functions can be reused in
larger programs.
 Example: An image viewing application might contain algorithms for rendering different image
formats, while an image editing program could include algorithms for tasks like cropping or
sharpening images.
 Efficiency is key in algorithm design. The more efficient the algorithm, the faster the program
runs and the fewer system resources it consumes.
 Programmers constantly optimize algorithms to improve the speed and efficiency of software,
often improving existing algorithms in software updates.
Designing an Algorithm/Solution to a Problem
To solve a problem with a program, there are two core components:
1. Data Organization: How the data is structured and stored in the computer's memory (this is
known as the data structure).
2. Sequence of Steps (Algorithm): The specific steps taken to solve the problem.
Program = Data Structure + Algorithm
 Algorithm: A well-defined procedure to solve a problem by processing input data and
generating output.
 Key Characteristics of an Algorithm:
o Step-by-Step: A clear sequence of instructions.
o Problem-Specific: Solves a particular problem.

8
Designing Program Logic
o Finite Time: The algorithm must complete in a finite amount of time.

Algorithm Development

Once the requirements are defined, the next step is to develop the algorithm to solve the problem.
A good algorithm should have the following attributes:
 Precise and Unambiguous: No ambiguity in instructions or their order.
 Correct: The algorithm should solve the problem as intended.
 Finite: The algorithm must eventually finish and not run indefinitely.
 Handles Exceptions: The algorithm should be able to deal with unexpected or edge cases.
 Efficient: The algorithm should minimize time, memory, and other resource usage.
Methods for Algorithm Construction:
 Flowchart: A visual representation of the algorithm.
 Pseudo-code: A step-by-step description of the algorithm using simple English-like text.

Pseudo-code

Definition: Pseudo-code is a textual, human-readable description of an algorithm. It is not


written in any specific programming language, but instead uses plain language to describe the
sequence of steps that the algorithm will follow.

 Purpose: Pseudo-code helps plan and explain an algorithm in a way that is easier to understand
before translating it into actual code.
 Key Points:
o High-Level Description: Uses simple English to describe the logic without worrying
about specific syntax or programming language.
o Not Executable: It cannot be compiled or run like a real program; it's just for human
understanding.
o Focus: It emphasizes solving the problem and planning the logic, rather than worrying
about programming details.
o Intermediary: Pseudo-code serves as a bridge between the conceptual algorithm and
the final program code.

Advantages of Pseudo-code:

1. Improved Readability: Makes the approach to solving a problem easier to understand,


especially for non-technical people.
2. Bridges Algorithm and Code: Pseudo-code helps document the logic, which makes it easier for
someone else to understand and translate it into actual code.
3. Clarifies Program Logic: Helps programmers understand exactly what each part of the program
is supposed to do, which eases the coding phase.
4. Industry Standard: In many industries, using pseudo-code for documentation is crucial, as it
allows the work of one developer to be understood by others.
5. Easy Transition to Code: If written correctly, pseudo-code can be directly translated into a
programming language with minimal effort.

9
Designing Program Logic
Common Uses:
 Textbooks/Scientific Publications: Documenting algorithms.
 Planning Stage: Sketching out the structure of a program before writing actual code.
Flowchart vs. Pseudo-code:

 Flowchart: A visual diagram that illustrates the algorithm’s logic using symbols and arrows.
 Pseudo-code: A written, step-by-step explanation of the algorithm, typically using plain English.

Both methods are used for planning and explaining program logic before coding begins. Pseudo-
code is often seen as the textual equivalent of flowcharting.

Example 1: Pseudo-code to Calculate Bonus

This pseudo-code calculates the bonus for an employee based on their salary and service years:

ACCEPT Name, Salary


Bonus = Salary x 0.1
ACCEPT ServiceYear
IF ServiceYear > 10 Then
Bonus = Bonus + 100
ENDIF
DISPLAY Bonus

Explanation:
1. The program accepts the employee's Name and Salary.
2. It calculates the Bonus as 10% of the salary.
3. It checks if the Service Year is greater than 10 years.
o If yes, it adds 100 to the calculated Bonus.
4. Finally, it displays the Bonus.

Example 2: Pseudo-code to Calculate Interest Rate


This pseudo-code calculates the interest on a principal amount based on a given interest rate:

ACCEPT Name, Principal, Rate


Interest = Principal x Rate
DISPLAY Name, Interest
Explanation:

1. The program accepts the Name, Principal, and Rate.


2. It calculates the Interest by multiplying Principal with Rate.
3. Finally, it displays the Name and Interest.
Sequence in Pseudo-code
The sequence refers to the execution of tasks in a linear order, where one task is performed after
the other. In pseudo-code, the sequence is represented like this:
Statement 1;
Statement 2;
Statement 3;
Statement 4;
Statement 5;

10
Designing Program Logic
Example (Making Tea):
1. Organize everything together;
2. Plug in kettle;
3. Put teabag in cup;
4. Put water into kettle;
5. Wait for the kettle to boil;
6. Add water to cup;
7. Remove teabag with spoon/fork;
8. Add milk and/or sugar;
9. Serve.
Pseudo-code with Loop

A loop allows you to repeat certain actions until a condition is met. For example, if you need to
keep filling the kettle until it's full, the loop is used.

Pseudo-code with a Loop (WHILE):


While (<condition>)
Do <Statements>;
EndWhile;
Example (Filling a Kettle):
While (Kettle is not full)
Do keep filling Kettle;
EndWhile;

This loop will keep filling the kettle with water until the condition (the kettle is full) is met.

Pseudo-code with Selection (IF-THEN-ELSE)

A selection allows you to make decisions in your program. It helps you choose between two or
more courses of action based on conditions.

Syntax (IF-THEN-ELSE):
If (<condition>)
Then <Statement>;
Else <Statement>;
EndIf;
Example (Adding Sugar to Tea):
If (Sugar is required)
Then add Sugar;
Else do nothing;
EndIf;

In this example, the program will check if sugar is required. If true, it adds sugar; otherwise, it
does nothing.

11
Designing Program Logic
Example 3: Pseudo-code to Calculate Grade

This pseudo-code assigns a grade based on the score (Mark):

ACCEPT Mark, Name


IF Mark >= 80 Then
Grade = A
ELSE IF Mark >= 60 Then
Grade = B
ELSE IF Mark >= 50 Then
Grade = C
ELSE IF Mark >= 40 Then
Grade = D
ELSE
Grade = F
ENDIF
DISPLAY Grade, Name
Explanation:

1. The program accepts the Mark and Name.


2. It then checks the Mark against different grade thresholds:
o If the Mark is 80 or above, the grade is A.
o If the Mark is between 60 and 79, the grade is B.
o If the Mark is between 50 and 59, the grade is C.
o If the Mark is between 40 and 49, the grade is D.
o If the Mark is less than 40, the grade is F.
3. Finally, it displays the Grade and Name.

Key Concepts Recap


1. Sequence: Tasks performed in a linear order, one after another.
2. Loop (WHILE): Repeatedly performs actions until a condition is met.
3. Selection (IF-THEN-ELSE): Makes decisions based on conditions to execute one of two or more
courses of action.
Flowcharts
A flowchart is a graphical representation of a process or algorithm, depicting the flow of
control and decision-making steps. It helps visualize how a program or task will proceed.
Key Points:
 Flowcharts are used to represent the logical flow of a program.
 They use symbols to represent different operations, and arrows show the direction of the
process flow.
 Flowcharts are often used in system analysis to visualize the flow of data, decisions, and
processes.
Purpose of Flowcharts:
 Flowcharts help define the logical progression of tasks.
 They represent the physical or logical steps in completing a task.
 Flowcharts are used to design a program before implementation to test logic and identify
inefficiencies.

12
Designing Program Logic
Common Flowchart Symbols
Flowcharts use specific symbols to represent different types of actions or steps:
1. Terminator (Oval):
o Marks the beginning or end of a process.
o Example: Start or Stop.

2. Process (Rectangle):
o Represents a step or operation where data is processed.
o Example: Calculations, assignments.

3. Input/Output (Parallelogram):
o Represents input or output operations, such as reading data or displaying results.
o Example: Reading input, printing output.

4. Decision (Diamond):
o Represents a decision point or conditional check.
o Example: If-else conditions.

5. On-page Connector (Circle):


o Indicates a continuation of the flow on the same page.

6. Off-page Connector (Pentagon):


o Indicates the continuation of the flow on a different page.

7. Predefined Process (Rectangle with double lines):


o Represents a predefined subroutine or process.

Basic Flowchart Patterns


1. Sequence:
o Tasks are performed in a linear order, one after the other.
o Example: Add three numbers in a given order.
2. Decision:

o A decision block where a condition is evaluated (e.g., If-Else).


o Example: If there’s enough gas, drive to a friend's house; else, go to the gas station.
3. Repetition (Loop):

o A condition is checked, and the same task is repeated until a condition is satisfied.
o Example: Keep filling a kettle until it's full.

Example 4: Add Three Numbers (Flowchart and Pseudo-code)


Pseudo-code:
Add_three_numbers
Read number1, number2, number3
Total = number1 + number2 + number3
Print total
END

13
Designing Program Logic
Defining Diagram:
 Input: number1, number2, number3
 Processing: Add the numbers together.
 Output: Total

Flowchart:

Start → Input numbers → Add the numbers → Print total → End

Example 5: Getting Out of Bed (Flowchart)

A simple flowchart for the process of getting out of bed in the morning:

Start → Wake up → Get out of bed → Do morning routine → End

Example 6: Find Average Temperature (Flowchart and Pseudo-code)

Pseudo-code:

Find_average_temperature
Prompt operator for max_temp, min_temp
Get max_temp, min_temp
Avg_temp = (max_temp + min_temp) / 2
Output avg_temp to the screen
END

Defining Diagram:

 Input: max_temp, min_temp


 Processing: Get temperatures and calculate average.
 Output: Avg_temp

Flowchart:

1. Start → Prompt for max_temp, min_temp → Get temperatures → Calculate avg_temp →


Display avg_temp → End

Flowchart vs. Pseudo-code

Flowchart Pseudo-code
Pictorial representation of an algorithm. Step-by-step description using plain English text.
Uses standard symbols for input, output, Uses programming-like structure with English keywords
decisions, etc. (e.g., if-else, for, while).

14
Designing Program Logic
Good for documentation and visualizing More suited for understanding logic and algorithm flow.
processes.
Focuses on the physical or logical steps of Describes an algorithm without focusing on actual coding
a task. syntax.
Graphical representation of the process. Text-based description of the process.

Program Logic Patterns

1. Sequence:
o Represents tasks performed one after another, without any decision-making or
repetition.

2. Decision (If-Else):
o A condition is tested (e.g., if a variable is greater than a threshold). Based on the result,
different actions are executed.
o Example: IF there's enough gas in the car, THEN drive to a friend's house; ELSE go to the
gas station.

3. Repetition (Loop):
o Repeats a task until a condition is met (e.g., keep filling a kettle until it's full).

Conclusion:

 Flowcharts are a great tool to visualize the logical flow of processes or programs.
 Pseudo-code is an effective text-based tool for describing algorithms, bridging the gap between
logic and implementation.

Data Flow Diagrams (DFD)

What is a Data Flow Diagram (DFD)?

A Data Flow Diagram (DFD) is a graphical representation that illustrates how data moves
through a system. It helps in structuring the flow of data, identifying processes, and visualizing
the system's data transformations.

Key Points:

 DFD represents the flow of data through an information system, and how the data is processed
and transformed by different components.
 It is used for system design, analysis, and communication of processes in information systems.
 DFDs provide a clear view of how the system operates from the data perspective, without
focusing on the physical implementation details.

Why Use Data Flow Diagrams?

15
Designing Program Logic
 Diagrams the system or organization: Helps understand the data flow within a system or
organization.
 Current and Proposed Situations: Can represent both the current and desired data flow states.
 Facilitates analysis and design: Assists in identifying weaknesses and improving the system.
 Bridges analysis to design: Helps move from understanding the system to designing its
components.
 Enhances communication: Makes it easier to communicate with users and stakeholders
throughout the development process.

Types of DFDs

1. Current DFD: Depicts how data flows in the existing system.


2. Proposed DFD: Illustrates how data should flow in the redesigned or future system.
3. Logical DFD: Focuses on the functionality of the system without specific implementation details
(abstract).
4. Physical DFD: Includes implementation details, such as devices, people, and departments (real-
world entities).
5. Partitioned Physical DFD: Represents the system architecture or high-level design.

Levels of Detail in DFDs

 Context Diagram: Shows the system at a high level with just the inputs and outputs of the
system.
 Level 0 Diagram: Breaks down the system into major sub-processes and shows the data flows
between them.
 Child Diagrams (Level 1, Level 2, etc.): These are more detailed DFDs showing specific
processes, data stores, and flows, breaking down each sub-process further.

Basic DFD Symbols

1. Process (Circle or Rectangle):


o Represents an action or operation that transforms data.
o Labelled with verb phrases (e.g., "Process Order", "Generate Report").
o Can have multiple incoming and outgoing data flows.

2. Data Flow (Arrow):


o Represents the movement of data between processes, data stores, and external
entities.
o Arrows indicate the direction of data flow.

3. Data Store (Open Rectangle):


o Represents data stored within the system.
o Labelled with noun phrases (e.g., "Customer Database", "Order Data").
o A data store must have at least one incoming and one outgoing data flow.

4. Source/Sink (External Entity):

16
Designing Program Logic
o Represents external entities that interact with the system, either providing input or
receiving output.
o Sources supply data to the system; sinks receive data from the system.
o Labelled with noun phrases (e.g., "Customer", "Supplier").

Context Diagram

 The Context Diagram is the highest level of a DFD, showing the system as a single process with
external entities interacting with it.
 It shows how the system interacts with external entities (sources or sinks) and data flows.
 Benefits:
o Simple and easy to understand.
o Shows the system boundaries and the external interactions.

Example: Course Registration System (Context Diagram):

 The single process represents the entire system.


 The data flows between external entities (e.g., Student, Registrar) and the system.

Level 0 DFD

 The Level 0 Diagram decomposes the system into major sub-processes, based on the context
diagram.
 It also includes data flows between these processes, along with the external entities and data
stores.
 Example: Food Ordering System
o External entities: Customer, Supplier, Kitchen, Manager.
o Data flows between external entities and the system’s processes.
o Multiple processes are identified, and data stores are introduced.

Level 1 DFD

 Level 1 DFD breaks down each process from the Level 0 diagram into sub-processes.
 Details:
o The system’s major processes are decomposed into smaller tasks.

17
Designing Program Logic
o Data stores and flows between them are shown with more specific detail.
 Example: Food Ordering System (Level 1 DFD):
o Processes: Order Food, Generate Reports, Order Inventory.
o Data stores: Order Data Store, Inventory Data Store.
o External entities: Customer, Manager, Supplier.

Explanation:

 Order Food process: Receives orders from customers, forwards them to the kitchen, and stores
data in the Order Data Store.
 Generate Reports process: Generates reports for the manager using data from Inventory and
Order data stores.
 Order Inventory process: Sends inventory orders to suppliers and updates the Inventory Data
Store.

Key Rules in DFDs

1. Process:
o Can have multiple incoming and outgoing data flows.
o Can be connected to any other symbol (including other processes).

2. Data Flow:
o Indicates the direction of data movement between processes, data stores, and external
entities.

3. Data Store:
o Must have at least one incoming and one outgoing data flow.
o Represents stored data that can be accessed and updated.

4. Source/Sink (External Entity):


o External entities are sources (provide data to the system) or sinks (receive data from the
system).
o Represented as external systems or people interacting with the process.

DFD Example: Food Ordering System

1.2.1.1 Context Diagram:

 Process: Food Ordering System.


 External Entities: Customer, Kitchen, Supplier, Manager.
 Data Flows: Customer orders food, Supplier sends inventory data, Manager receives reports.

1.2.1.2 Level 1 Diagram:

 Processes:
o Order Food: Receives orders, forwards to Kitchen, updates Order Data Store.

18
Designing Program Logic
o Generate Reports: Generates reports for Manager using data from Order Data Store
and Inventory Data Store.
o Order Inventory: Sends inventory orders to Supplier, updates Inventory Data Store.

1.2.2 Conclusion

 DFDs are valuable tools for understanding, analyzing, and designing data-driven systems.
 They provide a clear, visual representation of how data flows through a system, highlighting
processes, data stores, and external interactions.
 The use of DFDs helps analysts and designers communicate system logic in a structured, easily
understandable way.

1.2.3 Hierarchy Input Process Output (HIPO) Diagram

The HIPO diagram is a systems analysis and design technique that was popular in the 1970s. It
represents a system’s modules in a hierarchical structure and documents each module's functions.
It helps break down the system into manageable parts and show the control flow and processes.

 Purpose: It is used for documenting the system’s modules and their functions, highlighting their
relationships in a hierarchical way.
 Example: It shows the main system at the top and sub-systems or processes beneath it,
indicating how each module interacts with others.

1.2.4 RAD (Rapid Application Development) Model


Definition: The RAD model is a type of incremental model where components or functions are
developed in parallel, almost like mini-projects. These developments are time-boxed, delivered,
and assembled into a working prototype. This helps deliver a working product quickly for
customer feedback.
Phases of RAD Model:
1. Business Modeling: Identifying the flow of information between different business functions.
2. Data Modeling: Defining the data objects needed based on the business modeling.
3. Process Modeling: Defining the transformations required to meet the business objectives.
4. Application Generation: Using automated tools to convert process models into code.
5. Testing and Turnover: Testing the components and interfaces to ensure everything works as
expected.
Advantages of RAD:
 Reduced Development Time: Faster development cycles.
 Reusable Components: Promotes component reusability.
 Customer Satisfaction: Rapid delivery and feedback result in better customer satisfaction.
 Encourages Feedback: Regular customer feedback ensures the final system meets needs.
 Quality: The model results in quicker, higher-quality systems.
Disadvantages of RAD:
 Requires Skilled Team: The team must have strong performance and technical skills.
 Modular Systems Only: Only systems that can be modularized can be built using RAD.
 High Costs: The cost of automated tools and skilled designers can be expensive.
 Not for High-Risk Projects: Not suitable when technical risk is high.

19
Designing Program Logic
 Inapplicable for Small Projects: The cost may be too high for simpler or smaller projects.
When to Use RAD:
 When the system can be built in 2-3 months.
 If there's high availability of designers and skilled developers.
 When a quick prototype is needed, and customer feedback is critical.
Prototyping Model
The Prototype model involves developing a basic version of the system, called a prototype,
based on the currently known requirements. Users interact with the prototype to clarify and
refine their needs, and the system evolves with constant feedback.
Advantages of Prototyping:
 Active User Involvement: Users interact with the system and provide feedback.
 Early Error Detection: Errors can be found early, reducing the risk of issues later in the
development.
 Quick Feedback: Immediate user feedback results in better solutions.
 Identifying Missing Functionality: The prototype helps highlight any missing or confusing
functionality early on.
Disadvantages of Prototyping:
 Slow Process: Developing a prototype can be time-consuming.
 Incomplete Model: Prototypes are not fully functional and may lack key details.
 Company Cost: Prototypes often need to be developed at the company’s cost before gaining
real user input.
When to Use Prototyping:
 When the system requires significant interaction with the end users.
 Best for online systems or systems with complex user interfaces where user feedback is critical.
 Particularly useful for human-computer interaction systems or systems that need frequent
modifications based on user feedback.
1.2.5 CASE (Computer-Aided Software Engineering) Tools
Definition: CASE tools are specialized software tools used to assist with software development
and maintenance. These tools support various stages of the Software Development Life Cycle
(SDLC), from analysis to maintenance.
Components of CASE Tools:
1. Central Repository: A storage area for all relevant project documents, diagrams, and
specifications. It acts as a data dictionary.
Types of CASE Tools:
1. Classic CASE Tools: These are traditional development support tools like debuggers and
compilers.
2. Real CASE Tools: These tools support specific SDLC phases:
o Upper CASE Tools: Support the analysis and design phases.
o Lower CASE Tools: Support the coding phase.
o Integrated CASE (I-CASE): Support analysis, design, and coding phases.
Why Use CASE Tools?
 Resource Savings: CASE tools help reduce the resources required for software development.
 Faster Development: Tools streamline processes, reducing development time and bringing
products to market quicker.
 Error Reduction: Easier identification of defects during development.
 Better Standardization: CASE tools promote standardization and reuse of software components.

20
Designing Program Logic
Benefits of Using CASE Tools:
 Shorter Time to Market: Automation and efficient tools reduce development time.
 Fewer Defects: Early detection and correction of defects.
 Easier Maintenance: Using standardized processes leads to easier software maintenance.
 Increased Reusability: Standardized tools increase the chances of reusing software components.
Summary Comparison: RAD, Prototyping, and CASE Tools
Feature RAD Prototyping CASE Tools
Main Faster development and Active user involvement Efficiency, error reduction,
Advantage customer feedback and early error detection faster time-to-market
Disadvantages Requires skilled team, Incomplete models, slow High setup cost, steep
high cost process learning curve
Best Use Case Systems needing quick Systems requiring Long-term software
delivery extensive user feedback development and
maintenance
Phases Business, Data, Process, Prototype creation and Analysis, Design, Coding,
Application, Testing iteration Testing

Operation Title: Creating a Flowchart for the Proposal Development Process using Microsoft
Visio 2007 and 2010

Conditions for Operations:

 Ensure a safe working area.


 Properly operate tools and equipment.

Equipment, Tools, and Materials:

 Computer
 Microsoft Visio 2007 and 2010
 Edraw Max
 Visual Paradigm Online

Steps to Create a Flowchart in Microsoft Visio:

1. Start Visio.
2. Click the Flowchart category.
3. Double-click Basic Flowchart.
4. Drag a flowchart shape for each step in the process onto your drawing.
5. Connect the shapes:
o Hold the pointer over the first shape.
o Click the small arrow that appears and point to the next shape.
o If the second shape is not directly aligned, drag the connector and drop it onto the
second shape.
6. Add text to a shape or connector by selecting it and typing. Click a blank area when
finished.

21
Designing Program Logic
7. Change the direction of connectors by selecting the connector, then using the Shape tab
to adjust arrows and styles.

Flowchart Proposal Development Process:

1. Open Visio:
o Click File Menu → New → Flowchart → Basic Flowchart → OK.
2. Drag and Drop Shapes:
o Refer to "Flowchart Shapes Representations" for correct symbols.
3. Connect Shapes:
o Click the Connector tool from the Standard toolbar.
o Drag from a connection point on the first shape to the next.
o The connector endpoints turn red when correctly connected.
4. Connecting One Shape to Many:
o Default connectors are set to Right-Angle.
o To change to Straight Connector:
 Click Connector tool.
 Drag from the central shape to multiple other shapes.
 Right-click each connector and select Straight Connector.
5. Return to Normal Editing:
o Click Pointer Tool on the Standard toolbar.
6. Add Text:
o Select the shape or connector and type the text.
7. Reverse Connector Direction:
o Select the connection, then use Shape Menu → Operations → Reverse Ends.
Quality Criteria:
 Ensure that the final product meets the required quality standards of proposal
development.
Lap Tests Instructions:
Using the given templates, tools, and materials, perform the following tasks:
Task 1: Recognize Symbols Used in a Flowchart and List Logical Process to Solve a
Problem
 Identify different flowchart symbols and their meanings.
 List the logical sequence to solve a given problem.
Task 2: Draw the Flowchart to Illustrate the Problem-Solving Process
 Use Microsoft Visio to create a flowchart representing a structured problem-solving
approach.
 Ensure clarity in shapes, connectors, and text annotations.

22
Designing Program Logic
Group Assignment: Systems Development Life Cycle (SDLC) and Program Logic Design
Module: Designing Program Logic
Chapter: 1 – Program Logic Design
Objective:
The objective of this group assignment is to ensure students understand the Systems
Development Life Cycle (SDLC), design documentation, and design approach coding by
applying theoretical concepts to practical scenarios.
Group Formation and Topics
Group 1: Systems Development Life Cycle (SDLC) Overview
 Research and present the six phases of SDLC.
 Provide real-world examples of software projects using SDLC.
 Create a flowchart demonstrating the steps of SDLC using Microsoft Visio or any flowchart tool.
Group 2: Feasibility Study & Requirement Analysis
 Explain Preliminary Investigation, including technical, economic, and operational feasibility.
 Conduct a feasibility analysis for a hypothetical software project (e.g., student management
system).
 Present your findings in a report and PowerPoint presentation.
Group 3: System Design & Coding Approach
 Define design documentation and explain its importance.
 Explain logical and physical system design using diagrams.
 Use pseudo-code to design a simple inventory system.
Group 4: Implementation & Testing Phase
 Explain the process of coding, debugging, and integration.
 Discuss different software testing techniques (unit testing, system testing, user acceptance
testing).
 Develop a small program in Python or Java to demonstrate unit testing.
Group 5: Deployment & Maintenance
 Describe software deployment strategies (Phased, Parallel, Pilot, Direct).
 Explain software maintenance types (Corrective, Adaptive, Perfective, Preventive).
 Conduct a case study on a real-world software failure and propose maintenance strategies.
Deliverables & Evaluation
1. Written Report (5-7 pages) – Covering research, analysis, and examples.
2. Presentation (10-15 slides) – Summarizing key points with visuals.
3. Practical Task – Flowchart, pseudo-code, or small program demonstration.
4. Peer Review – Each group will evaluate another group's work.
Submission Deadline: 24/06/2017
Grading Criteria:20%
 Content Accuracy (5%)
 Presentation Clarity (5%)
 Practical Application (5%)
 Group Collaboration & Creativity (5%)

23
Designing Program Logic

You might also like