ALGORITHM ALGORITHM-it is a finite set of instructions which if followed, accomplish a particular task. It serves as a mean to express the underlying conceptual operations PROGRAMMINGMETHDOLODGY AND SOFTWAREENGINEERING 港城市大 Copyrighto1998 Angus Wu
PROGRAMMING METHDOLODGY AND SOFTWARE ENGINEERING Copyright©1998 Angus Wu ALGORITHM ALGORITHM - it is a finite set of instructions which, if followed, accomplish a particular task. It serves as a mean to express the underlying conceptual operations
ALGORITHM algoRithM must satisfy the criteria input- there are zero or more quantities which are externally supplied output-at least one quantity is produced definiteness-each step (instruction ) must be clear and unambiguous finiteness- the algorithm will be terminated after a finite number of steps effectiveness-every step must be sufficiently basic that it can in principle be carried out by a person using only pencil and paper proofofcorrectness-it must be able to provide a mean to validate the correctness of the implementing operations PROGRAM MINGMETHDOLODGY AND SOFTWAREENGINEERING 港城市大 Copyrighto1998 Angus Wu ol Hone Kone
PROGRAMMING METHDOLODGY AND SOFTWARE ENGINEERING Copyright©1998 Angus Wu ALGORITHM ALGORITHM must satisfy the criteria: •input - there are zero or more quantities which are externally supplied •output - at least one quantity is produced. •definiteness- each step (instruction) must be clear and unambiguous • finiteness - the algorithm will be terminated after a finite number of steps • effectiveness - every step must be sufficiently basic that it can in principle be carried out by a person using only pencil and paper. • proof of correctness- it must be able to provide a mean to validate the correctness of the implementing operations
MEANS OF DEVELOPMENT Choice latural language-too verbose and imprecise except at the analysis phase Target programming language -this would involve in too much detail and not flexible, without information hiding and abstraction Need an intermediate language for program development PDL, program design language, or pseudocode PROGRAM MINGMETHDOLODGY AND SOFTWAREENGINEERING 港城市大 Copyrighto1998 Angus Wu
PROGRAMMING METHDOLODGY AND SOFTWARE ENGINEERING Copyright©1998 Angus Wu MEANS OF DEVELOPMENT Choice: Natural language - too verbose and imprecise except at the analysis phase. Target programming language - this would involve in too much detail and not flexible, without information hiding and abstraction. Need an intermediate language for program development. PDL, program design language, or pseudocode
INTERMEDIATE LANGUAGE PSEUDOCODE It resembles the target language in that it is a sequence of operations(steps steps is precise and unambiguous it has similar control structure of any high level structured programming languages such as C, Pascal, Perl Pseudo code C Code X= max of a b c X=a if (b>x)x=b if(c>x)x=C Pseudocode has the concept of information hiding and abstraction that allows the programmer concentrating on the problem solving development instead of coding PROGRAM MINGMETHDOLODGY AND SOFTWAREENGINEERING 港城市大 Copyrighto1998 Angus Wu
PROGRAMMING METHDOLODGY AND SOFTWARE ENGINEERING Copyright©1998 Angus Wu INTERMEDIATE LANGUAGE PSEUDOCODE It resembles the target language in that: • it is a sequence of operations (steps) • steps is precise and unambiguous •it has similar control structure of any high level structured programming languages such as C, Pascal, Perl Pseudo Code C Code x = max of a, b, c x = a; if (b > x) x = b; if (c > x) x = c; Pseudocode has the concept of information hiding and abstraction that allows the programmer concentrating on the problem solving development instead of coding
PSEUDOCODE It is a collection of steps with the following operation rules a step is a single operation .A sequence is a list of steps The steps in a sequence are performed one after the others .a sequence is written as a vertical list of steps Control structures determine the order of execution when this order is not sequential PROGRAMMINGMETHDOLODGY AND SOFTWAREENGINEERING 港城市大 Copyrighto1998 Angus Wu ol Hone Kone
PROGRAMMING METHDOLODGY AND SOFTWARE ENGINEERING Copyright©1998 Angus Wu PSEUDOCODE It is a collection of steps with the following operation rules: •A step is a single operation. •A sequence is a list of steps. •The steps in a sequence are performed one after the others. •A sequence is written as a vertical list of steps •Control structures determine the order of execution when this order is not sequential