Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Overview: This table provides a reference for commonly used pseudocode for introductory computer program design courses. You should use
this as your reference and copy and paste code examples into your projects to ensure you are using proper syntax. Be sure to indent your code
to make it more readable and use modify and enhance from the examples as needed. Also, capitalize the first letter of your pseudocode (e.g.
While, not while).
1
Character
Integer
Float
Call Requests a module, Main Module
subprogram, or function be Write “Enter 2 numbers”
executed Input Num1,Num2
Call WriteNums(num1,num2)
Write “Program complete”
Call WriteNums(num1, num2)) End Program
Subprogram WriteNums(Float num1,
Float num2)
Write “Num1 is “ + num1
Write “Num2 is “ + num2
End Subprogram
Yes
Write “OK”
Exit
2
Input Age
If Tests If a condition is true. If Enter If Age > 18 Then
Else the test condition is true one Write” You are an Adult”
End If set of statements are Else
executed, else, the other set of Write” You are Young”
statements are executed. Yes Is Age > No End If
18?
Exit
3
Repeats execution of code until
Repeat the condition is true. (Post-Test Enter
Until loop) Repeat
Input Number
Input
Until Number==0
Number Write “List Ended”
loop body
Is Number No
==0?
True?
Yes
Exit
4
While Repeats execution of code as
End While long as the condition is true. Enter Set Number=0
(Pre-Test loop) While Number < 10
Set Number=Number+1
End While
Write “Program complete”
Is Number No
< 10?
Yes
Set Number = Write
Number + 1 “Program
Complete”
loop body
Exit
Is No
Num<10?
Yes
Num=Num+1
5
Main Groups programming Main
End Program statements into the main Enter Write “Hello World”
module Write “Welcome to Class”
End
Write “Hello World”
Exit
Exit
6
Function Groups programming
End Function statements into a function that Enter Main
is often called from another Declare AreaofSquare as Float
Subprogram, function or Set AreaofSquare= Area(5)
Module Declare AreaofSquare as Float End Program
Function Area (Side) As Float
(Note: Flowchart for Set Area= Side * Side
Programming statements for End Function
Set AreaofSquare = Area(5)
the AreaofSquare function are
not shown)
Exit