2.1.2 - Thinking ahead Flashcards

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

What is the first step in constructing a solution to a computational problem?

A

Identifying the inputs and outputs

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

What is a precondition?

A

A condition that is specified within the documentation of a subroutine.
A condition check that should be ran before the subroutine is called.

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

Advantages of preconditions

A

Specifying beforehand within the documentation allows the user to know what checks, if any, must be carried out before the subroutine is called.
If there are no preconditions then the user knows that all checks will be handled by the subroutine itself. This can save necessary coding - the shorter the program the easier it will be to debug and maintain.
Clear documentation of the inputs, outputs and preconditions helps to make the subroutine reusable.

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

What is the need for reusable program concepts? State an example.

A

Having components that have been thoroughly debugged and tested that are already written will save time in completing a project and make the project more manageable.

EG Windows DLL (Dynamic-link library) OR Programmers creating custom libraries for abstract data structures which may be used in many different modules and can be contained and managed within one whole reusable library.

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

What is caching?

A

Caching is the temporary storage of program instructions or data that have been used once and may be needed again shortly.

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

An example of caching (NOT CPU)

A

Web caching - the storing of HTML pages and images recently viewed. Gives fast access to pages that have been recently looked at and saves having to download pages again, using up unnecessary bandwidth.

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