6.6 Interpret, correct and complete algorithms Flashcards

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

Give some different ways a programmer could use to find mistakes in their programs

A

Use a trace table

Alternatively IDEs

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

What are trace tables

A

A programmer goes through the code, line by line, writing down the values of variables

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

What are IDEs?

A

Integrated Development Environments which have the ability to set breakpoints, step through code and watch variables. This is similar to trace tables and allows the computer to do the processing.

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

Why can trace tables be useful?

A

Determining the purpose of an algorithm
Finding the output of a algorithm
Finding errors in an algorithm

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

What do you have to keep in mind when drawing a trace table?

A

For every variable used, draw a column in which the order they appear
You do not need to fill in a value for a variable which does not change in a particular row

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

Explain what are syntax errors?

A

Doesn’t follow the rules of the language

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

Explain what are logical errors?

A

The logic of the program is incorrect

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

Give an example of a syntax error

A

print(“hello)

There is no final “ for the end of the string

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

Give an example of a logical error

A

average = ((n1+n2)/3)

the average would need to be divided by 2 instead of 3

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