Gaddis Formatting

Gaddis Keywords

AppendMode Call Case Class Close
Constant Declare Default Delete Display
Do Else End For For Each
Function If In Input Module
New Open Private Public Read
Rename Select Set Then To
Until While Write


Variables

Data Types

Integer Real String Character

Examples:

Declare <DataType> <VariableName>

Declare Integer num

or

Declare Integer num = 2


Declare Real decimalNum = 2.3

Declare String someLetters = "I AM A STRING VARIABLE, YAAAAAAAY!"

Declare Character grade = "A"


Declare <DataType> <ArrayName>[Size]

Declare String myStringArray[5]


Constants

Constant <DataType> <Name> = <Value>

Constant String coolStuff = "Sooper cool constant"



Comments

Two forward slashes before text indicates a comment.

Examples:

//Example.java

//John Smith



Operators

Mathematical

+ (Add) - (Subtract) * (Multiply)
/ (Divide) % (Modulus) ^ (Exponent)

Relational

> (Greater than) < (Less than)
>= (Greater than or equal to) <= (Less than or equal to)
== (Equal to) != (Not equal to)

Logical

AND OR NOT


Conditional Statements

If Statements

If Conditional Syntax

If Else Statements

If Else Conditional Syntax

Select Statements

Select Conditional Syntax


Loop Statements

While Loop

While Statement Syntax

Do While Loop

Do While Loop Syntax

Do Until Loop

Do Until Loop Syntax

For Loop

For Loop Syntax

For Each Loop

For Each Loop Syntax


Subroutines

Modules

Module Syntax

Functions

Remember a function must return a value.


Function Syntax


Classes

Class Syntax


Indentation

Psucculint checks for proper indentation of pseudocode.

Your indentation should be between 4-5 spaces for each nested statement.

Remember your indentation should be the same on the statements end statement.

(The opening If should have a closing End If at the same indentation)


Indentation Syntax