Unit 1 - Lesson 2: Program Design Flashcards

1
Q

What is an Algorithm?

A

An algorithm describes a set of steps to solve a problem. It also describes the logical structure of a program by defining the actions that a program will carry out.

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

Why do programmers create algorithms before thy start to write code?

A

The reason programmers create algorithms is so they can have a clear idea of the steps required to solve the problem in a general sense before they try to work out the actual code.

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

In a flowchart, input and output are shown by the same shape of box. How can you tell whether a box stands for input or output?

A

Even though they are the same shape, the input box should say “input” and the output box should say “output” and describe what the output is.

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

How is sequence shown in a flowchart algorithm?

A

The arrows show the sequence of the flowchart

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

What do the rounded rectangles show in a flowchart?

A

Rounded rectangles shows the start and end of a flowchart.

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

What do parallelograms show in a flowchart?

A

Parallelograms show the input and outputs.

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

What do normal rectangles show in a flowchart?

A

Normal rectangles show the value of a variable.

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

In the following line of pseudocode, what is the variable? What is the expression and what type of expression is it?

Month <– “January”

A

The variable is Month, the expression is January, and it is a string literal.

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

How would you write a line of pseudocode to assign user input to a variable called email_address?

A

email_address <– USERINPUT

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

How would you write a line of pseudocode to output the message Game Over.

A

OUTPUT Game Over

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

How would you write a line of pseudocode to assign the value 99 to a variable called Height.

A

Height <– 99

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

What is pseudocode?

A

Pseudocode is a way of writing out an algorithm in words. Pseudocode helps us plan our algorithm before we turn it into actual code. It is not a real program and cannot be run on a computer.

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

What is coding?

A

Turning an algorithm into a program.

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

Is an algorithm the same as code?

A

No, an algorithm is the solution to a problem, while code is the computer language in which the algorithm is implemented.

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