Pseudocode Fundementals Flashcards

(13 cards)

1
Q

How would you introduce a global variable?

A

global variablename = data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

how do you do a psedocode for loop?

A

for i=0 to 7
print(“hello”)
next i

This will print “hello” 8 times (0 and 7 are inclusive).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

how do you do a while loop in pseudocode?

A

while [condition]
–repeated instructions–
endwhile

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

how do you do a “do” loop in pseudocode?

A

do
-repeated instructions–
until [condition]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what are the logic operators in pseudocode?

A

AND
OR
NOT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what are comparison operators in pseudocode?

A

==
!=
<
<=
>
>=

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what are the arithmetic operators in pseudocode?

A

*
/
MOD
DIV

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what function do we use to get a string’s length?

A

stringname.length

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what function do we use to extract a string from a bigger string?

A

stringname.subString(startPosition, numberofCharacters)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what command is used to open a txt file in pseudocode?

A

myFile = openRead(“sample.txt”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what pseudocode function do we use to read a line in an opened file?

A

myfile.readline()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

what pseudocode function do we use to close an opened file?

A

myfile.close()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

what function do we use to check if we are at the end of a file?

A

myfile.endofFile()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly