Pseudocode
- 2021年2月09日
- 技術情報
Pseudocode is an informal form of programming description that does not require any strict programming language syntax or underlying technology considerations. Used to create an outline or draft of a program. Pseudocode summarizes the flow of a program, but excludes the underlying details. Systems designers write pseudocode to ensure that programmers understand the requirements of a software project and align the code accordingly.
A Pseudocode is a prototype sample, model, or early release of a product created for the purpose of testing concepts and for learning purposes. They help us learn without fully implementing our solutions. When developing user interfaces for our applications, we have several prototypes before the final interface. Some examples of these are wire frames, graphic designs, and mockups.
This is the way how to write pseudo code.
- Organize your task sequence and write your pseudocode accordingly.
- Start with the declaration of a pseudocode that states the main goal or goal.
We have to know there are some KEYWORDS to be used in pseudo code.
These are for start and end of a program
BEGIN, END
These are for condition statements.
IF, ELSE, ENDIF, DO, WHILE, ENDWHILE, REPEAT, UNTIL, CASE
These are for user inputs.
INPUT, GET, READ , SET
These are for displaying results.
PRINT, SHOW
Here is some sample pseudo codes.
//Conditional statement if
if "1"
print "this is 1"
if "2"
print "this is 2"
//Case condition
INPUT number
CASE number of
1: PRINT "1"
2: PRINT "2"
3: PRINT "3"
DEFAULT
PRINT "0"
ENDCASE
//While Loop
Set index to 0
WHILE index is GREATER THAN 1
PRINT index
INCREASE index BY 1
END
Function
Function sample
PRINT 'hello world'
Endfunction
There are still more keywords and syntax structures of writing pseudo codes but I think you will get the idea by reading this blog.
By Yuuma
yuuma at 2021年02月09日 07:07:22