CHAPTERS-WPS Office
CHAPTERS-WPS Office
Number Systems
Binary System
A point to be noted is that the most left bit is called the MSB (Most Significant Bit)
Denary System
0000 0 0
0001 1 1
0010 2 2
0011 3 3
0100 4 4
0101 5 5
0110 6 6
Page 1 of 107
0111 7 7
1000 8 8
1001 9 9
1010 A 10
1011 B 11
1100 C 12
1101 D 13
1110 E 14
1111 F 15
Number Conversions
Place the binary value in columns of 2 raised to the power of the number of values from
the right starting from 0. e.g. For binary value 11101110, place it in a table like this:
128 64 32 16 8 4 2 1
1 1 1 0 1 1 1 0
As can be seen it starts from 1 and then goes to 128 from left to right
Now values with 1 are to be added together, giving the final answer, as for the example, it
is 128 + 64 + 32 + 8 + 4 + 2 = 238
Take the value and successively divide it by 2, creating a table like follows:
2 142
2 71 Remainder 0
2 35 Remainder 1
2 17 Remainder 1
2 8 Remainder 1
Page 2 of 107
2 4 Remainder 0
2 2 Remainder 0
2 1 Remainder 0
0 Remainder 1
Note that when the value itself is not divisible by 2, it is divided by the previous value of
the current number and 1 is added to the remainder column for that specific number
When you reach 0, the remainder has to be read from bottom to top giving us the binary
value ( as in this case, it is 1 0 0 0 1 1 1 0 )
Separate each value from each other and convert them to denary
Hexadecimal: 2 1 F D
Denary 2 1 15 13
Divide the binary value into groups of 4 starting from the right. If at the end, the last
division is less than 4, add 0s until it reaches 4
For each group, find the denary value as shown above, and then convert each denary
value to its corresponding hexadecimal value (if less than 10, then itself, else, 10 is A, 11
is B, 12 is C, 13 is D, 14 is E and 15 is F).
After conversion, just put all the hexadecimal values in order to get the final answer
Page 3 of 107
Given Value: 1 0 0 0 0 1 1 1 1 1 1 1 0 1
Convert the value to binary as shown above, and then convert the final answer to denary
Convert the value to binary, and then convert it to hexadecimal as explained above
Binary Calculations
Binary values are not added the way denary values are added, as when adding 1 and 1, we cannot
write two because it doesn’t exist in binary.
Points to Note:
0+0=0
1+0/0+1=1
1 + 1 = 0 (1 carry)
1 + 1 + 1 = 1 (1 carry)
Overflow
When adding two values, if the solution exceeds the limit of given values, e.g., the
solution has 9 bits, but the question had 8 bits per value, the 9th bit (most left bit) is
called overflow.
Page 4 of 107
This indicates that the memory doesn’t have enough space to store the answer to the
addition done in the previous part.
1. Convert both the bytes into 8 bits (add zero to the left-hand side to match them).
Carry 1 1 1 1 1 1 1
Byte1 0 1 1 0 1 1 1 0
Byte2 1 1 0 1 1 1 1 0
overflow
solution 1 0 1 0 0 1 1 0 0
Note: We move from RHS to LHS, and when adding values, we use the rules given above. If the
bit crosses the limit (overflows), we put the value in brackets, denoting it is overflow.
Logical Shifts
The logical shift means moving a binary value to the left or the right
When doing a logical shift, keep in mind that the bit being emptied is going to become 0
1. The furthest bit in the direction to be logically shifted is removed ( in this case, one at the
LHS is removed) - ==(if it were two places, 2 bits would have been removed)==
Page 5 of 107
2. Every bit is moved in given places to the given direction ( every bit is moved one place to
the left in this case, and the leftover bit in the right is marked 0, so 10101010 would
become 01010100)
Two’s complement is a method used to represent negative values in binary. Here, the
MSB ( Most Significant Bit) is replaced from 128 to -128; thus, the range of values in a
two’s complement byte is -128 to 127
Firstly, write the binary value and locate the first one from the right; e.g., 1101100 would
have the first one at the third position from the right.
Now, switch every value to the left of the first one located above (not switching the one),
e.g., the value in our example becomes 0010100, which is the two’s complement of itself.
We do it the same way as a normal value is converted from binary to denary; we only
replace 128 with -12,8 e.g., for 1011101,0 we do the:
-128 64 32 16 8 4 2 1
1 0 1 1 1 0 1 0
-128 + 32 + 16 + 8 + 2 = -70
Page 6 of 107
Examples:
Media Access Control (MAC) addresses (a number that uniquely identifies a device on a
network)
Memory Dumps
Display error codes (numbers refer to the memory location of the error)
Memory Dumps
Hexadecimal is used when developing new software or when trying to trace errors.
Memory dump is when the memory contents are output to a printer or monitor.
Using hexadecimal makes writing code easier, faster, and less error-prone than binary.
Using machine code (binary) takes a long time to key in values and is prone to errors.
ASCII
The standard ASCII code character set consists of 7-bit code that represents the letters,
numbers and characters found on a standard keyboard, together with 32 control codes
Page 7 of 107
Every subsequent value in ASCII is the previous value + 1. e.g. “a” is 97 in ASCII, “b”
will be 98 (which is 97 + 1)
0 is at 48
A is at 65
a is at 97
When the ASCII value of a character is converted to binary, it can be seen that the sixth-
bit changes from 1 to 0 when going from lowercase to uppercase of a character, and the
rest remains the same. e.g.
Unicode
ASCII does not contain all of the international languages thus, Unicode is used to solve
this problem
Unicode supports up to four bytes per character, storing multiple languages and more
data.
Sound
Page 8 of 107
The sound waves are sampled at regular time intervals where the amplitude is measured.
However, it cannot be measured precisely, so approximate values are stored
The amplitude of the sound wave is first determined at set time intervals
Each sample of the sound wave is then encoded as a series of binary digits
Sampling Resolution:
The number of bits per sample is known as the sampling resolution (aka bit depth)
Increasing the sampling resolution increases the accuracy of the sampled sound as more
detail is stored about the amplitude of the sound.
Increasing the sampling resolution also increases the memory usage of the file as more
bits are being used to store the data.
Sampling Rate
The sampling rate is the number of sound samples taken per second, which is measured
in Hertz (Hz)
A higher sampling rate would allow more accurate sound as fewer estimations will be
done between samples.
Images
Bitmap Images
Page 9 of 107
Colour Depth
The number of bits representing each colour is called the colour depth.
An 8-bit colour depth means that each pixel can be one of 256 colours (because 2 to the
power of 8 = 256)
A 1-bit colour depth means each pixel can store one colour (because 2 to the power of 1
is 2) - ( This is done as the bit can either be 0 or 1, with 0 being white and 1 being black)
Increasing colour depth increases the size of the file when storing an image.
Image Resolution
Image resolution refers to the number of pixels that make up an image; for example, an
image could contain 4096 × 3072 pixels.
Photographs with a lower resolution have less detail than those with a higher resolution.
When a bitmap image is ‘ blurry ‘ or ‘ fizzy ’ due to having a low amount of pixels in it
or when zoomed, it is known as being pixelated.
8 bits is a byte
4 bits is a nibble
Conventional System
The file size of an image is calculated as image resolution (in pixels) × colour depth (in
bits)
The size of a mono sound file is calculated as sample rate (in Hz) × sample resolution (in
bits) × length of sample (in seconds). (For a stereo sound file, you would then multiply
the result by two.)
File Types
Page 11 of 107
Stored as a series of demands but no actual music notes
The first byte is the status byte – which informs the MIDI device what function to
perform
Encoded in the status byte is the MIDI channel (operates on 16 different channels)
Key pressure: indicates how hard it has been pressed (loudness of music)
MP3
It uses technology known as Audio Compression to convert music and other sounds into
an MP3 file format
Done using file compression algorithms, which use Perceptual Music Shaping
Certain sounds are removed without affecting the quality, too much
Use lossy format as the original file is lost following the compression algorithm
MP4
This format allows the storage of multimedia files rather than just sound
Page 12 of 107
Music, videos, photos and animations can be stored
JPEG will reduce the raw bitmap image by a factor between 5 and 15
All the data bits from the original file are reconstructed again when the file is
uncompressed.
Important for files where the loss of data would be disastrous (spreadsheet)
No data is lost
Run-Length Encoding
It reduces the size of a string of adjacent, identical data (e.g. repeated colours in an
image)
A repeating string is encoded into two values: the first value represents the number of
identical data items (e.g. characters), and the second value represents the code of the data
item (such as ASCII code if it is a keyboard character), e.g. ‘aaaaabbbbccddddd’ becomes
“05 97 04 98 02 99 05 100.”
Page 13 of 107
RLE is only effective where there is a long run of repeated units/bits
One difficulty is that RLE compression isn't perfect for strings like "cdcdcdcdcd". We use
a flag to solve this; e.g., 255 can be made as the flag. Now 255 will be put before every
repeating value, e.g. our previous example becomes 255 05 97 255 04 98 255 02 99 255
05 100 where 255 now indicates that the next character/set of characters is approaching
The file compression algorithm eliminates unnecessary data bits like in MP3 and JPEG
formats.
Data Transmission
Types and Methods of Data Transmission
Data Packets
Packet Structure -
Header
Payload
Trailer
Error-Checking methods
Packet Switching - Method of data transmission where the data is broken into multiple
packets. Packets are then sent independently from start to end and reassembled at the
receiver’s computer.
Advantages Disadvantages
Possible to overcome failed or busy nodes More prone to errors in real-time streaming
High data transmission speed Delay at the receiver while the packets are being re-
ordered
Data Transmission
Half-duplex data transmission is in both directions but not at the same time (e.g., in a
phone conversation where only one person speaks)
Serial data transmission is when data is sent one bit at a time over a single wire
Parallel data transmission is when data of several bits (1 byte) are sent down several
wires at the same time.
Page 15 of 107
Comparison of Serial and Parallel Data Transmission
Serial Parallel
Better for longer distances (Telephone Lines) Better for short distances (Internal circuits)
Used when the size of data transmitted is small Used when speed is necessary
Advantages Disadvantages
Only fit one way, prevents incorrect connections Maximum cable length is about 5 metres
Backwards compatible
Industry-standard
Parity Checks
Type Types -
0 1 0 1 1 0 1 0
The LMB (Left-Most Bit) is the parity bit. As the number of 1s is even, the parity bit
would be set to even.
Two bits may change during transmission; therefore error is not found
Even though the parity checks would reveal the errors, the bit(s) changed wouldn’t be
identified
Parity Blocks
1 2 3 4 5 6 7
A 1 0 1 1 1 1 1 0
B 1 1 0 1 0 0 0 1
C 1 0 1 1 0 1 1 1
D 1 1 0 1 0 0 1 1
E 1 1 1 0 0 1 0 0
1 1 1 0 0 1 1 1
Any changes in bits would be identified through the rows and columns
Checksum
Whenever a block of data needs to be sent, the sender would calculate the checksum
value using a specific algorithm.
Once the data has been sent, the receiver would calculate the checksum again with the
same set of data and the same algorithm used before.
Page 17 of 107
The receiver would then compare the value received and the newly calculated value. If
they aren’t matched, a request is made to re-send the data.
Echo Check
Once the data has been sent, the receiver will send the data back to the sender for
verification.
The sender would compare the received and original data for errors.
The only downside is that we wouldn’t know if the error occurred when sending the data
or sending the data back for verification.
Check Digits
Check digits are calculated from all the other digits in the data (ex-codes). The check
digit would be the last digit of the code.
Uses acknowledgements and timeouts to make sure the user received the data
The receiver would check the data for any errors; if none are found, a positive
acknowledgement is sent to the sender. However, if errors are found, a negative
acknowledgement will be sent, and the data will be sent again.
The sender uses timeouts to wait for a pre-determined amount for the acknowledgement.
If no acknowledgements are received after the timeout, the data will be sent again to the
receiver.
Encryption
Page 18 of 107
Encryption is a process of turning the data into an unreadable form so it doesn’t make
sense to hackers and other attackers.
Symmetric Encryption:
It uses an encryption key for the encryption process; the same key is used for
encrypting and decrypting the data.
Asymmetric Encryption:
Uses a public key and a private key. The public key is available to everyone,
whereas the private key is only available to the user.
The receiver would have the private key, and they would send the public key to
the sender. The sender can encrypt the message with the public key, and the data
can be decrypted using the private key.
Hardware
Computer Architecture & Von Neumann Architecture
Processor: The processor contains the Arithmetic and Logic Unit (ALU)
Page 19 of 107
Control Unit: The control unit controls the operation of the memory, processor and
input/output devices
Arithmetic Logic Unit: Carries out the logic system like calculations
System Clock: The system clock is used to produce timing signals on the control bus
Busses: Carry data through components. The following are its types.
Immediate Access Store: Stores the instructions that are to be processed, which are fetched by
the CPU
CIR Current instruction register Stores the instruction the CPU is currently decoding or executing
MAR Memory address register Stores the Address of the instruction, copy it, and sends it to MDR
MDR Memory data register Stores the Data from the address received from the MAR and sends
data to CIR
PC Program counter Stores the address of the next instruction to be fetched from
memory
Page 20 of 107
The Fetch-Execute Cycle
Memory Concept
Page 21 of 107
A computer’s memory is divided into partitions: Each partition consists of an address and
its contents, e.g.
10101010 01010110
Instruction Set:
An instruction set is a list of all the commands that a CPU can process, and the
commands are machine code
System’s Clock
The clock defines the clock cycle that synchronises all computer operations. By
increasing the clock speed, the computer's processing speed also increases. This doesn’t
mean that the computer's performance is increased, however.
Overclocking
Using a clock speed higher than the computer was designed for.
Operations become unsynchronised - (the computer would frequently crash and become
unstable)
The wider the data buses, the better the performance of the computer
Cache
Page 22 of 107
Cache memory is located within the CPU itself
stores frequently used instructions and data that need to be accessed faster, which
improves CPU performance
The larger the cache memory size, the better the CPU performance
Cores
The more cores in the CPU, the better and faster the performance
But if any number of cores are used, it could possibly slow down the system performance
as the communication between each core increases, and so do the data cables between
each. Which in turn reduces the potential system performance.
You might have heard about quad and dual cores, not septa or octa cores.
Input Devices
Two-dimensional Scanners:
The image is converted into an electronic form, which can be stored in the
computer
A scan head moves across the document until the whole page is scanned. An
image of the document is produced and sent to a lens using a series of mirrors
Page 23 of 107
The focused image now falls onto a charge-coupled device (CCD), which consists
of several integrated circuits
If the original document was a photo/image, then the scanned image forms an image file
such as JPEG
Three-dimensional Scanners
Scanners take images at several points, x, y and z (lasers, magnetic, white light)
Make use of (OCR) to produce digital images which represent the passport pages
The 2D photograph in the passport is also scanned and stored as jpeg image
The passenger’s face is also photographed using a digital camera and compared to using
face recognition software
Key parts of the face are compared (distance between eyes, width of nose)
Barcode readers/scanners
Page 24 of 107
The left and right-hand sides of the barcode are separate using guard bars
Light is reflected off the barcode; dark areas reflect little light, which allows the
bars to be read
Advantages of QR codes:
Digital Cameras
It is controlled by a microprocessor that adjusts the shutter speed, focuses the image, etc.
Photo is captured when light passes through the lens onto a light sensitive cell
Keyboards
Page 25 of 107
Each character has an ASCII value and is converted into a digital signal
Slow method
Prone to errors
Pointing devices
Mouse/trackball
Microphones
The signal goes to a sound card and is converted into digital values and stored in a
computer
Touchscreens
Page 26 of 107
Use glass as the screen material
Resistive (inexpensive)
When the top polyester is touched, the top layer and bottom layer complete a
circuit
Signals are then sent out, which are interpreted by a microprocessor to determine
where the screen was touched
Sensors
Acoustic - These sensors act like a microphone that converts sound to electric
pulses.
Page 27 of 107
Gas - These sensors measure the amount/level of any gas in the environment.
Humidity - This sensor measures the water vapour in the air or any sample.
Infra-red (active) - This IR sensor uses an invisible infrared beam. When the beam
is broken/disturbed, it changes the amount of infrared light reaching the detector.
Infra-red (passive) - These sensors detect the heat emitted by any object.
Light - These devices use light-sensitive cells that generate electric current based
on light brightness.
Moisture - This type of sensor detects the water content wherever this sensor has
been installed.
Proximity - This sensor detects the nearby objects around the sensor
(Note: You do not need to know the working principle of the sensor. But have an idea of
their purposes.)
Page 28 of 107
Signal sent from microprocessor to street lamp
Lamp switched on
Output Devices
Inkjet Printers
5. A sheet of paper is fed; the sensor detects if the paper is available in the paper tray
6. The print head moves across paper printing text/image, four ink colours sprayed in
the exact amount
9. Once it is done, the printer sends an interrupt to the processor (request for more data
to be sent)
Laser Printers
Use dry powder ink (toner) and static electricity to produce text and images
Page 29 of 107
2. Printing drum is given a positive charge; as the drum rotates, a the laser beam is
scanned across it, removing the positive charge leaves negatively charged areas which
match the text/image
3. The drum is then coated with positively charged toner; it only sticks to negatively
charged parts of the drum
5. The toner on the drum now sticks to the paper to produce a copy of the page
6. Paper finally goes through a fuser (set of heated rollers); heat melts the ink so it is
permanent
7. The discharge lamp removes all electric charge from the drum, ready to print next
page
3D Printers
2D and 3D Cutters
Actuators
Used in many control applications involving sensors and devices (ADC and DAC)
Page 30 of 107
Loudspeakers/Headphones
Sound is produced by passing the digital data through a DAC then through an amplifier
and then emerges from the loudspeaker
The front layer of the monitor is made up of Liquid Crystal Display (LCD), these tiny
diodes are grouped together in threes as pixels (LCD doesn’t emit any light)
LCD monitors are backlit using Light Emitting Diode (LED) because:
LEDs sharpens image (higher resolution), and CCFL has a yellow tint
CCFL uses two fluorescent tubes behind the LCD screen, which supplies the light
source
Light Projectors:
LCD Projector
Projectors are used to project computer output onto larger screens/interactive whiteboards
the number of micromirrors and the way they are arranged on the DLP chip determines
the resolution of the image
When the micromirrors tilt towards the light source they are on
When the micromirrors tilt away from the light source, they are off
A bright white light source passes through a colour filter on its way to the DLP chip
LCD Projectors
This beam of light is then sent to a group of chromatic-coated mirrors; these reflect the
light back at different wavelengths
When the white light hits the mirrors, the reflected light has wavelengths corresponding
to red, green, and blue
These three different lights pass through three LCD screens; these screens show the
image to be projected as millions of pixels in grayscale
When the coloured light passes through the LCD screens, a red, green and blue version of
the grey image emerges
Finally, the image passes through the projector lens onto the screen
Page 32 of 107
Memory, Storage Devices & Media
HDD, SSD, DVD, memory stick, and Blu-ray disc are some examples
Primary Memory:
RAM is used by a system when it needs to store and access data that is actively being
used or processed by the user immediately.
Features of RAM
It can be written to or read from, and the contents of the memory can be changed
Page 33 of 107
The larger the size of the RAM, the faster the computer will operate
As RAM becomes full, the processor has to access the continually hard drive to overwrite
old data on RAM with new data
Virtual memory
When RAM runs out of memory, there is a problem with memory management; thus, the
system has a high chance of crashing. This is why virtual memory comes into the picture.
The virtual memory can be either HDD or SSD (these storages are discussed below)
Page 34 of 107
You may be expected to draw a diagram like the above.
They can be larger than the physical memory provided in the RAM.
Features of ROM
Secondary Storage:
Data is stored in a digital format on the magnetic surface of the disks (platter)
A number of read/write heads can access all of the surfaces of the disk
Each platter will have two surfaces which can be used to store the data
There are no moving parts, and all data is received at the same time (not like HDD)
Store data by controlling the movement of electrons within NAND chips, as 1s and 0s
Very thin
Off-Line Storage:
CD/DVD Disks
Laser (red) light is used to read and write data on the surface of the disk.
Both systems use a single spiral track that runs from the centre of the disk to the edge
DVD uses Dual-Layering, which increases the storage capacity (two individual recording
layers)
Blu-ray Disks
The wavelength of laser light is less than CD and DVD (stores up to five times more data
than DVD)
Automatically come with secure encryption (prevent piracy and copyright infringement)
Page 36 of 107
USB Flash Memories
Cloud Storage:
Cloud storage is a method of data storage where data is stored on remote servers
The same data is stored on more than one server in case of maintenance or repair,
allowing clients to access data at any time. This is known as data redundancy.
Public cloud – this is a storage environment where the customer/client and cloud storage
provider are different companies
Hybrid cloud – this is a combination of the two above environments; some data resides
in the private cloud, and less sensitive/less commercial data can be accessed from a
public cloud storage provider
Page 37 of 107
Embedded System
A combination of hardware and software is designed to carry out a specific set of tasks.
Microcontrollers - CPU, RAM, ROM and other peripherals on one single chip
System on Chips (SoC) - microprocessor with I/O ports, storage and memory
Input from the user is sent to the microprocessor (ADC needed if the data is
analogue)
The microprocessor then sends signals to actuators which are the output
Page 38 of 107
Programmable devices have two methods of updating
Advantages Disadvantages
Small in size, therefore can easily fit into devices Can be difficult to upgrade
Very fast reaction to changing input Often thrown away as difficult to upgrade and
faults are harder to find
Dedicated to one task only Increased garbage as they are thrown away
GPS systems
Security Systems
Vending Machines
Washing Machines
Oven
Microwave
Network Hardware
A network interface card (NIC) is needed to allow a device to connect to a network (such
as the Internet).
Page 39 of 107
Media Access Control (MAC)
A MAC address comprises 48 bits which are shown as six groups of hexadecimal digits.
The first six display the manufacturer’s code, and the second half shows the device serial
number.
These do not change and are primarily constant for every device
there are two types of MAC addresses: the Universally Administered MAC
Address (UAA) and the Locally Administered MAC Address (LAA)
The only difference between the two types is that UAA is made Universally and cannot
be changed, but it is the opposite for LAA.
IP Addresses
IP address allocation:
Static IP addresses:
Dynamic IP addresses:
Page 40 of 107
Consists of four groups of decimal numbers separated by dots (e.g., 192.168.0.1).
Address format: IPv4 uses a 32-bit address, while IPv6 uses a 128-bit address.
Address space: IPv4 provides approximately 4.3 billion addresses, whereas IPv6
offers around 340 undecillion addresses.
Address allocation: IPv4 addresses are allocated manually using DHCP, while
IPv6 addresses are primarily assigned using stateless auto-configuration.
Routers
Router functionality:
It uses routing tables to determine the next hop or the next router on the path to
the destination.
Page 41 of 107
The router forwards the data packet to the appropriate next hop.
A router can act as a DHCP server (Dynamic Host Configuration Protocol) and
assign IP addresses to devices on a local network.
A router serves as the gateway between a local network and the internet.
The router receives data packets from devices on the local network and forwards
them to the internet.
It also receives incoming data packets from the internet and routes them to the
appropriate devices on the local network.
SOFTWARE
Types of Software and Interrupts
Types of Software
1. System Software e.g. Operating System, Utility programs and device drivers
System Software:
Page 42 of 107
these are a set of programs which control and manage the operations of hardware
Application Software:
maybe a single program (for example, NotePad) or a suite of programs (for example,
Microsoft Office)
user can execute the software as and when they require and it is mostly not automatic
Examples
System Software:
Compiler: Translates high-level language into machine code, allowing for direct use by a
computer to perform tasks without re-compilation.
Linker: Combines object files produced by a compiler into a single program, allowing
the use of separately written code modules in the final program.
Operating system: Software that manages basic computer functions such as input/output
operations, program loading and running, and security management, making computers
more user-friendly.
Page 43 of 107
Utility programs: Software that manages, maintains, and controls computer resources by
carrying out specific tasks, such as virus checking, disk repair and analysis, file
management, and security.
Application Software:
Word Processor: Software used for manipulating text documents, including creating,
editing, and formatting text with tools for copying, deleting, spell-checking, and
importing images.
Spreadsheet: Organizes and manipulates numerical data using a grid of lettered columns
and numbered rows, with each cell identified using a unique combination of columns and
rows. It can calculate using formulas, produce graphs, and do modelling and "what if"
calculations.
Database: Software used to organize, analyze, and manipulate data consisting of one or
more tables that hold records and fields. It provides the ability to query and report on data
and add, delete, and modify records in a table.
Control and Measuring Software: A program designed to interface with sensors and
allow a computer or microprocessor to measure physical quantities and control
applications by comparing sensor data with stored data and altering process parameters
accordingly.
Apps: Software designed to run on mobile phones or tablets, downloaded from an "App
Store" and ranging from games to sophisticated software such as phone banking.
Common examples include video and music streaming, GPS, and camera facilities.
Photo and Video Editing Software: Software that allows users to manipulate digital
photographs or videos, including changing colour, brightness, and contrast, applying
filters and other enhancements, and creating transitions between clips.
Graphics Manipulation Software: Software that allows the manipulation of bitmap and
vector images, with bitmap graphics editors changing pixels to produce a different image,
Page 44 of 107
while vector graphics editors manipulate lines, curves, and text to alter the stored image
as required.
Interrupts
Utility Software
Page 45 of 107
Computer users have access to utility programs as part of system software
Utility programs can be initiated by the user or run in the background without user input
Common utility programs include virus checkers, defragmentation software, disk analysis
and repair tools, file compression and management software, backup software, security
tools, and screensavers.
Virus checkers or anti-virus software are important for protecting computers from
malware.
They should be kept up to date and run in the background to maintain their effectiveness.
Anti-virus software checks files before they are run or loaded and compares possible
viruses against a database of known viruses.
Heuristic checking is used to identify possible viruses that are not yet on the database.
Infected files are put into quarantine for automatic deletion or for the user to decide.
Full system scans should be carried out regularly to detect dormant viruses.
Defragmentation software rearranges the data blocks on a hard disk drive (HDD) to store
files in contiguous sectors, reducing head movements and improving data access time.
As an HDD becomes full, blocks used for files become scattered all over the disk surface,
making it slower to retrieve data as the HDD read-write head needs several movements to
find the data.
When a file is deleted or extended, new data does not fill the vacant sectors immediately,
causing the files to become more scattered throughout the disk surfaces.
Page 46 of 107
A disk defragmenter rearranges the data blocks to store files in contiguous sectors
wherever possible, allowing for faster data access and retrieval.
The defragmentation process can free up previously occupied sectors and empty some
tracks.
Backup Software
Backup software is a utility software that helps create and manage backup copies of data
files and programs.
Manual backups using memory sticks or portable hard drives are good practices, but
operating system backup utilities are also recommended.
Backup utilities allow scheduling backups and only backup files if changes have been
made to them.
There could be three file versions for total security: the current version stored on the
internal HDD/SSD, a locally backed-up copy on a portable SSD, and a remote backup on
cloud storage.
Security Software
Security software is a utility software that manages access control, user accounts, and
links to other utilities such as virus and spyware checkers.
Security software uses encryption and decryption to ensure intercepted data is unreadable
without a decryption key.
It oversees software updates to verify legitimate sources and prevent malicious software
from being installed.
Access control and user accounts use IDs and passwords to secure user data and prevent
unauthorized access.
Page 47 of 107
Screensavers
Screensavers display moving and still images on the monitor screen after computer
inactivity.
They were originally developed to protect CRT monitors from 'phosphor burn'.
Screensavers are now mostly used for customizing a device and as a part of computer
security systems.
They automatically log out of the user after a certain period of inactivity.
Some screensavers activate useful background tasks like virus scans and distributed
computing applications.
Device Drivers
Device drivers translate data into a format that can be understood by the hardware device
they are associated with.
Without the appropriate device driver, a hardware device cannot work with a computer
and may not be recognised by the operating system.
USB device drivers contain descriptors, which include a vendor ID (VID), product ID
(PID) and unique serial number that allow the operating system to identify the device.
Serial numbers must be unique to avoid confusion if two devices with the same serial
number are plugged into a computer simultaneously.
Operating Systems
Operating Systems are designed to establish communication between the user and the
computer
managing files
Page 48 of 107
handling interrupts
providing an interface
managing memory
managing multitasking
Memory Management - Manages the RAM and the HDD/SSD during the execution of
programs
Page 49 of 107
Security Management - Providing security features such as Anti-Virus, System updates
and so on
Hardware Peripheral Management - Managing the device drives, Inputs, Outputs, Queues
and buffers
File Management - Opening, Creating, Deleting, Renaming, and many more functions
Multitasking - OS would share the hardware resources with each of the processes
Running of Applications
The computer starts its OS (booting up the computer) through the bootstrap loader.
The BIOS (Basic Input/Output System) tells the computer the location of the OS in the
storage.
Interrupts
Signal that causes the operating system to stop what it’s doing and service a task
Computers can only understand machine code; therefore, translators are needed
Page 50 of 107
High-Level Languages
Low-Level Languages
Assembly Language
Page 51 of 107
Translators
Compiler
Interpreter
One high-level language program statement may require several machine code
instructions to be executed.
Assembler
Page 52 of 107
Translates a high-level language Executes a high-level language Translates a low-level assembly
program into machine code. program one statement at a time. language program into machine
code.
An executable file of machine code No executable file of machine code An executable file of machine code
is produced. is produced. is produced.
One high-level language statement One high-level language program One low-level language statement is
can be translated into several statement may require several usually translated into one machine
machine code instructions. machine code instructions to be code instruction.
executed.
Compiled programs are run without Interpreted programs cannot be run Assembled programs are used
the compiler. without the interpreter. without the assembler.
A compiled program is usually An interpreter is often used when a An assembled program is usually
distributed for general use. program is being developed. distributed for general use.
Code Editor
Translator
Debugger
Error Reports
Auto-Documenter
Pretty Printing
Uses transmission protocols such as TCP and IP Collection of webpages and other information on
(Internet Protocols) websites
Page 53 of 107
Allows the user to communicate with other users via Uses HTTP(S) protocols that are written using Hypertext
chat, email, calling and more Mark-up Language (HTML)
Worldwide Collection of Interconnected Networks and URLs (Uniform Resource Locator) are used for the
Devices location of the web pages
URLs are used to locate and access web pages. The typical format of URLs is -
domain type (.com, .org, .net, .gov) or sometimes country codes (.uk, .in, .cy)
The path would usually become the file directory roots. for example,
https://www.znotes.com/computer-science
HTTP stands for Hypertext Transfer Protocol, and HTTPS stands for Hypertext Transfer
Protocol secure
Web Browsers
Page 54 of 107
ensures SSL & TLS security can be established
The browser sends the URL to the domain name server (DNS)
Cookies
They are used to track data about the users and autofill forms or give suggestions
accordingly
Types of Cookies
Temporary cookies are stored in the RAM till the Remembers the user’s login details so the user doesn’t
browser is closed. have to log in every time they visit a website
Doesn’t collect any information on the user Stored on the hard disk on the computer until their
expiry date or the user deletes them
Digital Currency
A few examples are Debit/Credit Cards, Apps (Paypal, Apple Pay, Bank Transfers and
many more)
Page 55 of 107
Cryptography was later introduced due to the problem in centralised banking systems.
Blockchain Network
Hacking isn’t possible here as transaction details would be sent to all the computers, and
the data can’t be changed without the consent of all the network members
Every time a transaction takes place, A block is created. The block would contain -
Data - Name of the sender and the receiver, amount of money and more
Previous Hash Value - Hash Value of the previous block in the chain
The first block is called the genesis block as it doesn’t point to any previous block
(Previous Hash Value - 0000)
Cyber Security
Effect:
Hacker gets access to user’s personal data (credit cards, passwords and more)
To remove risk:
Data Interception:
This involves stealing data by tapping into a wired or a wireless transmission line
Wardriving - The act of locating and using wireless internet connections illegally
Packet Sniffing - Uses Packet sniffers to examine packets sent over a line; all the
data collected is sent back to the attacker
Effect:
To remove risk:
Page 57 of 107
An attacker may be able to prevent the user from:
Accessing websites
Hacking
Effect:
To remove risk:
Firewalls
Malware
Virus - A program that can replicate itself with the intention of deleting or
corrupting files, causing a computer malfunction
Page 58 of 107
Ransomware - Attackers encrypt the user’s data until a certain amount of money
is paid
Spyware - Sends data about all the activities of the user to the attacker
Worms - Programs that can replicate themselves with the intention of corrupting
the entire network instead of the computer alone
Phishing
Attackers send legitimate-looking emails to bait the user into giving out their
information.
To remove risk:
Pharming
The attacker installs a malicious code on the computer, which redirects the user to fake
websites
Effect:
The user gives out login details and other personal details
To remove risk:
Page 59 of 107
Checking the spelling and the weblink carefully
Make sure that the green padlock is present in the URL bar
Social Engineering
Attackers create a social situation which leads to victims giving out their details (For
example - Spam calls informing them that their account has been hacked)
Access Levels - Having Different levels of access for different people (for example -
Only doctors can have access to patient’s data)
Authentication - User proving who they are. The most common methods are passwords,
PINs, Mobiles (OTPs), biometrics and more)
Fingerprint Scans Most development methods are very Intrusive as used to identify
easy to use and require very low criminals, Can’t be used if the finger
storage space to store the biometric gets dirty or damaged (e.g. cuts)
data.
Retina Scan With very high accuracy, it It is very intrusive, Takes longer to
Impossible to replicate a person’s verify, Expensive to install and set
retina up
Face Recognition Non-intrusive method, Relatively Can’t identify if there are any
cheaper changes in the lighting, change in
age or person’s age.
Voice Recognition Non-Intrusive method, verification Voices can be recorded and used for
is done quickly and relatively verification, but low accuracy and
cheaper illnesses such as colds or coughs can
affect a person’s voice, making
identification impossible.
Two-Step Verification - Requires two methods of authentication to prove who the user is
Page 60 of 107
Automatic Software Updates - Latest updates contain patches which improve device
security
Spelling and Tone - Fake emails tend to have wrong spelling and grammar (amazonn
instead of amazon), and the tone would also seem urgent
Firewalls - Hardware or Software which monitors the traffic between a network and the
user’s computer
Proxy Servers - Acts as an intermediate between the user’s computer and the web server.
They are used for -
Attacks like DDoS and Hacking attack the proxy server, keeping the web server
safe.
Privacy Settings - Used to limit who can access and see a user’s profile
SSL (Secure Socket Layer) - Set of rules used while communicating with other users on
the internet.
Page 61 of 107
Sensors take inputs, and they are sent to the microprocessor. The data is usually
analogue, so it has to go through Analogue-to-Digital Converter (ADC)
The microprocessor processes the data and makes the necessary decisions based
on its program
The actions are then executed by the actuators (Motors, wheels and so on)
Advantages Disadvantages
Any changes can be identified quickly Any computerised systems are prone to attacks
Less Expensive in the long run Over-reliance on automated systems may cause humans
to lose skills
You should be able to describe the advantages and disadvantages of an automated system
used for a given scenario.
industry
transport
agriculture
weather
gaming
lighting
science
Robotics
Page 62 of 107
Robotics is the branch of computer science that combines robot design, construction and
operation.
A robot must obey orders given by humans unless it comes into conflict with Law
1
Characteristics of a robot -
Programmable
Types of Robots -
Advantages Disadvantages
Robots can work 24/7 Robots can find it difficult to do non-standard tasks
Robots can work in hazardous conditions Robots can lead to higher unemployment
They are less expensive in the long run Risk of deskilling as robots replace humans in some task
They have high productivity and are more consistent Expensive to install and maintain in the short run
Page 63 of 107
Robots have the risk of getting hacked.
Artificial Intelligence
Types of AI -
Characteristics of AI -
Ability to Reason
Types of AI
Expert System - AI that is developed to mimic human knowledge and experiences. They
are usually used for answering questions using knowledge and inference.
They have many applications, including chatbots, diagnosis in the medical industry,
financial calculations and so on
Advantages Disadvantages
High level of Expertise Setup and Maintenance costs are very high
High Accuracy and Consistent Can only rely on the information in the system
Page 64 of 107
Machine Learning is a subset of AI in which machines are trained to learn from past
experiences.
AI Machine Learning
Representation of human intelligence in machines Machines are trained to make decisions without being
programmed to
The aim is to build machines that think like humans The aim is to make machines learn through data
acquisitions
Analysis
Design
Coding
Testing
Maintenance
Analysis
Before solving a problem, it is essential to define and document the problem clearly,
known as the "requirements specification" for the program.
The analysis stage involves using tools like abstraction and decomposition to identify the
specific requirements for the program.
Abstraction focuses on the essential elements needed for the solution while eliminating
unnecessary details and information.
Page 65 of 107
Decomposition involves breaking down complex problems into smaller, more
manageable parts that can be solved individually.
Daily tasks can be decomposed into constituent parts for easier understanding and
solving.
Design
The program specification derived from the analysis stage is used as a guide for program
development.
During the design stage, the programmer should clearly understand the tasks to be
completed, the methods for performing each task, and how the tasks will work together.
Documentation methods such as structure charts, flowcharts, and pseudocode can be used
to document the program's design formally.
Iterative testing is performed, which involves conducting modular tests, making code
amendments if necessary, and repeating tests until the module meets the required
functionality.
Testing
The completed program or set of programs is executed multiple times using various test
data sets.
This testing process ensures that all the tasks within the program work together as
specified in the program design.
Page 66 of 107
Running the program with different test data can identify and address potential issues and
errors.
The testing phase aims to verify the overall functionality and performance of the program
by evaluating its behaviour with various inputs.
Structure Diagrams
Every computer system is made up of sub-systems, which are in turn made up of further
sub-systems.
Structure Diagrams – The breaking down of a computer system into sub-systems, then
breaking each sub-system into smaller sub-systems until each one only performs a single
action. A structure diagram diagrammatically represents a top-down design. Example
below.
Pseudocode - Verbal representation of an algorithm (a process or set of steps) and flowcharts are
a diagrammatic representation.
Flowcharts: A flowchart shows diagrammatically the steps required to complete a task and the
order that they are to be performed
Algorithm: These steps, together with the order, are called an algorithm
Page 67 of 107
An example of a flowchart is given below from a past paper question in which all of the
functions of a flowchart are shown:
This flowchart’s task is to check if a rider’s height is more the requirement (1.2) in this case. It
then counts until the accepted riders are 8. After they are 8, it outputs the number of rejected
riders and tells the rest that they are ready to go!
Pseudocode
Variable – Store of data which changes during execution of the program (due to user input)
Constant – Store of data that remains the same during the execution of the program
Input & Output (READ & PRINT) – Used to receive and display data to the user respectively. (It
is recommended to use input and output commands)
INPUT Name
// Alternatively //
READ Name
Array: Array is similar to variable but it can store multiple values of same datatype under single
name
Conditional Statements:
Page 69 of 107
IF…THEN…ELSE…ENDIF
Loop Structures:
REPEAT… UNTIL – Will run at least once till condition is satisfied; Verification is done after
running codeWHILE…DO…ENDWHILE – May not ever run; Verification is done before
running codeNote: When using conditions in these loop structures and conditional statement, it
has to be kept in mind that it can be done in two ways.
use of a Boolean variable that can have the value TRUE or FALSE
comparisons made by using coparison operators, where comparisons are made from left to right
IF [BOOLEAN VARIABLE]
THEN
OUTCOME
Page 70 of 107
ELSE
OUTCOME
ENDIF
THEN
OUTCOME
ELSE
OUTCOME
ENDIF
Total ← 0
NEXT Counter
Counting: Keeping a count of the number of times an action is performed is another standard
method.
PassCount ← 0
INPUT Value
Page 71 of 107
IF Value > Range
THEN
PassCount ← PassCount + 1
ENDIF
NEXT Counter
Maximum, minimum and average : Finding the largest and smallest values in a list are two
standard methods that are frequently found in algorithms
THEN
MaximumValue ← Array[Counter]
ENDIF
THEN
MinimumValue ← Array[Counter]
ENDIF
NEXT Counter
// Average//
Page 72 of 107
Total ← 0
NEXT Counter
Linear Search: In a linear search, each item in the list is inspected sequentially until a match is
found or the entire list is traversed.
INPUT Value
Found ← FALSE
Counter ← 1
REPEAT
IF Value = Array[Counter]
THEN
Found ← TRUE
ELSE
Counter ← Counter + 1
ENDIF
IF Found
Page 73 of 107
THEN
OUTPUT Value , " found at position " , Counter, " in the list."
ELSE
ENDIF
Bubble Sort: Iteratively compare and swap adjacent elements in a list to sort them. Start from the
first element and continue until the second-to-last element. After each pass, the last element is in
its correct place. However, other elements may still be unsorted. Repeat the process, excluding
the last element, until only one element remains or no swaps are needed.
First ← 1
Last ← 10
REPEAT
Swap ← FALSE
THEN
Temp ← Array[Index]
Array[Index] ← Array[Index + 1]
Array[Index + 1] ← Temp
Swap ← TRUE
ENDIF
NEXT Index
Page 74 of 107
Last ← Last - 1
To ensure the acceptance of reasonable and accurate data inputs, computer systems must
thoroughly examine each data item before accepting it, and this is where Validation and
Verification come into play!
Validation
Validation in computer systems involves automated checks to ensure the reasonableness of data
before accepting it. If the data is invalid, the system should provide an explanatory message for
rejection and allow another chance to enter the data.
Range check
A range check verifies that a numerical value falls within specified upper and lower limits.
REPEAT
INPUT Value
THEN
OUTPUT "The student's mark should be in the range", MinimumValue ," to ", MaximumValue
Page 75 of 107
ENDIF
Length check
This can either ensure that data consists of a precise number of characters.
OUTPUT "Please enter your value of ", Limit , " characters "
REPEAT
INPUT Value
THEN
OUTPUT "Your value must be exactly" , Limit ," characters, please re-enter "
ENDIF
It can also check if the data entered is a reasonable number of characters or not
REPEAT
INPUT Value
THEN
Type check
A type check verifies that the entered data corresponds to a specific data type.
REPEAT
INPUT Value
THEN
ENDIF
Presence check
A presence check checks to ensure that some data has been entered and the value has not been
left blank
REPEAT
INPUT Value
IF Value = ""
Page 77 of 107
THEN
ENDIF
Format Check
A format check checks that the characters entered conform to a pre-defined pattern.
Check Digit
A check digit is the final digit included in a code; it is calculated from all the other digits.
Check digits are used for barcodes, product codes, International Standard Book Numbers
(ISBN), and Vehicle Identification Numbers (VIN).
Verification
Verification is checking that data has been accurately copied from one source to another
There are 2 methods to verify data during entry ( there are other methods during data transfer,
but they are in paper 1)
1. Double Entry
The computer system compares both entries and if they differ, an error message is displayed,
prompting the data to be reentered.
2. Screen/Visual check
Page 78 of 107
A screen/visual check involves the user manually reviewing the entered data.
After data entry, the system displays the data on the screen and prompts the user to confirm its
accuracy before proceeding.
The user can compare the displayed data against a paper document used as an input form or rely
on their own knowledge to verify correctness.
Test Data
Test data refers to input values used to evaluate and assess the functionality and performance of a
computer program or system.
It helps identify errors and assess how the program handles different scenarios
Normal Data
Normal data is the test data which accepts values in acceptible range of values of the program
Normal data should be used to work through the solution to find the actual result(s) and see if
they are the same as the expected result(s)
e.g. in a program where only whole number values ranging from 0 to 100 (inclusive) are
accepted, normal test data will be : 23, 54, 64 , 2 and 100
Abnormal Data
Test data that would be rejected by the solution as not suitable, if the solution is working
properly is called abnormal test data / erroneous test data.
e.g. in a program where only whole number values ranging from 0 to 100 (inclusive) are
accepted, abnormal data will be: -1, 151, 200, 67.2, “Sixty-Two” and -520
Extreme Data
Extreme data are the largest and smallest values that normal data can take
Page 79 of 107
e.g. in a program where only whole number values ranging from 0 to 100 (inclusive) are
accepted, extreme data will be: 0 and 100
Boundary Data
This is used to establish where the largest and smallest values occur
At each boundary two values are required: one value is accepted and the other value is rejected.
e.g. in a program where only whole number values ranging from 0 to 100 (inclusive) are
accepted, one example of boundary data will be: 100 and 101. 100 will be accepted and 101 will
not be accepted
Trace Table
A trace table is utilized to document the outcomes of every step in an algorithm. It is employed
to record the variable's value each time it undergoes a change.
A dry run refers to the manual process of systematically executing an algorithm by following
each step in sequence.
A trace table is set up with a column for each variable and a column for any output e.g.
Test data is employed to execute a dry run of the flowchart and document the outcomes in a trace
table. During the dry run:
Whenever a variable's value changes, the new value is recorded in the respective column of the
trace table.
Page 80 of 107
Q: The flowchart below inputs the height of children who want to ride on a rollercoaster.
Children under 1.2 metres are rejected. The ride starts when eight children have been accepted.
Complete the trace table for the input data: 1.4, 1.3, 1.1, 1.3, 1.0, 1.5, 1.2, 1.3, 1.4, 1.3, 0.9, 1.5,
1.6, 1.0
0 0
1 1.4
2 1.3
1 1.1
3 1.3
2 1.0
4 1.5
3 1.2
5 1.3
6 1.4
7 1.3
Page 81 of 107
4 0.9
8 1.5 Ready to go 4
Identifying errors:
Trace tables can be used to trace errors in a program. For example, if the requirement for the
previous question would be to accept riders that are of height 1.2 too, rather than rejecting them,
then the error would have been caught in the trace table as when 1.2 is entered, it would
increment rejected which it shouldn’t in our example
The ability to write an algorithm is very important for this syllabus and paper. Some key
steps/points to be known in-order to write the perfect algorithm are as follows:
Make sure that the problem is clearly understood which includes knowing the purpose of the
algorithm and the tasks to be completed by the algorithm.
Break the problem into smaller problems (e.g. in a program which outputs average values, divide
the problem into multiple ones i.e. how to count the number of iterations and how to count the
total of all values)
Identify the data that is needed to be saved into variables/constants/arrays and what datatype it is,
and declare all the variables/constants/arrays accordingly, with meaningfull names
Decide on how you are going to construct your algorithm, either using a flowchart or
pseudocode. If you are told how to construct your algorithm, then follow the guidance.
Construct your algorithm, making sure that it can be easily read and understood by someone else.
Take particular care with syntax e.g. when conditions are used for loops and selection.
Use several sets of test data (Normal, Abnormal and Boundary) to dry run your algorithm and
check if the expected results are achieved (a trace table can be used for this purpose) . If error is
found, find the point of error in the trace table and fix it in the code.
Page 82 of 107
Note: The algorithms that you have looked at so far in these notes were not designed with
readability in mind because you needed to work out what the problem being solved was.
Programming
Next chapter
Reflecting on your learning progress will help you study more effectively.
Customise theme
🔥 BOOSTER PERK
CHAPTERS
Programming
Programming Languages
There are many high-level programming languages to choose from. We will only be treating
Python, Visual Basic, or Java.
Page 83 of 107
Visual Basic is a popular programming language that is extensively used for Windows
development. The integrated development environment (IDE) featured in this chapter is known
as Visual Studio, which is utilised for capturing screenshots.
Java is a widely adopted programming language utilised by numerous developers. The integrated
development environment (IDE) employed for capturing screenshots in this chapter is known as
BlueJ.
Programming Concepts
Constructs of a Program
Operators use arithmetic for calculations and logic and Boolean for decisions.
A variable within a computer program refers to a named storage unit with a value that can be
modified throughout the program's execution. To enhance comprehension for others, it is
advisable to assign significant names to variables.
A constant within a computer program represents a named storage unit that holds a value which
remains unchanged throughout the program's execution. Similar to variables, it is recommended
to assign meaningful names to constants to enhance comprehensibility for others.
Data Types
Page 84 of 107
Different data types are assigned to computer systems for effective processing and storage.
Data types enable effective manipulation using mathematical operators for numbers and
character concatenation.
In IGCSE Computer Science, algorithms and programs are designed to take input from a
keyboard and output to a screen.
Prompting the user with clear instructions for input is necessary for the user to understand what
is expected.
Input data in programming languages must match the required data type of the variable where it
will be stored.
By default, inputs are treated as strings, but commands can convert input to integer or real
number data types.
Users should be provided with information about the output/results for a program to be useful.
If an output statement has multiple parts, they can be separated by a separator character.
Basic Concepts
When writing the steps required to solve a problem, the following concepts need to be used and
understood:
Page 85 of 107
Sequence
Selection
Iteration
String handling
Use of operators.
Sequence
The ordering of the steps in an algorithm is very important. An incorrect order can lead to
incorrect results and/or extra steps that are not required by the task.
Selection
Selection is a very useful technique, allowing different routes through the steps of a program.
The code of this is explained in the notes of previous chapters.
Iteration
Page 86 of 107
String Handling
Strings are used to store text and can contain various characters.
An empty string has no characters, while the programming language specifies the maximum
number of characters allowed.
Characters in a string can be identified by their position number, starting from either zero or one,
depending on the programming language.
In IGCSE Computer Science, you will need to write algorithms and programs for the following
string methods:
These string manipulation methods are commonly provided in programming languages through
library routines.
LENGTH("Text Here")
LENGTH(Variable)
Page 87 of 107
SUBSTRING("Computer Science", 10, 7)
// returns the next 7 values starting from the 10th value of the string "Computer Science" i.e.
"Science"
UCASE("Text here")
UCASE(Variable)
LCASE("Text Here")
LCASE(Variable)
Selection and iteration statements can be nested, meaning one statement can be placed inside
another.
Nested statements help reduce code duplication and simplify testing of programs.
Page 88 of 107
Different types of constructs can be nested within each other, such as selection statements within
condition-controlled loops or loops within other loops.
Parameters refer to variables that store the values of arguments passed to a procedure or function.
While not all procedures and functions require parameters, some utilize them to facilitate their
operations.
PROCEDURE ProcedureName ()
[Commands]
ENDPROCEDURE
CALL ProcedureName()
Page 89 of 107
PROCEDURE ProcedureName (ParameterName : ParameterDatatype)
[Commands]
ENDPROCEDURE
Function:
[Commands]
RETURN ValueToBeReturned
ENDFUNCTION
When defining procedures and functions, the header is the first statement in the definition.
Parameters passed to the procedure or function, along with their data types.
Function calls are made as part of an expression, typically on the right-hand side.
Any part of a program can use a global variable – its scope covers the whole program
Page 90 of 107
A local variable can only be used by the part of the program it is declared in – its scope is
restricted to that part of the program.
Note: Any variables/arrays made in this procedure and functions will be local and cannot be used
out of these. To be made available all over the program, they must be declared globally in the
following way.
Library Routines
Programming language development systems often provide library routines that can be readily
incorporated into programs.
Library routines are pre-tested and ready for use, making programming tasks easier.
DIV – returns the quotient (i.e. the whole number part) of a division
Examples:
Page 91 of 107
Value1 <--- MOD(10,3) returns the remainder of 10 divided by 3
always use meaningful identifier names for variables, constants, arrays, procedures and functions
be divided into modules for each task using procedures and functions
Commenting in pseudocode:
""
""
Arrays
Page 92 of 107
An array is a data structure containing several elements of the same data type; these elements can
be accessed using the same identifier name.
The position of each element in an array is identified using the array’s index.
One-Dimensional Array
Two-Dimensional Array
When a two-dimensional array is declared in pseudocode, the first and last index values for rows
and the first and last index values for columns alongside the data type are included.
Declaring a 2D Array:
FOR ColumnCounter ← 0 TO 2
FOR RowCounter ← 0 TO 9
NEXT RowCounter
Page 93 of 107
NEXT ColumnCounter
File Handling
Data stored in RAM is volatile and will be lost when the computer is powered off.
Data saved to a file is stored permanently, allowing it to be accessed by the same program at a
later date or by other programs.
Key point: When writing in a file, the program is outputing the data to the file, and when reading
a file, the program in inputing the data from the file
\n There are 3 ways a file can be opened in a program i.e. to write, to read and to append
Writing in a file
//When opening a file to write, all the data already existing in the file is OVERWRITTEN
Page 94 of 107
// The next command of WRITEFILE would be writen on next line of the file
CLOSEFILE "filename.txt"
Reading a file:
// The value in the line (which is identified by the number of times this is being run) is stored in
the variable
CLOSEFILE "filename.txt"
// here the line can be outputted or stored in an array. This process will repeat until every line
ENDWHILE
Previous chapter
Databases
Next chapter
Page 95 of 107
Reflecting on your learning progress will help you study more effectively.
Customise theme
🔥 BOOSTER PERK
CHAPTERS
Databases
Any modifications or additions need to be made only once, ensuring data consistency.
All users access and utilize the same set of data, promoting uniformity.
Page 96 of 107
Data is stored in tables in databases. Each table consists of a specific type of data e.g. cars. These
tables HAVE to be named according to what they contain e.g. a table containing patient
information will be PATIENT
These tables consist of records (rows). Each record consists of data about a single entity (a single
item, person or event ) e.g. a single car
These tables also have columns that are knows an fields. These consist of specific information
regarding the entities that are written later in records e.g. car name, car manufacturer etc.
Note: In this chapter, skills of dealing with a database are also required so working with
Microsoft Access is needed to understand this chapter better. You have to be able to define a
single-table database from given data storage requirements, choose a suitable primary key for a
database table and also be able to read, complete and understand SQL scripts.
Validation in databases
Database management software automatically provides some validation checks, while others
need to be set up by the developer during construction.
For example; The software automatically validates fields like "DateOfAdmission" in the
PATIENT table to ensure data input is a valid date. \n
Each field will require a data type to be selected. A data type classifies how the data is stored,
displayed and the operations that can be performed on the stored value.
Page 97 of 107
The datatypes for database are quite similar to original datatypes, however, there are a few
differences.
Note: Access datatype refers to the software Microsoft Access which is a DBMS (DataBase
Management System). Here, databases could be worked upon in practical form
Primary Key
To ensure reliable identification of these items, a field called the primary key is necessary.
The primary key is a unique field that distinguishes each item within the data.
In order to serve as a primary key, a field must have values that are never repeated within the
table.
An existing field can serve as a primary key if it is unique, such as the ISBN in the book table.
In cases where all existing fields may contain repeated data, an additional field, such as
"HospitalNumber," can be added to each record to serve as the primary key.
Structured Query Language (SQL) is the standard language for writing scripts to retrieve
valuable information from databases.
By using SQL, we can learn how to retrieve and display specific information needed from a
database.
Page 98 of 107
For instance, someone visiting a patient may only require the ward number and bed number to
locate them in the hospital, while a consultant may need a list of the names of all the patients
under their care. This can be done using SQL
SQL Scripts
An SQL script is a collection of SQL commands that are used to perform a specific task, often
stored in a file for reusability.
To comprehend SQL and interpret the output of an SQL script, practical experience in writing
SQL scripts is necessary.
Select Statements:
SELECT (fieldsname)
FROM (tablesname)
WHERE (condition)
ORDER BY (sortingcondition) ;
FROM (tablesname)
WHERE (condition)
ORDER BY (sortingcondition) ;
Counting the number of records where the field matches a specified condition
Page 99 of 107
SELECT COUNT ( fieldsname )
FROM (tablesname)
WHERE (condition)
ORDER BY (sortingcondition) ;
==ORDER BY Field1, Field2, etc. – this specifies a sort in ascending or alphabetical order
starting with the first field.==
==ORDER BY Field1, Field2 DESC – this specifies a sort in descending or reverse alphabetical
order starting with the first field.==
Operators
Just like pseudocode, the operators used there can also be used here for conditions, however, a
few more are also used in databases
Programming
Previous chapter
Page 100 of 107
Boolean Logic
Next chapter
Reflecting on your learning progress will help you study more effectively.
Customise theme
🔥 BOOSTER PERK
CHAPTERS
Boolean Logic
NOT Gate
AND Gate
OR Gate
NAND Gate
NOR Gate
XOR Gate
𝐴
Page 101 of 107
‾
A Output
0 1
1 0
AND gate:
A.B
A.B
A B Output
0 0 0
0 1 0
1 0 0
1 1 1
OR gate:
+
Page 102 of 107
𝐵
A+B
A B Output
0 0 0
0 1 1
1 0 1
1 1 1
NAND gate:
A.B
A.B
A B Output
0 0 1
0 1 1
1 0 1
1 1 0
A+B
A B Output
0 0 1
0 1 0
1 0 0
1 1 0
XOR gate: A ⨁ B
A B Output
0 0 0
0 1 1
1 0 1
1 1 0
Logic Statements is a way of showing all the logics that are in place for a logic circuit.
Look at the ciruit and go around the logic gates used in the circuit
Go from the one output that is being given towards the input
Write the last gate ( the first gate you walk through ) in the middle and then, for each of the value
coming into the gate, leave space at the side
If the value coming into the gate is coming from another gate, use a bracket for the gate’s logic
Repeat process 3-4 till you are able to reach the input values fully
Go from the logic of any 2 inputs at the start, and then keep on going until you are able to reach
the final gate which gives the output
When writing the statement, make sure you show the logic statement where the output is 1
(B AND C) OR (A NOR (A NAND C)) is the logic statement for the following Logic Circuit
Create a truth table with each input possible, creating every possible combination of inputs . Tip:
For the first input, write it in the combination of 1,0,1,0 and so on. For the second, go 1,1,0,0 and
so on, and for the third one, go 1,1,1,1,0,0,0,0 going by the powers of 2 for each input. This
would guarantee each possible combination
Run through the circuit with the inputs and get the output that will be reached and write it
accordingly
For logic statements, and problem statements, convert them to logic circuits first and then do the
rest
Example
The circuit:
Create a logic expression from these rows (example, row 1 will be (NOT A AND NOT B AND
NOT C) = X
Create logic expressions for all the rows with output 1 and connect them with OR gate
Exam-Style Question
The Conditions are given so make logic statements using the conditions and the table. (NOT S
AND T) OR (S AND W) OR (NOT T AND W)
Databases
Previous chapter
Reflecting on your learning progress will help you study more effectively.
Customise theme
🔥 BOOSTER PERK