Dale - Computer Science Illuminated 176

Dale - Computer Science Illuminated 176 - them to be sure...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
6.1 Problem Solving 149 Problem-Solving Phase Implementation Phase Specific Solution (Program) Test Test General Solution (Algorithm) Analyze Maintenance Figure 6.3 The interaction between problem-solving phases This form for presenting algorithms, called pseudocode , uses a mixture of English and formatting to make the steps in the solution explicit. Whatever form you use for your algorithm, you must test it by examining it carefully to be sure that it does solve the problem. The next step is to implement the plan in a way that the computer can execute it and test the results. In Polya’s list, the human executes the plan and evaluates the results. In a computer solution, a program is written expressing the plan in a language that the computer can execute. But it is the human who takes the results of the computer program and checks
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: them to be sure that they are correct. The maintenance phase maps to Polya’s last stage, where the results are examined and perhaps modified. Following an Algorithm Although you work with algorithms all the time, most of your experience with them is in the context of following them. You follow an algorithm every time you follow a recipe, play a game, assemble a toy, or take medi-cine. Let’s look at a recipe and see how this fits the description of an algo-rithm. See Figure 6.4. 2 While (the quotient is not zero) Divide the decimal number by the new base Make the remainder the next digit to the left in the answer Replace the original decimal number with the quotient...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online