2.1.2 thinking ahead Flashcards

1
Q

what is the purpose of thinking ahead?

A

to make programs easy and intuitive for users to use.

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

define inputs

A

any data that is required to solve a problem, usually entered into the system by the user

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

define outputs

A

the results that are passed back once the inputs have been processed and the problem solved

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

what 3 considerations do programmers need to make regarding inputs and outputs when thinking ahead?

A

method of input/output, data structures used, data types used, order of data

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

what are preconditions?

A

requirements which must be met before a program can be executed

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

where can preconditions be defined?

A

within the code or within documentation

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

give an example where preconditions are required

A

stack functions and factorial functions

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

state 2 advantages of including preconditions within the documentation accompanying a subroutine

A

reduces the length of the program, reduces the complexity of the program, saves time needed to debug and maintain a longer program, makes subroutine more reusable

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

define caching

A

the process of storing instructions or values in cache memory after they have been used, as they may be used again

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

how is caching used in storing web pages

A

web pages that a user frequently accesses are cached, so the next time one of these pages in accessed, content can be loaded without any delay

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

what are the advantages of caching web pages?

A

content can be loaded without delay, images and text do not have to be downloaded again multiple times, frees bandwidth for other tasks on a network, less time is spend waiting

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

what is the name given to the technique in which instructions are fetched based on algorithms which predict which instructions are likely to soon be used?

A

prefetching

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

give a limitation of caching

A

accuracy of the algorithms used, effectiveness of algorithm in managing the cache, size of the cache

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

give 3 advantages of suing reusable program components

A

more reliable than new components as they have already been tested, as developing from scratch is not required this saves time money and resources

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

give 2 examples of reusable program components

A

abstract data structures, classes, subroutines

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