Ross Sheppard High School
Computer Programming 20
Student Learning Guide
Writing Pseudo-code


  When you have finished this project, you will be able to:
describe pseudo-code
explain why pseudo-code is used
write pseudo-code for a simple procedure


Pseudo-code is a generic method of writing code so that programmers who look at the documentation for your program can understand the purpose and function of each of your procedures, even if they don't understand the language used to create the program. For example, a C++ programmer could understand the pseudo-code for a program written with Visual Basic, even if that programmer is not familiar with Visual Basic.

Complex programs are designed using an algorithm. An algorithm describes the steps taken to solve a programming problem. In a generic fashion, using both an algorithm and English style words to describe the problem is called pseudo-code. You have already created the Hello World program and used a few procedures - called algorithms - to make the program work. The pseudo-code for the Display Hello button would be:

Private Sub btnHello_Click()
Display Hello World on form
End Sub

Compare this to the code that you wrote, which was specific for Visual Basic:

You can see, even from this relatively simple code, that the pseudo-code is more generic and anyone could understand it. You will be required to provide the pseudo-code for all of your programs using comments within the program. All subs in all programs that you create must have pseudo-code entered as a comment.

Test Your Knowledge

Look at the code for an exit button below. Use a word processor to type the pseudo-code for this procedure. Click here to find the answer. Save the pseudo-code you just wrote, and in the future, you will be able to simply copy and paste the code into your Visual Basic programs and save yourself the trouble of typing it each time. In fact, it would be a good idea to create files for all code that you will re-use.


© 1999-2000 N.F. Mathew, EdD
File name: pseudocode.htm
Last updated on September 9, 2000