PSEUDOCODE Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

How to open & close a file

A

OPENFILE “filname.txt” FOR WRITE/READ/APPEND

CLOSFILE “Namefile.txt”

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

How to write and read from a file

A

WRTIEFILE “Namefile.txt”, “What do you whant to write”
READFILE”Namefile.txt”, Variable_name

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

How to declare constant

A

CONSTANT variablename = 60

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

How to declare arrey

A

DECLARE Arreyname : ARRAY[1:60] OF STRING

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

How to declare integer

A

DECLARE variablename : INTEGER

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

Explain how a new elemment can be added to the queue if it is implemented using two stacks

A

Two stacks are required so the second stack can reverse the order of the first stack
stack 1 operates as the queue with the newest elemnts at the bottom. stack 2 is empty
To add an element, pop all the elements from stack 1 and push onto stack 2
Push the new elements onto either stack
Pop all the elements of stack 2 back onto stack 1

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