0% found this document useful (0 votes)
180 views

Design Program Logic WDDBA L III

The document discusses designing program logic by outlining steps such as understanding the problem, defining inputs and outputs, identifying processing steps, choosing a program structure, using pseudocode or flowcharts, modularizing the program, including control structures, handling errors, using appropriate data structures, planning for testing, documenting the design, reviewing and refining the design, and translating it into code. It also provides examples of different program logic design approaches like structured programming, object-oriented programming, event-driven programming, and functional programming. The learning outcomes cover selecting a program logic design approach, documenting the design, and validating the design.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
180 views

Design Program Logic WDDBA L III

The document discusses designing program logic by outlining steps such as understanding the problem, defining inputs and outputs, identifying processing steps, choosing a program structure, using pseudocode or flowcharts, modularizing the program, including control structures, handling errors, using appropriate data structures, planning for testing, documenting the design, reviewing and refining the design, and translating it into code. It also provides examples of different program logic design approaches like structured programming, object-oriented programming, event-driven programming, and functional programming. The learning outcomes cover selecting a program logic design approach, documenting the design, and validating the design.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 17

Bishoftu Polytechnic College

Department Of Information Technology


UC: Design Program Logic
TVET- PROGRAM TITLE: Web Development And Database Administration Level III

By Abenet Asmellash
 Learning Outcomes

LO1. Select the program logic design approach

LO2. Document the program logic or design

LO3. Validate the design


Designing program logic involves planning and structuring the flow of instructions that a
computer program will follow to solve a specific problem or accomplish a particular task.
Here is a general guide to designing program logic:

1. Understand the Problem:


 Clearly understand the problem or task that the program needs to solve.
 Identify the input data, processing requirements, and desired output.
2. Define Input and Output:
 Clearly define the input that the program will receive.
 Define the expected output or results that the program should produce.
3. Identify Processing Steps:
 Break down the problem into smaller, manageable steps or subtasks.
 Identify the processing steps necessary to achieve the desired output.
 4. Choose a Program Structure:
 Based on the nature of the problem, choose a suitable program structure, such as structured programming, object
oriented programming, or others.
 5. Use Pseudocode or Flowcharts:
 Express the program logic in pseudocode or use flowcharts to represent the sequence of steps and decision points
 Pseudocode is a high-level description of the logic using simple, human-readable language.
 6. Modularization:
 Break down the program into smaller modules or functions.
 Each module should perform a specific task, promoting code reusability and maintainability.
 7. Control Structures:
 Use control structures like loops (for, while) and conditional statements (if-else) to control the flow of execution
 Ensure that the control structures are logically sound and meet the requirements of the problem.
 8. Error Handling:
 Anticipate potential errors or exceptions that might occur during program execution.
 Include error-handling mechanisms to gracefully handle unexpected situations.
 9. Data Structures:
 Choose appropriate data structures to represent and organize data within the program.
 Consider arrays, lists, stacks, queues, or other structures based on the requirements.
 10. Testing Considerations:
 Plan for testing early in the design process.
 Consider how to validate the correctness of the program logic through testing and debugging.
 11. Documentation:
 Document the program logic thoroughly. This includes comments within the code and external documentation that explain
the design decisions and overall structure.
 12. Review and Refinement:
 Conduct a thorough review of the program logic design with team members or stakeholders.
 Refine the design based on feedback and potential improvements.
 13. Iterative Process:
 Understand that designing program logic is often an iterative process.
 Be open to revisiting and refining the design as the development process progresses.
 14. Implementation:
 Translate the designed program logic into actual code using a programming language.
 Follow coding standards and best practices during implementation.
 By following these steps, you can create a well-structured and logically sound program design that serves as the foundatio
LO1: Select the program logic design approach
The selection of a program logic design approach depends on various factors, including the
requirements of the project, the nature of the problem to be solved, and the preferences or
constraints of the development team. Here are some common program logic design approaches:
1.Structured Programming:
•Description: This approach emphasizes dividing the program into smaller, manageable
modules or functions. Each module performs a specific task, and control flows in a linear
manner between these modules.
•Advantages: Easy to understand, modular design facilitates code maintenance and
debugging.
•Example: Languages like C are often used for structured programming.
2.Object-Oriented Programming (OOP):
•Description: In OOP, the program is organized around objects, which are instances of
classes. These objects encapsulate data and behavior, promoting modularity, reusability,
and flexibility.
•Advantages: Encapsulation, inheritance, and polymorphism support code organization and
reuse.
•Example: Java, C++, and Python are commonly used for OOP.
3.Event-Driven Programming:
•Description: This approach is based on responding to events, such as user inputs or
system events. The program is designed to handle events and execute appropriate actions
in response.
•Advantages: Suitable for graphical user interfaces (GUIs) and real-time systems.
•Example: GUI frameworks like Java Swing or web development using JavaScript.
…….Select the program logic design approach
4.Functional Programming:
•Description: Focuses on treating computation as the evaluation of mathematical functions. Emphasizes
immutability, pure functions, and avoiding side effects.
•Advantages: Helps in writing concise and maintainable code, supports parallel and concurrent programming.
•Example: Languages like Haskell, Lisp, or parts of languages like JavaScript and Python.
5.Logic Programming:
•Description: Declarative programming paradigm where the program consists of a set of logical statements. The
system then uses inference rules to derive conclusions.
•Advantages: Well-suited for certain types of problems, particularly those involving symbolic reasoning.
•Example: Prolog is a popular logic programming language.
6.Aspect-Oriented Programming (AOP):
•Description: AOP aims to modularize cross-cutting concerns, such as logging or security, by separating them
from the main business logic.
•Advantages: Promotes better separation of concerns and allows for cleaner code organization.
•Example: AspectJ is a commonly used aspect-oriented extension for Java.
The choice of the program logic design approach often depends on the nature of the problem, the team's expertise,
and the project's specific requirements. In many cases, a combination of these approaches may be used to address
different aspects of the software design.
LO 2: Document the program logic or design
 Document the program logic or design in designing program logic
 Designing program logic involves breaking down the problem into smaller, more
manageable components and then specifying the steps or operations that need to
be performed to achieve the desired outcome.
 Here's a general outline of how you can document program logic or design
 1. Program Overview:
 Provide a brief overview of the program, including its purpose and main
functionality.
 2. Input and Output:
 Specify the input requirements and expected output of the program. This includes
the types of data the program will take as input and the type of data it will
produce as output.
 3. Algorithm or Flowchart:
 Document the high-level algorithm or flowchart of the program. This should outline the
sequence of steps that the program will follow to accomplish its task. Use pseudocode or
graphical representations (flowcharts) to illustrate the logic.

Start
|
V
Input Data
|
V
Processing
|
V
Output Result
|
V
End
 4. Modular Design:
 Break down the program into smaller modules or functions. Each module
should have a specific responsibility, making the overall logic more modular
and easier to understand.
Main Program
|
V
Module 1: Input Handling
|
V
Module 2: Data Processing
|
V
Module 3: Output Generation
 5. Data Structures:
 Specify the data structures used in the program, such as arrays, lists, or
dictionaries. Explain how data is organized and manipulated within the
program.
 6. Control Structures:
 Document the control structures used in the program, such as loops and
conditional statements. Explain how these structures control the flow of
the program.
 7. Error Handling:
 Describe how the program handles errors or unexpected situations.
Include information about any error-checking mechanisms or exception
handling.
 8. Testing Plan:
 Outline the testing plan for the program, including test cases and expected
outcomes. This helps ensure that the program functions as intended and catches any
potential issues.
 9. Comments:
 Include comments within the code to explain complex sections, decision points, or
any other information that might be helpful for someone reading the code.
 10. Sample Code (Optional):
 If space allows, include snippets of actual code to illustrate key sections of the
program logic.
 Remember that the level of detail in the documentation may vary depending on the
complexity of the program and the audience for whom it is intended.
LO3: Validate the design in program logic design
 Validation of the design in program logic design involves ensuring that the proposed design
meets the specified requirements and is logically sound. Here are some steps and
considerations for validating the design in program logic:
1. Requirements Review:
 Validate that the design aligns with the documented functional requirements.
 Verify that all identified use cases and scenarios are addressed in the design.
2. Consistency Check:
 Ensure consistency between different design artifacts (e.g., data flow diagrams, flowcharts, module designs).
 Check that the design doesn't contradict itself or introduce conflicts.
3. Feasibility Analysis:
 Assess the feasibility of implementing the proposed design within the given constraints (e.g., time, budget,
resources).
 Consider any technical or practical limitations.
4. Modularity and Encapsulation:
 Verify that the design follows modular principles.
 Check if each module has a clear purpose, well-defined inputs and outputs, and minimal
dependencies on other modules.
5. Scalability:
 Evaluate whether the design can scale appropriately to handle potential future increases in data
volume, user load, or additional features.
6. Flexibility and Extensibility:
 Ensure that the design allows for easy modification and extension.
 Assess whether the system can adapt to changes in requirements without major overhauls.
7. Usability and User Experience:
 If applicable, validate that the user interface design aligns with usability principles.
 Consider user feedback and make adjustments if the design might lead to a confusing or
cumbersome user experience.
Check for vulnerabilities and ensure that sensitive data is handled securely.
 10. Performance Evaluation:
 Assess whether the design meets performance requirements.
 Consider response times, resource utilization, and other relevant performance
metrics.
 11. Data Integrity and Consistency:
 Ensure that the design maintains data integrity and consistency.
 Check for potential issues related to data validation, transactions, and concurrency.
 12. Compliance with Coding Standards:
 Validate that the design adheres to coding standards and best practices.
 Ensure consistency in coding style and structure.
 13. Review by Peers:
 Conduct design reviews with team members or stakeholders.
 Seek feedback on the clarity, completeness, and feasibility of the design.
 Develop mitigation strategies for high-priority risks.
 Check for potential issues related to data validation, transactions, and concurrency.
 12. Compliance with Coding Standards:
 Validate that the design adheres to coding standards and best practices.
 Ensure consistency in coding style and structure.
 13. Review by Peers:
 Conduct design reviews with team members or stakeholders.
 Seek feedback on the clarity, completeness, and feasibility of the design.
 14. Documentation Validation:
 Ensure that the documentation accurately reflects the design.
 Update documentation if there are any changes to the design during the validation
process.
 15. Prototyping (if applicable):
 Consider building a prototype or a proof-of-concept to validate critical aspects of
the design.
 Consider user feedback and make adjustments if the design might lead to a
confusing or cumbersome user experience.
 8. Error Handling and Exception Scenarios:
 Review how the design addresses potential error scenarios.
 Check if the design includes appropriate error-handling mechanisms and provides
clear error messages.
 9. Security Considerations:
 Verify that the design includes necessary security measures.
 Check for vulnerabilities and ensure that sensitive data is handled securely.
 10. Performance Evaluation:
 Assess whether the design meets performance requirements.
 Consider response times, resource utilization, and other relevant performance
metrics.
 11. Data Integrity and Consistency:

You might also like