Thinking Ahead Flashcards

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

What is thinking ahead in terms of computational thinking?

A

The process of thorough planning of your code to ensure an efficient outcome and where possible using caching/pre-fetching

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

What is the advantage of documenting inputs and outputs?

A

There is no ambiguity in what must be supplied to the sub-procedure and what is returned

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

What is an input?

A

The capturing of data

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

What is an output?

A

The information produced

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

What are variable identifiers?

A

A suitable/sensible name for the variable for any programming scenario

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

What is a precondition?

A

A condition that must always be true just prior to the execution of some section of code

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

What happens if a precondition is violated?

A

The effect of the section of code becomes undefined and may not carry out its intended work

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

What happens if a precondition is incorrect?

A

Security problems may arise

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

What are 3 advantages of preconditions?

A

1) It makes program components reusable
2) It cuts out unnecessary checks
3) It makes programs easier to debug and maintain

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

What is a common precondition?

A

A list must not be empty or a positive integer must be entered

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

What are reusable programs?

A

They are programs which consist of pre-written functions or modules that can be repeatedly called

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

Why are reusable programs beneficial?

A

It enables programmers to save time during development because they know those modules have already been tested

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