English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

this question was ask in pascal programming language

2006-08-26 21:15:00 · 8 answers · asked by revery 1 in Computers & Internet Programming & Design

8 answers

Am I the only over here who has work with algorithms.

Algorithm is a set of steps to be done in a specific way to solve a problem.

An algorithm can be described in many ways, including flowcharts, pseudocode & textual description!

Pseudocode, as mentioned above, is a way to descibe an algorithm (i.e. the way to solve a problem). It looks quite like a programming language with the difference that it is closer to the human language, it does not contain variable declarations or follows any specific syntax rules.

EXAMPLE:

Suppose, the simple problem: I want to know if a number is positive, negative of zero.

The algorithm would be to read the number, see if it is above zero, below zero or equal to zero & display the results.

A pseudocode would be:

Read(Number)
In Case Number
Is > 0
Write('Positive')
Is < 0
Write('Negative')
Is = 0
Write('Zero')

Now, in a programming language (e.g. Pascal) would be:

Vars Number : Integer;
Begin
Readln(Number);
If Number > 0 Then Writeln('Positive');
If Number < 0 Then Writeln('Negative');
If Number = 0 Then Writeln('Zero')
End.

& Also in VB 2005 (Console Application) - A most advanced language:

Module Example
Sub Main()
Dim Number As Integer = Console.ReadLine()
Select Case Number
Case > 0
Console.WriteLine("Positive")
Case < 0
Console.WriteLine("Negative")
Case = 0
Console.WriteLine("Zero")
End Select
End Sub
End Module

2006-08-26 23:29:38 · answer #1 · answered by Christos :) 2 · 1 0

Pseudo means not real, almost real.

It's a simple form language you use on paper to help design your software that doesn't have to conform to the rules of a particular programming language.

An algorithm in pascal is a procedure or function that solves a problem.

An algorithm in pseudo code should correspond to your algorithm in pascal with the exception that anyone should be able to read your pseudo code algorithm, and it should be easy to translate it into any programming language.

It's much easier to follow pseudo code to perform your top-down refinement, black-box & boundary testing that you should do prior to actually writing any code.

2006-08-26 21:30:38 · answer #2 · answered by Dr. Leone 4 · 0 1

algorithm: it is a stepwise logical description of the steps involved in the slution of a problem

pseudocode: pseudo code is just a semi formal code in semi formal language you choose to use to write the solution so that the reader could also learn about the algorithm involved in a easy way and can also learn about the details of how this would be inplemented in actual programming......eg. how to print 1 to 100

algorithm:
1. start
2. integer a=1
3. print i
4. increment i
5. if i is less than 100 goto step 2
6. stop

pseudocode:
for each i=0 to 100
print i
i=i+1

2006-08-26 23:36:17 · answer #3 · answered by DeAd MaN 4 · 1 0

set of rules An set of rules supplies a answer to a particular situation as a properly defined set of steps. A recipe in a cookbook is a robust occasion of an set of rules. while a working laptop or pc is used for fixing a particular situation, the stairs to the answer might desire to be communicated to the pc. This makes the learn of algorithms an important section in pc technology. Pseudocode Pseudocode is likely one among the procedures that would want for use to symbolize an set of rules. it truly is no longer written in a particular syntax it is used by using a programming language and for this reason won't be in a position to be accomplished in a working laptop or pc. there are various codecs used for writing pseudocodes and maximum of them borrow the a number of structures from basic programming languages which incorporate C, Lisp, FORTRAN, and so on

2016-11-05 21:03:07 · answer #4 · answered by harib 4 · 0 0

Pseudo code is an understandable way, of writing a program, a plan... whereas an algorithm is the actual code IE the maths.

2006-08-26 21:24:53 · answer #5 · answered by tom p 2 · 0 1

Algorithm is describing the task in abstract non-computer way while pseudocode is more concrete about what to command a computer to do.

2006-08-26 21:39:07 · answer #6 · answered by Andy T 7 · 1 1

algorithm is a stepwise description of a problem.
pseudocode is a code generated by a compiler.

2006-08-26 21:21:59 · answer #7 · answered by iyiogrenci 6 · 0 2

you can also post your questions at http://www.tekpool.com/forums and get answers from a better suited community

2006-08-30 08:11:49 · answer #8 · answered by poojasl271 1 · 0 0

fedest.com, questions and answers