Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Problem-solving is the process of identifying a problem, creating an algorithm to solve the given problem, and finally implementing the algorithm to develop a computer program. An algorithm is a process or set of rules to be followed while performing calculations or other problem-solving operations.
Typology: Study notes
1 / 8
Flow chart is defined as graphical representation of the logic for problem solving. The purpose of flowchart is making the logic of the program clear in a visual representation.
Pseudo code consists of short, readable and formally styled English languages used for explain an algorithm. It does not include details like variable declaration, subroutines.
It is easier to understand for the programmer or non programmer to understand the general working of the program, because it is not based on any programming language. It gives us the sketch of the program before actual coding. It is not a machine readable Pseudo code can’t be compiled and executed. There is no standard syntax for pseudo code.
Write one statement per line Capitalize initial keyword Indent to hierarchy End multiline structure Keep statements language independent
The following gives common keywords used in pseudocodes.
IF (condition)THEN statement ... ELSE statement ... ENDIF Example: Greates of two numbers BEGIN READ a,b IF (a>b) THEN DISPLAY a is greater ELSE DISPLAY b is greater END IF END
FOR( start-value to end-value) DO statement ... ENDFOR Example: Print n natural numbers BEGIN GET n INITIALIZE i= FOR (i<=n) DO PRINT i i=i+ ENDFOR END
WHILE (condition) DO statement ... ENDWHILE Example: Print n natural numbers BEGIN GET n
INITIALIZE i= WHILE(i<=n) DO PRINT i i=i+ ENDWHILE END
Pseudo is independent of any language; it can be used by most programmers. It is easy to translate pseudo code into a programming language. It can be easily modified as compared to flowchart. Converting a pseudo code to programming language is very easy as comparedwith converting a flowchart to programming language.
It does not provide visual representation of the program’s logic. There are no accepted standards for writing pseudo codes. It cannot be compiled nor executed. For a beginner, It is more difficult to follow the logic or write pseudo code ascompared to flowchart. Example:
Addition of two numbers: BEGIN GET a,b ADD c=a+b PRINT c END