IT notes complete
IT notes complete
Information: Data that has been processed and given context and meaning and
can be understood on its own.
o Example: 11431
o Context: Postal code
o Meaning: This is a postal code in Egypt.
that must be used for the same Collected from a secondary source and
purpose for which it was already existed for another purpose.
collected.
Asking the retailer for the shoes
Asking someone who bought the shoes
Examples
price.
about the price.
Questionnaires, Interviews,
Electoral Register and third parties.
Observation and Data Logging
The data will be relevant because
Additional unwanted data will exist or
Difference between static and dynamic information
The original source is known and The original source may not be known
so can be trusted. and so it can’t be assumed that is reliable.
Interviews: Arranged format meeting, usually between two people. The interviewer
keeps asking questions in a structured or unstructured way. Structured interviews are
similar to questionnaires, set of questions asked in the same order every time.
Unstructured interviews are different from every interviewer and there’s no scenarios to
be followed.
Observation: It’s a method of collection of data, observers are asked to collect data
about a given situation by just watching by themselves what happens.
Data Logging: Data logging means using a computer and sensors to collect data. The
data is then analysed, saved and the results are output, often in the form of graphs and
charts. Data logging systems can gather and display data as an event happens. The data
is usually collected over a period of time, either continuously or at regular intervals, in
order to observe particular trends. It involves recording data from one or more sensors
and the analysis usually requires special software. Data logging is commonly used in
scientific experiments, in monitoring systems where there is the need to collect
information faster than a human possibly could, in hazardous circumstances such as
volcanoes and nuclear reactors, and in cases where accuracy is essential. Examples of
the types of information a data logging system can collect include temperatures, sound
frequencies, light intensities, electrical currents, and pressure.
Electoral register: Also known as Electoral rolls, it is a list of people that are allowed to
vote in a certain election. Sometimes there’s an open version from this roll that anyone
can purchase and use for any purpose. They contain information like names, addresses,
ages and other personal details.
Third parties: It’s a method of collection of personal data, When you decide to deal with
certain business offering a service or a product, usually you accept their terms to sell
your personal details to other businesses, other organizations buy your data for their
own use and this data usually collected by dealing with businesses, social media or even
mobile activity.
Types of validations:
o Limit: Same like the range check but only one boundary.
Example: The minimum age for driving is 18.
o Check digit: It’s used to check if the entered identification number matches
an existing rule. It’s done by comparing the result of a calculation by a check
digit placed at the end of the identification number.
Example: A barcode “2413-6”, the check digit “6” must be equal to the
sum of the even numbers in the barcode.
Proof reading: It is the process of checking the information by making sure that it
does not contain any spelling mistakes, grammar mistakes or the formatting is
consistent and the document is accurate.
Verification: It is the process of checking if the entered data matches the original
source.
o Visual checking: The user reads and compares the entered data to the
original source.
o Double data entry: Data is entered to the system twice and checked for
consistency, if they do not match then it is incorrect.
o Parity Check: This is check is done to make sure that data is transmitted
correctly between any devices by making sure that number of 1’s in every
byte is even.
1. The data sent is converted to bytes then bits. For example the word: “Hey”
a. H is converted to 72 then converted to 01001000
b. e is converted to 101 then converted to 01100101
c. y is converted to 121 then converted to 01111001
2. The data then is determined if it has even number of 1’s or odd number of
1’s
3. If it’s even we will add 0 to end of the number and if it’s odd we will add 1
to the end of the number.
4. So the data sent will be as follows:
a. H has two 1’s so it will be 010010000
b. e has four 1’s so it will be 011001010
c. y has five 1’s so it will be 011110011
5. The data is now ready to be sent, the receiver will now check if it has even
number of 1’s, if not then the receiver knows that the data is manipulated.
o Hash Total: It’s done on fields in files by adding its values. For example:
In this file you can see Student IDs that is stored in alphanumeric form
Student Exam
ID Mark
012 50
023 45
045 40
We will use the Hash Total algorithm with Student ID field, the Student
ID field will be converted into a number form and added up, so it will
be as follows:
12 + 23 + 45 = 80
The total 80 will be sent to the receiver along with the file sent and
then the receiver will recalculate the total on the same field and
compare if both Hash Totals are equal then it’s transmitted correctly.
o Control Total: The same as the Hash Total but this time it will only calculate
the Control Total value on numeric fields and it produces meaningful values
that can be used for other purposes, for example:
The teacher will use the data in the table above to calculate the
average exam marks in the class, this will produce a control total value
of 45.
This value will be attached to the file and sent, the receiver will then
recalculate the average and make sure that they are the same, if any
difference happened then the file is probably changed during
transmission and it has errors.
1.5 Encryption
This is the process of converting readable and understandable data into unreadable data by
scrambling it and making it harder to understand and process. Encrypted data can be
intercepted but cannot be understood.
Symmetric encryption
Also known as ‘secret key encryption’. This is the oldest method of encryption. It requires both
the sender and recipient to possess the secret encryption and decryption key. The secret key
needs to be sent to the recipient.
Asymmetric encryption
It is also known as public-key cryptography. It overcomes the problem of symmetric encryption
keys being intercepted by using a pair of keys. This will include a public key which is available
to anybody wanting to send data, and a private key that is known only to recipient.
Many security companies nowadays use the asymmetric encryption to trade the secret
encryption key ( used in the symmetric encryption ) and continue to use the symmetric
encryption to send and receive data.
Encryption protocols
An encryption protocol is the set of rules setting out how the algorithms should be used to
secure information. The most popular protocol used when accessing web pages securely is
transport layer security ( TLS ). TLS is an improved version of the secure sockets layer (SSL)
protocol and has now, more or less, taken over from it, although the term SSL/TLS is still
sometimes used to bracket the two protocols together.
Purposes of SSL/TLS:
Digital certificates are issued by an entity called Certificate Authority ( CA ) and they contain
the domain name of the webserver ( the name of the website ), the CA’s digital signature and
the public key of the website.
Digital certificates prevents fraudsters from creating fake websites. Valid certificates can be
only obtained after running a number of checks from the CA. If hackers are able to break into
the CA system, they will be able to create fake certificates and will have a better opportunity to
crack encryptions.
In order to open an SSL/TLS connection, a client needs to obtain the public key. For our
purposes, we can consider the client to be a web user or a web browser and the server to be
the website. The public key is found in the server’s digital certificate.
When a browser (client) wants to access a website (server) that is secured by SSL/TLS, the
client and the server must carry out an SSL/TLS handshake. A handshake, in IT terms, happens
when two devices want to start communicating.
Handshake steps:
1. The client sends a message to the server telling it what version of SSL/TLS it uses
together with a list of types of encryption that the client can use.
2. Server responds with a message which contain the type of encryption that will be used.
3. Server shows the client digital certificate to prove authenticity.
4. Client runs a number of check to prove that the certificate is authentic.
5. Client sends a random string of bits ( 0’s and 1’s ) that is used by both client and server to
calculate the private key. The string is encrypted using the public key.
6. Client then sends an encrypted message to the server telling it the handshake is
complete
Uses of Encryption
Hard disk encryption
The principle of hard-disk encryption is fairly straightforward. When a file is written to the disk, it
is automatically encrypted by specialised software. When a file is read from the disk, the
software automatically decrypts it while leaving all other data on the disk encrypted. The
encryption and decryption processes are understood by the most frequently used application
software such as spreadsheets, databases and word processors. The whole disk is encrypted,
including data files, the OS and any other software on the disk. Full (or whole) disk encryption is
your protection should the disk be stolen, or just left unattended. So, even if the disk is still in
the original computer, or removed and put into another computer, the disk remains encrypted
and only the keyholder can make use of its contents.
There are, however, drawbacks to encrypting the whole disk. If an encrypted disk crashes or the
OS becomes corrupted, you can lose all your data permanently or, at the very least, disk data
recovery becomes problematic. It is also important to store encryption keys in a safe place,
because as soon as a disk is fully encrypted, no one can make use of any of the data or
software without the key. Another drawback can be that booting up the computer can be a
slower process.
Email
When sending emails, it is good practice to encrypt messages so that their content cannot be
read by anyone other than the person they are being sent to. Many people might think that
having a password to login to their email account is sufficient protection. Unfortunately, emails
tend to be susceptible to interception and, if they are not encrypted, sensitive information can
become readily available to hackers.
1. The first is to encrypt the actual connection from the email provider, because this
prevents hackers intercepting and acquiring login details and reading any messages
sent (or received) as they leave (or arrive at) the email provider’s server
2. Then, messages should be encrypted before sending them so that even if a hacker
intercepts the message, they will not be able to understand it. They could still delete it
on interception, but this is unlikely
3. Finally, since hackers could bypass your computer’s security settings, it is important to
encrypt all your saved or archived messages.
Indicators that you are using a secure site are the inclusion of the HTTPS:// prefix as the
starting part of the URL. There should also be a padlock icon next to the URL.
Drawbacks:
Takes more time to load encrypted data as well as requiring additional processing
power.
Takes more time to load webpages with encrypted data.
It takes up some memory from the client and server sides
Ransomwares can be used by hackers to encrypt the data of a user’s computer system
and ask for money to decrypt it back.
1.6 Processing
Data must be processed so that it can become information. Data can include personal data,
transaction data, sensor data and much more. Data processing is when data is collected and
translated into usable information. Data processing starts with data in its raw form and translates
it into a more readable format such as diagrams, graphs, and reports. The processing is required
to give data the structure and context necessary so it can be understood by other computers
and then used by employees throughout an organisation.
Batch Processing
Input data is stored in a file called transaction file and at a scheduled time, the computer
processes the collected data in one go.
Examples:
Online Processing
Here the user is in direct communication with the computer system and the data is processed
shortly.
Examples:
Examples:
Greenhouses
Intensive care units
Weather stations
2.1.3 Compilers
It translates the program written in a high-level programming language into machine code
which a computer can understand. The file created with the machine code is known as an
executable file ( Object code file ) because it can be executed by the processor. When a
program is compiled, the whole source code is translated into the executable file at once and
can then be distributed to customers and individual computers, it can only run on operating
systems for which the compiler has translated it.
2.1.4 Interpreters
They also translate a program written in a high-level programming language into machine
code, but use a different method. The whole source program is translated one line at a time.
This can be less efficient than a compiler because it takes time to do the translating as the
program is being executed and analyzed each time around. The source program can be used
with any operating system.
Compiler Interpreter
Translates source code into object code all at Translates source code into object code one
once line at a time
Compiled object code will only work on the Source code can be translated into object
operating system it has been compiled for code for more than one operating system
2.1.5 Linkers
Computer programs often consists of several parts of programming code. Each part carries out
a specific task (module) within the program. Each part will have been compiled into a separate
object file. The function of a linker is to combine the object files together to form a single
executable file.
2.2.1 Anti-virus
It deals with threats such as adware and spyware as well as viruses. It has two main functions.
The first is an anti-virus monitor that is continually monitoring the system for viruses and
malware. The second function is to check for viruses or malware that may already be on a
system.
When a malware is found, the antivirus either deletes the file which the malware is attached to
or quarantine the file and tries to fix it.
There are 3 algorithms that the antivirus uses to find a malware in a file:
Signature based algorithm: it compares the files to a known database of malware and
checks for any match. If the database is outdated, it will lead to a undetectable malware.
Heuristic based algorithm: the source code of any program is compared to known
source code of malware, if any percentage of match found the antivirus will start acting
as if it’s a malware. It may lead to false positives.
Behavioral based algorithm: the antivirus is waiting for any unusual activities from the
programs on the system, if it finds a malware-like actions, it will immediately stop the
program from running.
2.2.2 Backup
Back-up software is a program that is used to keep copies of files from a computer or copy the
content of a server’s backing storage. The back-up is an exact duplicate of the files. It can be
used for restoring the original files, should the original files become corrupted or deleted,
accidentally or deliberately. Backup software allows the user to select the time and type of
back-up they want and how regularly the back-up is to take place.
Lossy compression: permanently deletes data bits that are unnecessary, such as the
background in a frame of a video which might not change over several frames.
Commonly used with computer images with a low quality resolution.
Lossless compression: after compression, the file is converted back into its original
state, without the loss of a single bit (binary digit) of data. When the lossless
compression software sees a repeated sequence of bits it replaces the repeated
sequences with a special character which indicates what is being repeated and how
many times.
Defragmentation software is used to organise the data on the disk by moving the data blocks
around to bring all the parts of a file together so they are contiguous. As a result, data retrieval is
made easier and quicker. With fragmented files it takes longer for the read–write heads to
move over the surfaces to find all the different fragments of files than if the data is held in
sequence. In addition, the software provides additional areas of free space and more storage
capacity.
2.2.5 Formatting
Disk formatting is the configuring of a data storage medium such as a hard disk or SSD for initial
use. It can be performed on a disk that already has files on it, but all those files would be erased.
Low level formatting: prepares the actual structure of the disk by dividing the disk into
cylinders and tracks and then dividing the tracks into sectors. This type of formatting is
usually carried out by manufacturers not individual users. If users were to attempt this,
there are at least two drawbacks: after erasing all the files, it would be almost impossible
to restore them and if done repeatedly, it would shorten the life of the medium.
High level formatting: it does not permanently erase data files but deletes the pointers
on the disk that tell the OS where to find them. High-level formatting is typically done to
erase the hard disk and reinstall the OS back onto the disk drive. Unlike low-level
formatting, the files are retrievable. One benefit of disk formatting is that it can remove
viruses.
2.2.7 Deleting
The delete utility is a piece of software which deletes the pointers that tell the OS where to find
the file. The OS now considers these sectors to be available for the writing of fresh data. Until
new data is written to the space the file occupies, users can still retrieve the data. Data recovery
software is available which allows users to retrieve deleted data.
The hard disk is divided into several platters that contains the data written on it, the mechanical
arms keeps moving, without touching the surface, to read and write on the platters.
The platters are divided into tracks and the tracks are on every platter in the same place so it
forms a cylinder.
When a cylinder is filled with data the arms move to another track to start writing data on it.
Custom-written Off-the-shelf
The entire development cost is met by the The development cost is spread between all
client for whom it is written , which makes it the customers who purchased it at a specific
very expensive price which means the cost is much lower
Takes long time to develop Immediately available
The requirements of the client can be met Some tasks that the customer needs to carry
precisely out may not be possible
The developers of the software will make
The software may not be compatible with the
sure that it is compatible with hardware and
hardware and data used by the customer
data used by the client
It is likely that bugs will be found within the
Bugs will have been identified and fixed
software
The client will have access to support from Customers will be able to get support from a
the company wide range of sources
Windows
Icons
Menus
Pointers
The acronym WIMP is commonly used to remember these
elements. Complex GUIs require a lot of memory to operate,
but simpler GUIs can be used where memory is limited. GUIs
are intuitive to use which means they are easy to learn.
However, they can be restrictive for some technical users who
need to carry out unusual tasks.
Dialogue interface
It refers to using the spoken word to communicate with a computer system. A big advantage of
dialogue interfaces is than no hands are required. There is no need for a physical interface with
dialogue interfaces. However, the main problem with it is the computer system’s ability to
recognize the spoken word because of the background sound, different voices and different
accents. Systems are not intelligent enough to simply understand requests in any format that
the user chooses.
Gesture-based interface
It will recognize human motion. This could include tracking eyes and lips, identifying hand
signals or monitoring whole body movement. Gestures can be an essential form of interaction
for some disabled users and an easy form of interface to learn and use. However, one of the
biggest problems with gesture is accuracy. This is why many virtual reality applications still use
sensors attached to various parts of the body in order to improve accuracy. It can also be very
difficult to control a pointer when a finger is in mid-air rather than when firmly fixed to a touch
screen.
Reliability: Mainframes are the most reliable computers because their processors are
able to check themselves for errors and are able to recover without any undue effects
on the mainframe’s operation. The system’s software is also very reliable, as it is
thoroughly tested and updates are made quickly to overcome any errors.
Availability: This refers to the fact that a mainframe is available at all times and for
extended periods. Mean time between failures (MTBF) is a common measure of
systems. It is the average period of time that exists between failures (or downtimes) of a
system during its normal operation. Mainframes give months or even years of system
availability between system downtimes. In addition to that, even if the mainframe
becomes unavailable due to failure, the length of time it is unavailable is very short. It is
possible for a mainframe to recover quickly, even if one of its components fails, by
automatically replacing failed components with spares. Spare CPUs are often included
in mainframes so that when errors are found with one, the mainframe is programmed to
switch to the other automatically. The operator is then alerted and the faulty CPU is
replaced, but all the time the system continues to work.
Serviceability: This is the ability of a mainframe to discover why a failure occurred and
means that hardware and software components can be replaced without having too
great an effect on the mainframe’s operations.
Longevity
Mainframe: have great longevity, or lifespans. This is because they can run continuously
for very long periods of time and provide businesses with security in the shape of
extensive encryption in all aspects of their operation.
Security
Both have great security measures and also mainframes have many layers of security for the
data stored in it.
User id’s and authentication and multi factor authentications like passwords, physical
tokens and biometrics
levels of access, which means that it depends on a user’s level of security as to which
sets of data they can access
Performance metrics
The performance metrics of a computer are basically the measures used to determine how
well, or how fast, the processor deals with data.
Millions of Instructions Per Second (MIPS) : Unit of measuring how mainframes perform.
It is not always the best measure, because not all instructions are the same. Mainframes
use a very large number of different instructions, with some being straightforward and
easy to carry out, while others can be more complex and slower to process. An
application using five million simple instructions will take a lot less time than one using
five million complex ones. In addition, the number of available instructions is increasing
as time goes by and mainframes improve. It is important that the comparison between
the performance of one mainframe and another is made by measuring how fast the
CPUs are when carrying out the same task. This is referred to as a benchmark test.
Mainframes have specialized hardware, called peripheral processors, that deal specifically
with all input and output operations, leaving the CPU to concentrate on the processing of data.
This enables mainframes to deal with very large amounts of data being input and subsequently
very large volumes of output being produced. This large number of simultaneous transactions
and extremely large volumes of input and output in a given period of time is referred to as
throughput.
Supercomputer is designed for maximum processing power and speed, whereas throughput is
a distinct mainframe characteristic.
Fault tolerance
A computer with fault tolerance means that it can continue to operate even if one or more of its
components has failed.
Operating system
Mainframe computers: usually runs more than one operating system at any given time.
Parallel processing is also utilized by dividing any task to subtasks and each subtask is
processed on a separate processor core and then recombined again to provide the
output.
Supercomputers tend to have just one OS, but most supercomputers utilize massively
parallel processing in that they have many processor cores, each one with its own OS
Type of processor
Heat maintenance
Industry statistics: Industry statistics are statistics that are recorded regarding trends in
different industries, such as those that process raw materials, make goods in factories, or
provide services. They can include the number and names of businesses, the number of
employees and wages paid. Some businesses in certain sectors of industry need
mainframes to process the vast amount of data which helps to identify their major
competitors. It shows their competitors’ share of the market and the trends in their sales.
This helps to identify those products which could compete profitably with other
businesses. Where companies do not feel the need to process their own data, they can
obtain reports from organisations that collect the data for them and those companies
could use mainframes for this purpose.
Consumer statistics: allow businesses to assess the demand for their product that is
how many people need or want that type of product. They can inform them about the
range of household incomes and employment status of those consumers who might be
interested in the product so that a price can be set. This data will also inform businesses
of where the consumers live for local sales or how inclined they are to use the internet
for shopping. It may also allow businesses to know how many similar products are
already available to consumers and what price they pay for them.
Quantum mechanics: is the study of the behavior of matter and light on the atomic and
subatomic scale. A very large number of calculations is conducted to study their
behavior.
Weather forecasting: based on the use of very complex computer models. Data from
the sensors at weather stations around the world is input to the model and then many
calculations are performed. Records of previous weather conditions have also been
collected over a very long period. Using the past weather readings, the computer
examines similar patterns of weather to those being experienced at the moment and is
able to predict the resulting weather. Variables such as atmospheric pressure, humidity,
rainfall, temperature, wind speed and wind direction are recorded using computerised
weather stations around the world
Sensors
Sensors collect and send back data to the computer continuously. Usually, the data is sent in
analogue form which will need an Analogue-to-Digital converter (ADC) to be processed by
the computer. The table below describes the most commonly occurring sensors and their
usage:
Type of Sensor Description and use
Light/ultraviolet ❖ Light sensors convert light to electrical energy and based on the amount of
energy produced it gives a value for light.
❖ Used in weather stations to measure amount of sunlight
❖ UV sensors measure the amount of UV radiations which sometimes may
be harmful to humans and may cause cancer.
Temperature ❖ Electrical signals are generated which are converted into values to
represent temperature.
❖ Used to measure the ambient temperature in a weather station, the
temperature in a river or air quality
Pressure ❖ Converts the force applied to its surface to generate electrical energy
which is then converted into values to represent the applied pressure
❖ These sensors are used to measure atmospheric pressure in weather
stations
Humidity/moisture ❖ Humidity sensors are often a combination of a moisture sensor and a
temperature sensor in one unit, because humidity is measured based on
how much water in the atmosphere together with the temperature.
❖ Used to measure the air humidity in a weather station.
❖ Moisture sensor is a combination of a light sensor and a light emitter, as
the amount of light transmitted depends on the moisture content of the air.
❖ Used when monitoring soil quality.
Sound ❖ Converts sound waves into voltages or electrical signals which are
converted by the computer into values to represent sound
❖ Used in environmental monitoring systems to measure noise pollution.
Infrared ❖ All bodies possess thermal energy and therefore emit infrared radiation.
This radiation is converted into electrical signals as a result.
❖ Used in environmental monitoring, for example the Earth’s surface
temperature can be monitored by satellites.
Oxygen, carbon ❖ These are sensors used in environmental monitoring and water pollution
dioxide, pH, turbidity monitoring.
❖ Oxygen (O2) sensors measure the level of oxygen in soil and water.
❖ Carbon dioxide (CO2) sensors measure the level of carbon dioxide in the air
or in water and are basically an adaptation of an infrared sensor.
❖ pH sensors measure the acidity of soil and acidity in rivers, lakes, etc.
❖ They generate electricity depending on the number of hydrogen ions in the
solution, which causes an electrode to generate a voltage.
❖ Turbidity sensors measure the cloudiness of water in a river that is
affected by pollution.
❖ Turbidity sensor is actually a light sensor usually placed at right angles to a
light emitter. The greater the number of particles in the water, the greater
the amount of light reflected off them on to the sensor.
Reed switch ❖ Strictly speaking, a reed switch is not a sensor, but it is used to help
measure rainfall
Electromagnetic field ❖ Measures the change in the Earth’s natural magnetic field caused by the
presence of a ferromagnetic object.
❖ For example, when a vehicle is above the sensor, the metal in the body of
the vehicle distorts the Earth’s magnetic field and so its presence is
detected.
❖ Installation and maintenance are easier and cheaper than an induction
loop
❖ Used in some automated car parking systems to help drivers park their car
Ultrasonic ❖ Made up of a device that sends out sound waves with a frequency
greater than human audible range and a sensor that receives the reflected
ones.
❖ It measures the amount of time taken for the sound to be sent and
received to calculate the distance from an object.
❖ It is used in automated car parking systems which let the driver know
when they are close to another vehicle or other object so they can park
their car without hitting that obstacle
Proximity ❖ A proximity sensor can be a mixture of sensors
❖ Usually made of a device that sends out a signal and a sensor which
receives the reflected signal back.
❖ This can be an infrared beam, ultrasound or a magnetic field.
❖ Used in smartphones to switch off the screen display when the phone is
held near to the ear.
Touch ❖ Measures the capacitance between two conductors separated by an
insulating plate. One of the conductors will be the fluid whose level is
being measured. When the fluid is touching the sensor, it detects that it is
at that level.
❖ Used to measure fluid levels such as the cooling water level in nuclear
power plants to ensure that there is sufficient water to cool the reactors
➢ Note: All the above sensors can be used in both monitoring systems and in control
systems; except the last 4 sensors, they are more likely to be found in control
systems than monitoring systems
Results can be output in the form of graphs, either to a monitor or printed out. This all happens
automatically without the need for human intervention.
3. Environmental monitoring
Environmental monitoring is the collection of data relating to our environment. It includes:
➢ Monitoring sound in cities
➢ Monitoring pollution produced by motor vehicles
➢ Monitoring soil quality in outdoor gardens/ greenhouses/glasshouses, using pH,
moisture and temperature sensors, among others
➢ Detecting abnormally high temperatures using temperature sensors
➢ Monitoring the level of air pollution using O2, CO2 and pH sensors
➢ Monitoring ultraviolet levels; excessive amounts can cause skin cancer
Calibration
Calibration is making sure that when, for example, a temperature sensor is used to measure the
temperature of boiling water, it actually causes the computer to output a value of 100 ºC. It is
done by comparing the value a sensor produces to a known measurement.
Methods used to calibrate devices:
1. One-point calibration
To carry out a one-point calibration:
➢ A reading is taken from the sensor in the range being measured
➢ It is compared with either a pre-calibrated sensor or a known value.
➢ The sensor reading is subtracted from the known value which gives the ‘offset’.
➢ This offset is then added to every reading in the temperature range being measured.
This type of calibration is often needed for sensors which are constantly used at very high
temperatures and after some time lose accuracy.
2. Two-point calibration
Assume we need to calibrate a pH sensor:
➢ Use a pre-calibrated sensor against the one
under testing for a range of pH values
➢ An offset here cannot work since we have a +1
difference in some readings and a -5 in others
➢ Find the linear relationship between the two
lines, which in this case is multiply by 2 and
subtract 3
➢ Try to use a wide range that would cover all the
expected results, in our case, place the sensors in
pH 4 (acidic), 7 (neutral), 10 (alkaline)
3. Multipoint calibration
➢ Same approach as two-point calibration
➢ This time the relationship is not linear
➢ You will need to use curve fitting in order to
find the relation between them
➢ Make sure to use at least 3 readings and to be
widely spread to cover your range (in our case
we could’ve used 0, 50, 100 ºC)
2. Central-heating systems
Steps in natural language (not pseudocode):
Flowchart:
➢ NOTE: In this flowchart, it is assumed that pre-set values are already inputted, and it also
does not consider whether the valve/pump are already on/off, this could be solved
using nested if
3. Air-conditioning systems
Steps in natural language (not pseudocode):
4. Burglar alarms
The sensors needed in such a system are:
➢ Infrared sensors: to detect movement of human bodies, which emit heat
➢ Sound sensors: to detect the level of sound an intruder might make
➢ Pressure sensors: that are placed under a carpet or rug to detect an increase in weight
caused by a burglar treading on it.
In the event of detecting an intruder, the burglar alarm sounds an alarm and causes lights to
flash and probably also sends a signal to the police.
➢ In many countries like the UK and Australia, they use a active traffic management to
create a smart freeway/motorway
➢ Based on the state of the road, speed limits vary, and the ability to drive in the hard
shoulder as well (the side of the road where the cars could stop if they broke)
➢ The state of the road can be detected using two techniques:
o Induction Loops: Several of these are placed beneath the road (500m apart),
they will be explained in the next section.
o Side-fire radar: Firing of a radar beam at an angle to the roadside, to measure
the speed of the vehicles.
o This has advantages over the induction loop system because it is not
susceptible to damage caused by potholes or erosion in the road.
6. Car-park barriers
➢ Uses induction loop buried under the surface; when a vehicle passes over the loop, the
metal causes a change in the magnetic field and leads to the car being detected
➢ This will send a message to the actuator (motor in this case) to move the barrier
upwards
➢ Such system also uses a light beam source and a light sensor
➢ If the beam did not reach the sensor, it means that the car has not passed yet hence the
barrier should stay up, when the beam reaches the sensor again it means the car has
passed and the barrier will go down
➢ This makes sure the barrier stays up until the vehicle has passed through the beam.
7. Traffic lights
There are two types of traffic lights:
➢ Fixed time: does not involve a computer, usually
annoys the drivers if they must stop and no other
cars are crossing the road
➢ Computer-based:
o Uses induction loops to detect traffic
o Based on the results they dynamically adjust
the traffic lights timing
o For example: The computer will decide to
keep the light on red for the road which has no traffic. When a sufficient number
of vehicles have stopped at the red light, the computer will cause the red light to
turn green and the other one red.
Smart homes
A smart home is a home in which devices and appliances are connected so that they can
communicate with each other and can be controlled using commands by anyone living in
that home.
The most common devices controlled in this way are:
➢ Televisions
➢ Music centers
➢ Lights
➢ Burglar alarms
➢ Central heating and air-conditioning units
The ability to control such devices remotely is called the Internet of Things (IoT).
Its advantages:
➢ Making sure that the front door is locked remotely
➢ Making sure the burglar alarm is switched on remotely
➢ Turning on the AC before arriving home to cool the room
➢ Switching on the oven remotely to arrive to a ready-cooked meal
The main disadvantage here would be the being vulnerable to hackers
Advantages and disadvantages of using control technology
Advantages of control technology Disadvantages of control technology
Controlled burglar alarms gave people a great Increasing automation decreases job opportunities
sense of security which increased the rate of unemployment
Smart homes reduce the amount of energy used. Smart homes led people to become lazier
Computerized traffic lights led to fewer traffic jams It may cost a lot of money to buy a control system
Control systems and smart homes helped people Control systems will not work in case of a computer
with disabilities use their devices at home failure or power outage
They systems tend to process data much faster
than humans
Using such systems leave people free time to do
other things
4.1 Introduction
To solve any problem using a computer program, you must go through the following steps:
1. Analysis
2. Design
3. Implementation
4. Testing
In this course we are interested in the first 2 steps which are analyzing the given problem and
designing an algorithm to solve it using both pseudocode and flowcharts. After that; the
implementation will be transforming your algorithm design into code using any programming
language and testing it; this is beyond the scope of our course.
4.2 Analysis
Problem 1
Write an algorithm that reads two numbers from the user and print out their sum. In other
words, write an algorithm to solve the following equation:
Z=A+B
In the analysis phase we try to figure out what are the inputs of the program, the processing
that should happen and the outputs it shall produce.
• Inputs: A and B
• Processing: Z = A + B
• Output: Z
4.2.1 Operators
4.3 Design
After you finish your analysis, it is now time to design your algorithm. In this course we will learn
two common ways of designing an algorithm which are:
▪ Pseudocode
▪ Flowcharts
4.3.1 Pseudocode
It's simply an implementation of an algorithm in the form of annotations and informative text
written in plain English.
Pseudocode Keywords
Examples:
1. Write a statement that will output the words Hello World! on the user's screen
Hello World!
Welcome to AS ICT
While thinking for variable names to write in your pseudocode, you must follow the following
rules:
If we would like to write a pseudocode to solve Problem 1, it would look like this:
INPUT A, B // inputs the two numbers from the user. It could be split into two separate input lines
each inputting only one variable
4.3.2 Flowcharts
If we would like to draw a flowchart to solve Problem 1, it would look like this:
This is sometimes referred to as selection. Conditional branching means that certain statements
are carried out depending on the value stored within a particular variable name. There are
generally considered to be two types, which are IF…THEN…ELSE and CASE…ENDCASE.
Sometimes, IF statements do not have an ELSE part, such as in this sequence of instructions:
Design an algorithm, using pseudo-code and flowchart, which takes a number as input and outputs
whether the number is zero or non-zero.
Pseudocode Solution:
INPUT num
IF num=0
THEN
ELSE
ENDIF
Flowchart Solution:
Often, we need to check that the user has not entered unacceptable data, take the example of
dividing two numbers, you cannot divide by zero. So, we have to anticipate mistakes users might do,
this is called Validation.
Example 2:
Design an algorithm, using pseudo-code and flowchart, which reads two numbers from the user and
divide them by each other, then print out the answer.
Pseudocode Solution:
IF Num2=0
THEN
ELSE
ENDIF
Flowchart Solution:
Sometimes you might have to check for more than one condition before taking an action, here
we use the keywords AND, OR
Example 3:
Design an algorithm, using pseudo-code and flowchart, which takes a number and prints “In range” if
the number is between 1 and 10 inclusive, otherwise the program outputs “Outside range”.
Pseudocode Solution:
INPUT Num
THEN
ELSE
ENDIF
Flowchart Solution:
Example 4:
Design a program, using pseudocode and flowchart, which takes marks in an exam as input and
outputs the grade according to the following grade boundaries:
Pseudocode Solution:
Design an algorithm, using pseudo-code and flowchart, which takes a course number as input and
outputs the corresponding course name according to this table:
Pseudocode Solution:
INPUT CourseNo
CASE CourseNo OF
2: PRINT “ICT”
3: PRINT “Math”
4: PRINT “Biology”
ENDCASE
Write pseudocode that takes two numbers as input and performs any of the basic operation (+, -, *, /)
as per the user’s input.
Pseudocode Solution:
INPUT Oper
CASE Oper OF
“/”: IF Num2 = 0
THEN
ELSE
ENDIF
ENDCASE
4.5 Loops
A loop is a sequence of repeated statements that are carried out several times. Its purpose is to
avoid repetition and redundancy in the code and accordingly produces shorter and more
precise algorithms.
A loop that iterates whilst a specified condition exists. Criteria is pre-tested (It has criteria
check at the start). It may never run
Example 1:
Design an algorithm, using pseudo-code and flowchart, that will read the side length of a square
and displays its area.
Pseudocode Solution:
INPUT side
INPUT side
ENDWHILE
Counting
If a loop is to be repeated a certain number of times, it is usual to set up a counter. This usually
involves the initializing of a variable (setting it to 0). The variable name used is often just ‘count’.
It is quite common for the first statement in any algorithm to be:
This count is then incremented (increased by 1) every time a sequence of statements is carried
out.
Design an algorithm, using pseudo-code and flowchart, which takes a mark from the user and
validates that mark. Quiz is out of 100. Count and display how many times the user entered invalid
data
Pseudocode Solution:
countInvalid 0
INPUT mark
countInvalid countInvalid + 1
INPUT mark
ENDWHILE
PRINT “Number of Invalid Entries: “, countInvalid
Flowchart Solution:
A loop that iterates until a condition is met. Criteria is post-tested (It has criteria check at the
end). It iterates at least once
Example 3:
Design an algorithm, using pseudo-code and flowchart, which takes from the user a radius and the
program outputs the circumference
Circumference = 2 * π * Radius
Pseudocode Solution:
REPEAT
INPUT radius
IF radius < 0
THEN
PRINT “Invalid radius, try again”
ENDIF
UNTIL radius > 0
Circ 2 * 3.14 * radius
PRINT “Circumference = “, Circ
Example 4:
Design an algorithm, using pseudo-code and flowchart, that prints out the multiplication tables from
1 to 12, each table should go up to the multiplication by 6. The output should look like this:
count1 1
count2 1
count2 count2 + 1 // increment counter2 to have different multiples of the same table
ENDWHILE
count2 1 // reset counter2 to start the new table multiplying by 1 and to renter the second loop
ENDWHILE
count1 1
count2 1
REPEAT
REPEAT
count2 count2 + 1 // increment counter2 to have different multiples of the same table
count2 1 // reset counter2 to start the new table multiplying by 1 and to renter the second loop
Note: Don’t forget the ENDWHILE for each WHILE statement while writing your nested loop,
and make sure they are correctly indented
4.6 Procedures/Subroutines
When writing algorithms, it is often good practice to use subroutines, which are sometimes
called procedures. A subroutine is a sequence of algorithm statements that perform a specific
task. This subroutine can then be called in other algorithms when needed.
Example:
Design an algorithm, using pseudo-code and flowchart, which calculates and prints the average of 3
numbers inputted by the user; use a subroutine called avg
Pseudocode Solution:
PRINT average
ENDPROCEDURE
Notes:
➢ Don’t forget to write the “CALL” keyword before calling your function
➢ Variable names used in the procedure declaration should not always be the
same as the ones used when calling the procedure
➢ A procedure can be called anywhere in your algorithm (inside an if statement, a
loop, … etc.)
➢ You could call a procedure by sending values not variables; in our example we
could call the procedure like this: CALL avg(45, 78, 56)
A master file would be used together with a transaction file in most batch processing
applications, including a computerized customer orders system. Before these two files can be
processed together to produce a payroll, the transaction file needs to be sorted in the same
order as the master file and will also need to be checked for errors using validation checks.
The three types of transaction involved in updating a master file in this scenario
Transaction File
Note: This is not the exact way of how to write file handling algorithms using pseudocode, they
are outside the scope of this course. What you need to understand is the idea of how file
handling works.
• Pseudonymised Data: Is when, instead of removing the personal items of data, they are
replaced with a temporary ID. The problem is that if, similar to de-identification,
somebody can recognise that individual from the rest of the record, they can replace the
ID with the individual’s name.
• Identity Theft: is when a fraudster pretends to be another individual online by using that
individual’s personal information.
o The Fraudster can access the individual’s bank account to withdraw/transfer
money to their own accounts
o They could also commit other types of fraud/crime under the individual’s name
• If burglars obtain personal data such as addresses and information about when a person
is at work, then they can burgle that person’s house. Therefore, people should not post
information about their holiday or vacation plans on social media.
• Penetration testing: It’s when companies employ somebody to deliberately attack their
computer network. They do this so that the authorised ‘hacker’ will identify the
weaknesses in their system’s security and the company can then take measures to
improve it if necessary.
In some cases, more than one authentication method is required to increase the data’s
security; in an ATM you require both a password and a card, and in online banking it
sometimes requires a password and other security questions. This is called twin-or two-
factor authentication
• Levels of access: Different groups of users can be granted different levels of access to
the data on the network. Allocating different access levels to different groups limits the
information that the different groups can see and the actions they are allowed to take.
• Network policies: are sets of rules that allow companies to choose who is allowed to
access their computer network and control their use of the network once they have
gained access. While this does not necessarily prevent hackers from outside the
• Other Methods:
o Encryption
o Digital Certificates
o Remote Deletion: being able to delete the data remotely in case the device had
been physically stolen.
Phishing
Is when fraudsters try to obtain personal details such as usernames, passwords, and credit or
debit card details using email. The email often includes a link to a URL of a fake website inviting
the receiver to enter their personal data there. Such emails usually contain something that
instantly grabs the recipient’s attention and requires them to take immediate action. For
example, telling them they have won the lottery but need to send personal information in order
to claim the prize.
Ways to avoid Phishing:
• Use anti-phishing software; it identifies any content which could be interpreted as
phishing contained in websites or emails.
• Always have anti-virus and anti-spyware software running on a computer, and to
update it at regular intervals.
• Look for grammatical and/or spelling mistakes in such emails
• Users should never trust emails that come from people whose names they do not
recognise.
Smishing
Is a variation of phishing. The major difference is that it uses SMS (text messages) rather than
email to send the message. The number of smishing attempts have increased since the
introduction of smartphones, as it is so easy to activate a link within a text message. Just as with
phishing, the main intention is to get the recipient to reveal their personal details.
Ways to avoid Smishing:
• Run mobile protection software on the smartphones
• Lookout for signs same as phishing; grammar or spelling mistakes, requiring immediate
action, offering a huge prize…etc.
• Check sender’s phone number against the company’s actual phone number
• Never type in banking or personal information unless using an organization’s official
website
• Do not click any links sent in such messages and do not phone call the number as well
Vishing
The word ‘vishing’ is a combination of the words ‘voice’ and ‘phishing’. As its name implies, it is
the practice of making a phone call in order to get someone to reveal their personal or banking
details. The fraudster may be calling claiming that he is from your bank and needs your details
for a check-up or that you won a certain prize and certain data is required to be able to receive
it.
Ways to avoid Vishing:
• Call the bank and ask if they sent out someone to collect such information
• Never give personal/bank information through the phone
• Remember that banks will never ask for pins/passwords
• Hang-up and block such callers
• Use a software that blocks such callers and keeps a file of all the blocked contacts for
all phone owners using the app; for example: TrueCaller
5.2 Malware
5.2.1 Types of malware
• Virus
o Attaches itself to another computer program
o Can replicate themselves, just like the real-life viruses
o Some types of viruses delete, corrupt or change the data on disk
o The computer affected with a virus may frequently crash and will have a slower
processing speed
• Worm
o Are similar to viruses in that they replicate themselves
o Their main purpose is to occupy more and more disk space until the disk is full
and can no longer function.
o Standalone programs: they do not attach themselves to other programs or files
o They result in slowing down the traffic in a network
• Spyware
o Designed to collect information about a computer user’s activities without their
knowledge.
o A keylogger is often used, a type of spyware which works by collecting a record
of the user’s keystrokes
o Data such as web browsing habits, email messages, usernames and passwords,
and credit card information are passed to the hacker without the user having any
idea what is happening.
• Adware
o Its main purpose is to generate income for the originator or creator of the
software.
o It automatically generates unrequested advertisements
o It is regarded to be more annoying than dangerous
o There has been a tendency in recent times for the adware to be linked to
spyware.
• Rootkit
o Is designed to install a set of tools in a computer which allows the attacker to
have full administrative access to that computer continuously.
o These tools enable the attacker to discover the user’s personal details, such as
passwords.
o It is also capable of removing/manipulating the anti-virus software.
• Malicious Bots
o Like a worm, a malicious bot can replicate itself
o It is designed to gather information and feed back to a server; this is called a
botnet
o They are extremely difficult to detect on a computer
• Ransomware
o Blocks access to the user’s data until a ransom is paid.
o It encrypts the user’s files, and a payment is needed to provide the decryption
key
• Fileless
o Does not rely on files and leaves no evidence once it has been executed.
o It only resides in the main memory (RAM).
• Fraud: to take or alter electronic data, or to gain unlawful use of a computer or system to
illegally benefit financially.
• Industrial Espionage: spying directed towards discovering the secrets of a rival
manufacturer or other industrial company
• Sabotage: when businesses, education establishments and other organisations are
attacked in order to disrupt their normal operations.
o People within the same country are wealthier than others so wealthier people
have greater access to IT technologies.
o Some locations are very difficult to provide internet connections to them like
people living in the mountains or deserts.
o Rural areas tend to have poor infrastructure because internet provides always
seek higher density regions to serve.
Fear of IT
Economics
o Technology keeps updating by time and every update is more expensive than its
predecessor. People who are better paid can have the new technology easily and
on the other hand poorer people will get basic level of technology which are less
likely to increase their IT skill and widening the divide.
Disability
o Technology are usually made without or with a little consideration for disabled
people leading to a large number of people cannot use technology normally.
o Low populations of rural areas leads to fewer distant houses that needs
infrastructure installation, unlike urban areas all the houses are close to each
other, so longer cables have to be used, which means slower speeds.
o Alternatives for rural areas like satellite connections, radio communications and
mobile networks can be used to access internet connections but weather and
radio towers availability can affect their qualities and speeds.
o Online shopping gets few to no opportunities for suppliers and customers in less
industrially developed countries as some of the countries does not have names
for their streets making it difficult to deliver parcels. Also, a big part of the
population does not have bank accounts to use online payments. Moreover,
some countries does not implicate consumer-protection laws over online
purchased goods.
o Uneducated people tend to work in a low-paying job making it less likely for
them to afford high tech.
o Schools that have better technologies in IT equipment and internet speeds and
use of IT in the curriculum leads to differences between schools.
o Older generations were not exposed to the technology like young people so fear
is developed.
o Older people are slower at accepting new technologies and tend to use older
technologies.
o Technology companies tend to sell high end technologies with high prices to
maximize their profits, this will serve rich people only leaving poor people with
old and basic technologies and they will not get a chance to get better IT skills.
o As household income increase the better the broadband connection it is and the
technologies used in home unlike poorer homes which will prefer to pay for their
everyday essentials first.
o Hearing and visual impairments lack the access to personal devices and internet.
Health
o There are now websites that have medicine and treatment information, booking a
doctor appointment and hospitals can have their records online for the patients to
see but some people cannot afford to buy equipment like PCs or Laptops or
broadband connection to benefit from these or hospitals cannot afford to install
this tech or even doctors living in rural areas with no broadband connection won’t
be able to access the patients online records.
Education
Job opportunities
o Jobs nowadays require IT skills as a necessity so people without such skills won’t
find a job.
o Companies now can offer jobs and recruit employees online and people without
internet connection won’t hear anything about it.
Social interaction
o Online booking systems for holidays or even trips by any mean of transportation
became normalized so if someone can’t access technology for any reason will
end up paying a lot more than booking in advance or even not finding the options
needed.
o Online banking is usually used through smart phones, people who cannot afford
to buy smart phones will be disadvantaged as many banks are relying only on
online banking in some regions.
o Online shopping made it difficult for physical stores to make profit as more
people are buying online and online shopping is more convenient as people can
shop at any time and any place and the prices tend to be cheaper.
o Government websites can ease the governmental processes for its population,
people with no access to internet may need to travel big distances or waste a lot
of time finishing these processes physically.
PLC cables ( Power Line Communication ) which enables internet to travel through
electricity cables.
Investment analysis
Acts as assistants to financial advisors at many banks. The advisor has the final say, but they
often use such systems to help them in their decision.
• Knowledge base: Information the bank gathered about the performance /stability of
different companies.
• Input:
o The amount the investors wish to invest
o What level of risk they are willing to take
o The desired rate of return
o How long they are willing to make the investment for.
• Output: Recommendations for purchasing stocks or shares in a company
Financial planning
Personal financial planning has become so complex that it is extremely difficult for one human
expert to deal with it. Computerized expert systems come to assist in the process.
• Knowledge base:
o Results of books and articles relating to personal financial planning
o Information from interviews with experts, such as professional financial advisors
• Input: User fills a questionnaire about their personal and economic situation including:
o Income
o Taxes paid or due
o Investments
o Employee benefits
o Marital status / number of dependents
o Future obligations such as retirement plans or funding their children’s university
education
• Output: The systems may recommend one or more of the following:
o How to manage debts
o How to reduce the amount of income tax they pay
o Ways to organize investments
o Recommend the amount of insurance individuals should have
o How they should plan for their retirement
o Suggest short-term personal saving targets
Medical diagnosis
Helps medical practitioners diagnose illness
• Knowledge base: Interviews with expert doctors
• Input: Symptoms
• Output: A list of possible diagnoses of illness/diseases
Insurance planning
Expert systems are frequently used to assess the risk of insurances
• Knowledge base: Insurance experts would be interviewed and all the policies that the
underwriter currently offers would be examined. The results would then be used to
create the knowledge base
• Input: Depending on the type of insurance, if life insurance for example it would input
data about the client such as age, medical health status, gender, …etc.
• Output: a recommendation for the cost of the individual’s premium. It may, of course,
recommend that the application be rejected.
7.3 Chaining
7.3.1 Backward chaining
Backward chaining is often referred to as goal-driven. This is because it starts with a goal or set
of goals that basically establish which rules are to be followed. When an inference engine uses
backward chaining, it explores the rules the system has been given until it finds one which has a
THEN part that matches a required goal. If the IF part of that rule is known to be true, then it is
added to the list of goals.
➢ Step 1: ‘Edwina’ replaces X in Rule 3 to see if its conclusion matches the goal, so Rule 3
becomes: IF Edwina is a zebra, THEN Edwina has a striped coat.
➢ We now need to see if the premise – Edwina is a zebra – can be proved.
➢ Step 2: Again, replacing X with ‘Edwina’, in Rule 1, the rule becomes: IF Edwina has
hooves and can run fast, THEN Edwina is a zebra.
➢ The inference engine now needs to see if the premise – Edwina has hooves and
can run fast – can be proved; these two facts were already given at the start of the
problem
➢ It follows that the premise of Rule 3 is true, and the conclusion must be true: Edwina has
a striped coat.
➢ Step 1: Since the facts we are given show that Edwina has hooves and Edwina can run
fast, the premise of Rule 1 is matched by replacing X with ‘Edwina’ (IF Edwina has hooves
and can run fast). The inference engine concludes: Edwina is a zebra.
➢ Step 2: We can now use Rule 3 by replacing X with ‘Edwina’ (IF Edwina is a zebra). The
inference engine concludes: Edwina has a striped coat.
➢ NOTE: The difference in approaches is that backward chaining starts with us having a
goal to achieve or an assertion we are trying to prove. We think Edwina has a striped
coat, but we need to prove it. With forward chaining we do not know what type of coat
Edwina has but we want to find out.
➢ Gaming
o A good example of backward chaining in computer games is found in the game
of chess. In chess, there are a fixed number of moves to reach a winning position.
To compute all the possible ways of reaching a winning position, the system
chains backwards and builds up a list of possible ways to get to the winning
position.
o Selecting a weapon for non-player characters (NPCs) in a game is an example of
forward chaining. Data is inputted about the distance to the target, their strength,
and the range of the weapon for example. Then outputs which weapon should be
used.
➢ Artificial Intelligence (AI)
o An AI might use forward chaining to look at the available information, answer a
question or solve a problem
o Self-driving cars is a good example of backward chaining, its goal is to get from
A to B without crashing.