Presentation is loading. Please wait.

Presentation is loading. Please wait.

Program Design. The design process How do you go about writing a program? –It’s like many other things in life Understand the problem to be solved Develop.

Similar presentations


Presentation on theme: "Program Design. The design process How do you go about writing a program? –It’s like many other things in life Understand the problem to be solved Develop."— Presentation transcript:

1 Program Design

2 The design process How do you go about writing a program? –It’s like many other things in life Understand the problem to be solved Develop a plan of attack (we call this the algorithm) Execute your plan of attack (write the program) ProblemAlgorithmImplementation Problem solving phase Implementation phase

3 Algorithm A sequence of precise instructions which leads to a solution is called an algorithm. –Ex: compute the product of two integers –Input two numbers, e.g., N1 and N2 –Product, P, initially set to 0 –Add the first number, i.e. N1, to P –Decrement N2 –Check whether N2 is 0 or not –If N2 is 0, output P and stop –If not, repeat these steps starting at the addition above

4 Algorithms The biggest error you can make in computer programming –Skipping the “Develop the Algorithm” phase –Sometimes hard to see with the simple programs in this course, but with more difficult programs jumping right to the implementation is unwise ProblemImplementationAlgorithm

5 Program Design


Download ppt "Program Design. The design process How do you go about writing a program? –It’s like many other things in life Understand the problem to be solved Develop."

Similar presentations


Ads by Google