Pseudocode Fundementals Flashcards
(13 cards)
How would you introduce a global variable?
global variablename = data
how do you do a psedocode for loop?
for i=0 to 7
print(“hello”)
next i
This will print “hello” 8 times (0 and 7 are inclusive).
how do you do a while loop in pseudocode?
while [condition]
–repeated instructions–
endwhile
how do you do a “do” loop in pseudocode?
do
-repeated instructions–
until [condition]
what are the logic operators in pseudocode?
AND
OR
NOT
what are comparison operators in pseudocode?
==
!=
<
<=
>
>=
what are the arithmetic operators in pseudocode?
*
/
MOD
DIV
what function do we use to get a string’s length?
stringname.length
what function do we use to extract a string from a bigger string?
stringname.subString(startPosition, numberofCharacters)
what command is used to open a txt file in pseudocode?
myFile = openRead(“sample.txt”)
what pseudocode function do we use to read a line in an opened file?
myfile.readline()
what pseudocode function do we use to close an opened file?
myfile.close()
what function do we use to check if we are at the end of a file?
myfile.endofFile()