Pseudocode Building Blocks

Topics: Statement / Pages: 2 (475 words) / Published: Jul 14th, 2012
Pseudocode Building Blocks * Reading Material pseudocode does not match up with answer key. * Pseudocode can more closely model real world languages as shown below.

Sequential Commands * Refer to reading material in chapter 2 pages 33-37.

[ModuleName] Module * Keyword * Must have an End Tag
Example:
Main Module End Main Module
Declare [DataVariableName] as [DataType] * DataVariableName can be any name chosen as long as it is one word. * DataType can be one of the following basic types: Float, Real, Integer, String.
Example:
Declare NumSandwiches As Integer
Declare FirstName As String
Display (or Write) [Sting or data variable to be displayed] * If sting is used, you must have it start and end with quotations
Example 1: Display “Hello World”
Example 2:
Declare FirstName As String
FirstName= “Jack”
Display FirstName
Example 3: Declare NumBurgers As Integer NumBurgers = 2 Display NumBurgers Display “The Number of Burgers is:” & NumBurgers
Call [ModuleName] Module * ModuleName must be a valid module declared in the program
Example:
Main Module
Call DisplayTest Module
End Main Module
DisplayTest Module Display “This is a test”
End DisplayTest Module
Input [VariableName] * VariableName must be a valid variable declared in Main or the local module
Example:
Main Module Declared NumBurgers As Integer Display “Please enter the number of burgers:” Input NumBurgers Display “The number of burgers you entered is” & NumBurgers End Main Module
Set [VariableName] * Worthless pseudocode command that is not necessary and is not used by most real world
Example 1: Set NumBurgers = 10
Example 2: NumBurgers = 10 (does the same thing)
Conditional / Selection Control Structures * Refer to Chapter 3 pages 62-71
If [conditional statement] Then * Must have an End tag * Else logic is optional * Conditional statement must use a relational operator * Valid

You May Also Find These Documents Helpful

  • Pseudocode Building Blocks
  • Building Blocks
  • Building Blocks
  • Building Blocks
  • The building blocks of language
  • The building blocks of culture
  • The building blocks of a military
  • Building blocks of life
  • pseudocode
  • Pseudocode