Pseudocode Flashcards
How do you declare a subroutine with pseudocode?
Declare Name
End Subroutine
How do you call a subroutine in pseudocode?
call Name
How do you delare and use arrays in pseudocode?
myarray[99]
How do you do literal outputs in pseudocode?
output “blah blah blah”
How do you do variable names in pseudocode?
myvariable
How do you define variable data types in pseudocode?
myvariable is integer
How do you assign a value in pseudocode?
Set counter = 0
How do you do a selection in pseudocode?
if…
else…
…end if
How do you do an annotation in pseudocode?
{some annotation}
How do you do repetition in pseudocode?
for i…next i
repeat. ..until
do. ..loop
do. ..while
while. ..repeat
How do you get the length of a string in pseudocode?
len(string)
How do you replace part of a string in pseudocode?
Replace(string, find, replacewith)
E.g. txt = “have a happy birthday”
Message = replace(txt, “happy”, “fantastic”)
How do you do division in algorithm?
DIV
11 DIV 2 = 5
How do you do modulo division in algorithm?
MOD
11 MOD 2 = 1