Docsity

algorithm and problem solving, Schemes and Mind Maps of Business Informatics

Partial preview of the text

Download algorithm and problem solving and more Schemes and Mind Maps Business Informatics in PDF only on Docsity!

Algorithms &

Problems Solving

Chapter( 1 ): Introduction

Dr. Mohamed Abdelsalam & Dr. Engi Yehia

Business Informatics & Digital Transformation Program

Lecture Outline  Introduction to Algorithms & Problems Solving  Understanding the concept of problems solving  Understanding the concept of Algorithms  Identify the problems-solving Process  Techniques to Design Algorithms  Case Study 1 (grading System)  Case Study 2 (prepare cups of tea)

Problem SolvingAlgorithm : Step-by-step problem-solving process Solution achieved in determinate amount of time

Problem Solving Process.

Phase 1 - Analyze the problem  Outline the problem and its requirements  Design (algorithm) to solve the problem ( Flow chart, pseudo code)  Algorithm tracing  Phase 2 - Implement the algorithm  Implement the algorithm in code (in Programming Language → Program)  Verify that the algorithm works  Phase 3 - Maintenance  Use and modify the program if the requirements changes

2 ) Design Algorithm

❑ Flowcharts

❑ pseudo-code

Analyze the Problem

Design AlgorithmA Flowchart is  An algorithm graphical representation.  Written as a combination of the following graphical notations: Start and End Input / output Selection Calculation Data Flow

Convert a student mark from decimal mode to ABC mode. Understand problem requirements  Is the problem statement complete and clear?  Does program require user interaction? → Input the mark  Does program manipulate data? → covert mark → Control Requirements ( IF statement )  What is the output? The mark converted to A or B or C or error  Is there subproblem? No Analyze the Problem (Example 1 )

Important Note  an algorithm may work correctly but be inefficient – by taking more time and using more resources than required to solve the problem.  becomes more important for larger programs. Analyze the Problem

Design Algorithm → Algorithm Discovery

3. Stepwise Refinement )التنقية والتهذيب(

(new solution)

 Break the problem into several sub-problems  Solve each subproblem separately  Produces a modular structure Analyze the Problem

 **Example. Making tea. Suppose we have a robot which carries out household tasks. We wish to program the robot to make a cup of tea. An initial attempt at an algorithm might be:

  1. Put tea leaves in pot
  2. Boil water
  3. Add water to pot
  4. Wait 5 minutes
  5. Pour tea into cup Analyze the Problem (Example 2 )**

the designer must know when to stop refining.

The above algorithm consists of a sequence of

steps , executed exactly once and in order

Note ( 1 )

Control requirements: while

Another common requirement is the need for

iteration.

— Example. Repeat the mark conversion for a classroom of 30 students. Each student having a unique student number from 1 to

Note ( 2 )