Font size
Worksheets2.1.2 Thinking ahead
Total questions: 16
Worksheet time: 8mins
What is the purpose of thinking ahead?
To make programs easy and intuitive for users to use.
selecting data from a larger pool to show only the relevant details to the object. It helps to reduce programming complexity and effort.
break down your project scope into manageable chunks.
observe and analyze phenomena, reactions, and feedback and then draw conclusions based on that input.
Define inputs.
Any data that is required to solve a problem, usually entered into the system by the user.
Hardware peripherals
The results that are passed back once the outputs have been processed and the problem solved.
Open source software
proprietary software
Define outputs
The results that are passed back once the inputs have been processed and the problem solved.
Any data that is required to solve a problem, usually entered into the system by the user.
Hardware peripherals
Open source software
proprietary software
What considerations do programmers need to make regarding inputs and outputs when thinking ahead?
Method of input/output (device used)
Data structures used
Data types used
Order of data
Identify the inputs that are likely to be used in a book reservation system i.e. at a library.
Book details: name, author
ISBN
Borrower details: name, library card<br />number
Collection point
Book cost
Identify the outputs that are likely to be used in a book reservation system i.e. at a library.
Expected waiting time
Confirmation
Availability at other libraries
Book cost
Borrower details: name, library card number
What are preconditions?
Requirements which must be met before a program can be executed.
Requirements which must be met before a program can be designed.
Requirements which must be met before a program can be concieved.
Requirements which must be met before a program can be tested.
State two advantages of including preconditions within the documentation accompanying a subroutine.
Reduces the length of the program
Reduces the complexity of the program
Reduces the running time of the program
Reduces the length of the documentation
Define caching.
The process of storing instructions or values in cache memory after they have been used, as they may be used again.
Requirements which must be met before a program can be executed.
Requirements which must be met before a program can be designed.
Requirements which must be met before a program can be concieved.
Requirements which must be met before a program can be tested.
How is caching used in storing web pages?
Web pages that a user frequently accesses are cached, so the next time one of these pages is accessed, content can be loaded without any delay.
The process of storing instructions or values in cache memory after they have been used, as they may be used again.
Requirements which must be met before a program can be executed.
As developing from scratch is not required, this saves time, money and resources.
What are the advantages of caching web pages?
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
Accuracy of the algorithms used
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?
Prefetching
Caching
Preconditions
Reusable Components
Give a limitation of caching.
Accuracy of the algorithms used
Effectiveness of algorithm in managing the cache
Content can be loaded without delay
Images and text do not have to be downloaded again multiple times
Less time is spent waiting
Give some advantages of using reusable program components.
More reliable than new components, as they have already been tested
As developing from scratch is not required, this saves time, money and resources.
Frees bandwidth for other tasks on a network
Content can be loaded without delay
Reduces the length of the documentation
Give two examples of reusable program components
Abstract data structures eg. queues and stacks
Classes
Prefetching
Preconditions
Caching
