Back to marketplace

2.1.2 Thinking Ahead

No description yet. This curated deck is ready for daily study.

Total cards: 15•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (15)

#1
Front (Question)

What is the purpose of thinking ahead?

Back (Answer)

To make programs easy and intuitive for users to use.

#2
Front (Question)

Define inputs.

Back (Answer)

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

#3
Front (Question)

Define outputs.

Back (Answer)

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

#4
Front (Question)

What three considerations do programmers need to make regarding inputs and outputs when thinking ahead?

Back (Answer)

• Method of input/output (device used) • Data structures used • Data types used • Order of data

#5
Front (Question)

What are preconditions?

Back (Answer)

Requirements which must be met before a program can be executed.

#6
Front (Question)

Where can preconditions be defined?

Back (Answer)

Within the code or within documentation.

#7
Front (Question)

Give an example where preconditions are required.

Back (Answer)

Stack functions: • Check that a stack is not empty when popping an element from a stack • Check that a stack is not full when pushing an element onto a stack Factorial function - The number passed to the function cannot be negative

#8
Front (Question)

State two advantages of including preconditions within the documentation accompanying a subroutine.

Back (Answer)

• 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

#9
Front (Question)

Define caching.

Back (Answer)

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

#10
Front (Question)

How is caching used in storing web pages?

Back (Answer)

Web pages that a user frequently accessed are cached, so the next time one of these pages is accessed, content can be loaded without any delay.

#11
Front (Question)

What are the advantages of caching web pages?

Back (Answer)

• 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 spent waiting

#12
Front (Question)

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?

Back (Answer)

Prefetching

#13
Front (Question)

Give a limitation of caching

Back (Answer)

• Accuracy of the algorithms used • Effectiveness if algorithm in managing the cache • Size of the cache

#14
Front (Question)

Give three advantages of using reusable program components.

Back (Answer)

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

#15
Front (Question)

Give two examples of reusable program components.

Back (Answer)

• Abstract data structures eg. queues and stacks • Classes • Subroutines