Paper 2 notes - H446
2.1.1 Thinking abstractly
Abstraction*:
The process of omitting unnecessary detail.
Achieved by representing relevant details/elements by using symbols.
Purposes*:
Reduces resource/memory/processing requirements of a program.
Ensures programmers do not detract from the main purpose of the program.
Ensures programmers don’t waste any programming / design effort
Simplifies the problem being solved
(ii) Explain how programmers make use of reusable components when developing large
programs*:
Software is modular (1), an example being an object / function (1). Modules can be
transplanted into new software (1) or can be shared at run time (1) through the use of
program libraries (1).
The differences between an abstraction and reality for a road map*
Similarities:
Road signs / road markings – so the user can practise obeying these when driving
Traffic Lights – so user can practise obeying traffic light signals
Zebra crossing – so user can practise slowing down / stopping at zebra crossing
Cars / vehicles – so user can practice driving with other cars on the road
Pedestrians – so user can practice looking out for and avoiding pedestrians
Differences:
Scenery may be simplified
Smaller roads may be removed
Potholes may be removed
Buildings may be simplified
Imperfections / wear / damage in road markings and signs will be ignored
No need to worry about sounds of real town
2.1.2 Thinking ahead
,The input devices required would be a touch screen, magnetic stripe card reader and
keypad, while output devices would include a monitor, cash dispenser, printer and speakers.
Type Description Examples
Integer Numeric data type for numbers without fractions 6, −12, 9, 143
Real /
Numbers with decimal or fractional parts 12.3, −18.63, 3.14
Floating point
Boolean True or False values, often used as flags True(1) or False(0)
Character Single letter, digit, symbol, or control code S, g, 7, &
String Anything enclosed in quotation marks “hat”, “Fg7tY6”, “%7&*j”
Datatypes are usually needed in this section:
Q*) A car has a feature in its engine management system that is intended to save fuel and
emissions produced when the car is waiting at traffic lights or in a traffic jam. The default
option is that if the gears are disengaged and the car is not moving, the engine is switched
off. There is a display on the dashboard that indicates when the engine has been switched
off in this way.
However, sometimes it is necessary to keep the engine running even when the car is
stationary, in order to provide electric power to charge the battery, run the heater, run the
air conditioning system or keep the lights on. This, in turn, is affected by the external and
internal temperatures, the settings chosen by the driver and the intensity of light outside.
Identify four inputs needed by this feature of the engine management system (and their
datatypes).
Input Data type
Target temperature Integer / Floating point
Wheel movement Boolean
Engine running Boolean
Internal temperature Integer / Floating point
External temperature Integer / Floating point
External light level Integer / Floating point
Heating on Boolean
Air conditioning on Boolean
Gears engaged Boolean
Possible outputs:
Start engine
Stop engine
Signal to dashboard display
Q*) Julie wants to earn her living by being a successful app developer.
, Before she even writes any code, she thinks it would be sensible to find out some basic facts
about app development and the market for apps in order to maximise her chances of being
successful. State items of data that she can obtain to aid her decision.
Popularity data
Platforms available
Sales of existing similar apps
Prices charged
Does it exist already?
Methods of capturing data*:
Questionnaire/Web form - set of questions given out to potential users to fill in and
return. Can be done from a remote location and data can be entered directly into a
database
Interview - face to face discussions where potential users are asked questions
Observation - where users of the existing system are observed using it
Meeting - group of users sit down with analyst to discuss current system
Existing documentation - used in the system is examined
Caching*:
Storing data that has been used in cache/RAM as they may be needed again
Allows faster access for future use
Reusable code
Commonly used functions are often packaged into libraries for reuse.
Libraries*:
Sections of code that has been written by other authors, and contains useful
subroutines
Code from the library is likely already compiled.
May well have been written in a different language to the main program.
Reusable components include implementations of abstract data structures such as queues
and stacks as well as classes and subroutines. When designing a piece of software, the
problem is decomposed. This allows developers to think ahead about how each task can be
solved, and identify where program components developed in the past, or externally-
sourced program components, can be reused to simplify the development process.
Decomposition*: The process of breaking down a problem into smaller sub-problems to
make it more manageable and simpler to deal with.
Benefits*:
Smaller problems are more manageable
Smaller problems are easier to solve
To split tasks between different programmers, e.g. one team works on one section
and another concurrently on another
The division can lead to the development of subroutines/modules
2.1.5 Thinking concurrently