Unit 3 - Pseudocode

Posted on Friday, May 7, 2010 by B[H] | 0 comments
Labels:

Pseudocode is an abbreviated version of actual computer code. The geometric symbols used in flowcharts are replaced by English-like statements that outline the process. Pseudocode looks more like computer code than does flowchart. It allows programmer to focus on the steps required to solve a problem rather than on how to use computer language.

The programmer can describe the algorithm in computer language form without being restricted by the rules of the computer language. When the pseudocode is completed it can be easily translated into any computer language.
The following is pseudocode for the price of discount sales item problem:

Program: determine the price of discount item on sale.
Read price (Input)
Set the value of discount = rate of discount * price entered (Process)
price of discount item = price of item - value of discount (Process)
Display the price after discount (Output)

Pseudocode has several advantages. It is compact and probably will not extend for many pages as flowcharts commonly do. Also the plan looks like the code to be written and preferred by many programmers.

No comments:

Post a Comment