Operators 3 Flashcards
What is While loop in pseudocode?
WHILE condition
block of statements
ENDWHILE
i.e.
WHILE not_guessed
number
How do you define a subroutine in pseudocode?
SUBROUTINE
identifier(parameters)
block of statements
ENDSUBROUTINE
i.e.
SUBROUTINE add(1, b)
answer
How do you use return in a function in pseudocode?
RETURN value
i.e. RETURN awnser
How do you call a subroutine in pseudocode?
identifier(parameters)
i.e.
add(3, 4)
How do you do assignment in pseudocode?
identifier
How do you access an item in pseudocode?
identifier[index]
i.e.
animal[0]
How do you update an item on pseudocode?
identifier[index]
How do you length of list on pseudocode?
LEN(identifier)
i.e.
LEN(animals)
How do you do length of string on pseudocode?
LEN(identifier)
i.e.
LEN(word)
How do you do index of character in pseudocode?
identifier.INDEX(char)
i. e.
word. INDEX(“L”)
How do you get the character to a location on pseudocode?
identifier[index]
i.e.
word[0]
How do you do substring on pseudocode?
identifier[index:index]
Identifier[index:]
identifier[:index]
i.e.
word[1:3]
word[1:]
word[:3]