Basic Programming Constructs Flashcards

1
Q

What is an algorithm?

A

An algorithm is a step-by-step process or a sequence of comoutable instructions that can be used to solve a problem in a finite amount of time.

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

What is the flow of the algorithm?

A

Input, Process, Storage, Output

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

What are the types of Unified Modelling Language (UML)?

A

Flow charts, class diagrams, entity-relationship diagrams

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

What is a flowchart?

A

A flow chart is a graphical represntation where shapes are linked to represent sequential steps of an algorithm.

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

What are symbols?

A

Symbols are used to represent different types of operations.

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

What are flow lines?

A

Flow lines indicate the sequence of operations.

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

What is the symbol for terminal symbols?

A

A rectangle with rounded edges at the left and right sides.

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

What is the symbol for input/output?

A

A parallelogram.

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

What is the symbol for a process?

A

A rectangle.

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

What is the symbol for a decision?

A

A diamond.

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

What are the pros of flowcharts?

A
  • It is a way of documenting a simple program clearly
  • It is easy to understand
  • It is a universal language that can be understood by anyone
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the cons of flowcharts?

A
  • It has a limited ability to express complex logic and may not capture details of a complex process
  • It is time-consuming to alter
  • Flowcharts may become outdated if the process represents change
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the three basic programming constucts?

A

Sequence, Selection, Iteration

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

What is sequence?

A

Sequence is the order in which the lines of codes in programs run.

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

What is selection?

A

Selection determines which path a program takes when it is running.

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

What is iteration?

A

Iteration is the repeated execution of a section of code when a program runs.

17
Q

What is nested selection?

A

Nested selection is within another if-then-else statement. It has more than one condition but they are mutually exclusive.

18
Q

What is the difference between a for-loop and a while-loop?

A

A for-loop is a controlled loop while a while-loop is a conditional loop.