Comments#

We add comments to our code using //#

// This is a comment in my code it does nothing

Lines that start with // are not executed#

// This is a comment in my code it does nothing
// OUTPUT "Hello world"
// No output will be displayed!

Comment calls to other programs to explain their purpose#

// Enable PIN check as listed in security requirements
EnablePin(CurrentUser, Pin)

Comments document your code so you and other programmers can understand the code#

// Using double quotes for string
// which can contains single quote
OUTPUT "It's a small world after all"

Commenting lines of code can help you debug and figure out which line of code is causing an error#

OUTPUT "Hello world"
// OUTPUT 'It's a small world after all'

Exercises#

Exercise

Ask the user to input the names of three animals. Print the animal names out once they have all been entered.

Include two comments to document the program, describe what it does.

Tip: Use three INPUT statements.

// Click 'edit' button to input your code.