0% found this document useful (0 votes)
29 views59 pages

Cs Term 2-3 Notes

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views59 pages

Cs Term 2-3 Notes

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 59

Cs notes term 3 version 2.

CHAPTER 1 :

Binary:
a type of data representation number system that consists of 1s and 0s for ons and off .
Computers consist of millions of on and off switches so binary represent that.

Binary number system :


a base 2 number system .
It only has 2 values this can be represented with powers . 2 to the power of 1 , power 2 , 3
,4 , etc . This is 1 2 4 8 16 .

1=on 0=off

Denary:
a base 10 number system that has numbers 0-9 that has many combinations .
They are normal numbers

Hexadecimal system :
a base 16 number system that is close to denary and had 16 digits .
0-9 and A-F . In total 16 it is much more easier to represent larger numbers in hex .
⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
⸻— Conversions:

Binary to denary :
You use a table with numbers 1 2 4 8 16 , etc and add all the numbers that have 1 below
them .

Denary to binary :
Take your number and find which numbers from 1 2 4 8 16 , etc add up to it .
Put a 1 under those numbers and a 0 under number you are not using.
Or you can divide your number till 0 and your remainders will be the binary write in
reverse order from bottom to top
Binary to hexadecimal:
Split your binary number into groups of 4 digits .
If it is not 4 or a multiple of 4 , add 0s to it .
Convert those 4 binary into denary .
Then convert those denary into hex by the 0-9 and A-F

Hex into binary :


Take your hex number .
Convert each digit into denary .
Then convert those denary into 4 digit binary .
Then add all the binary

Hex to denary :
Take your digits and separately multiply them by the powers of 16
ACwill be = 12 x 16 to power of 0 + 10 x 16 to the power of 1
Add all the denary numbers after multiplying.

Denary to hex :
You can either convert denary to binary and then to hex or divide by 16 till you get 0 and
your remainders will be your hex .
Write in opposite order .

⸻⸻⸻⸻⸻⸻⸻

Use of hex :
error codes ,
MAC addresses ,
IPv6 addresses ,
HTML colour codes
Error codes : codes that show the location of the error in a code and is shown in hex .
Used in windows

MAC address :
media access control is a hex number that uniquely identifies a device on a network .
A device can be identified through it .
Made up of 48 bits and has 6 groups of 2 hexadecimal digits .
First half is the identity of the manufacturer and
second half is the serial number of device

IP address : internet protocol address is a address given to a device using hex or denary .
IPv4 is 32 bit but IPv6 is now 128 bit Ipv4 uses a decimal point
Ipv6 uses colon
Lowercase letters are used

HTML colour codes :


hyper text markup language is used to develop webpages .
Used to process and present text like colour of the text .
Uses tags to define text .
HTML uses hex to show a colour that contains a mixture of three colours red green and
blue .
Mixing them with different amounts creates other colours .
Split into 3 sets of 2 hex digits that show r g and b .
256 values for red , green and blue and has many combinations .

⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
⸻—
Addition of binary numbers :
Carry forward ones when adding like 1+1 will be 0 carry forward 1 to the next digit or
you can convert numbers to denary , add denary and convert back to binary

Binary overflow:
Sometimes when you add binary numbers they carry on and exceed the number of bits
being added and the sum is too big .
This results in a binary overflow error. When the amount of bits exceeds the bit capacity .

Logical binary shifts :


Computers can do a logical shift on a sequence of binary . It means moving the binary
number left or right . There is a limit to a number of shifts . As bits are shifted , it is
replaced by a 0
If you shift more , it will half or double but too much and it will not half properly

Left=multiply by 2 Right=divide by 2

Twos complement form :


To have negative integers in a binary , we use twos complement .
It uses 8 bit headings to make a minor change that can represent numbers. To show
negative .
The leftmost bit is changed into a negative. This means you can have a new range of
numbers from -128 to 127 in 8 bit.
You can also invert the positive numbers 1s and 0s in 2s complement form and add 1 to it
to get negative.
1101 becomes 0010 + 1 which is 0011

HOW TO SHOW POSITIVE NUMBERS IN 2 COMPLIMENT FORM:


Just dont use the negative -128 to show a positive number . Convert it to binary normally
without making it negative

⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
⸻—
TEXT SOUND AND IMAGES:

ascii :
american standard code for information interchange .
Used in computer systems for information interchange
7 bit character set which is 0 to 127 .
It represented letters , numbers and characters found on a standard keyboard .
Also had control characters .

Extended Ascii :
it used an 8 bit codes which is 0-255 characters possible .
It has much more storage than ascii .
more symbols and a few other languages and a few more graphical characters.

Limitations of ascii :
It did not represent characters in non western languages eg chinese/arabic Softwares used
different characters that were not present in ascii .
Was not international and had only 7-8 bits

Unicode : a newer coding system that had was much better than ascii or extended ascii
Had 16 bits and reached all international languages with 65356 characters
Could represent many more graphical symbols for developers and translators for software
.
Known as the most complete set of characters .
Can go up to 32 bit and adapted more .
Helped with assigning codes to their own character like chinese Had emojis and modern
symbols
⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
⸻—

Representation of sound :
Sound-waves : vibrations in the air that humans can hear and interpret as sound .

Factors of sound waves : frequency , wavelength , amplitude

Amplitude:specifies the loudness of the sound

Frequency and wavelength : specify the pitch of the sound

Analogue sound :
sound waves in the air vary continuously and have curves that can only be interpreted by
human ears .
Computers cant work and store this type of sound

Digital sound :
a sound type that is compatible with computers and can be processed . Have points and
straight lines .and have regular time intervals

How analogue is converted into digital :


the sound waves amplitude has to be sampled in regular time intervals for it to become
digital .
The sampler of this sound is known as an analogue to digital converter . ADC .
Sound waves cant be measured precisely so approximate values are stored

Sampling resolution :
This is measured in bits and shows how high or low the sound can go .
The higher the resolution , the higher or lower a sound can go. This means better range
and dynamic quality.
7 bit sound resolution can have up to 128 levels of amplitude compared to 1 which has
only 2 levels
Also known as bit depth

Sampling rate: how frequently the amplitude of a sound is sampled and measured
It is measured in hertz (hz)
One hertz means one sample per second .
The more hz , the more frequently the sound will be recorded and more detail to all the
variations will occur .
It has to be sampled at regular time intervals and the sample of the sound wave is
encoded into binary

Benefits and drawbacks of sampling rate and resolution :

Good=Better quality , higher and lower , less sound distortion , better effects More
similar to original sound , more details of amplitude variation

Bad=larger file size , longer to transmit and download , requires greater processing power
⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
⸻— REPRESENTATION OF BITMAP IMAGES :

Bitmap images :
images made up of pixels and a matrix of pixels .collection of bits , bitmap images have
tiny pixels . It has a matrix of individual dots . They all have their colors . Is a grid of
pixels .
When zooming in , it losses quality and pixels stretch into larger blocks .

Pixels :
known as picture element , each pixel has a binary number .
It has 2 factors. Its mixtures of colors rgb and its position in the bitmap matrix

Colour depth :
each pixel color is assigned a binary code .
If a picture needs more colors , more codes will be needed and more bits .
A black and white image needs one bit since it can only have 1 and 0 .
Others might need 8 bit which is 256 colors.
This increases file size
Modern computers have 24 bits which is 16 million colors

Image resolution : the number of pixels that make up an image . The more pixels means
more detail in the image . It is the length and breadth multiplied to find the amount of
pixel
Image resolution 3 x 3 will have 9 pixels but a resolution of 4096 x 3072 will have 12
million pixels
Drawbacks of pixel resolution : increases file size , processor requirement , download
times , loss of detail when sent to lower capacity computers ,
less storage for other images .

Difference between the image resolution and the screen resolution :


Screen resolution is just how many pixels are displayed on the screen . It DOES NOT
affect the file size . Image resolution is the pixels stored ,not displayed . If you increase of
decrease screen res , the file size will not change

⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
⸻— DATA STORAGE AND COMPRESSION :

Bit : basic unit of all of all computing memory storage

Types of storage size : Bit=1


Nibble=4 bits
Byte=8 bits
Kilobyte=1000 bytes
Megabyte= 1000 kb
Gigabyte=1000 mb
Terabyte=1000 gb
Petabyte=1000 tb
Exabyte=1000 pb
Eb

Nibble: half a byte and 4 bits

Are the types of data inaccurate:


Yes , because it is based on the base 10 system . Where one kilo=1000
Memory is actually measured in powers of 2 and is based on the binary base 2 system

IEC memory size system:


It is more accurate and internal memories could be properly measured

File size of an image :


Image resolution (in pixels) x colour depth (in bits)
If you want an answer in another size type like kb or kib or others , divide to make bits to
bytes.
Then simplify and cancel out the numbers based on HCF
Then do the sum normally

File size of sound file :


Sample rate (in hz) x sample resolution (in bits) x length of sample in seconds
If you want an answer on another type divide to change bit to another type . Simplify and
cancel out
Then do the sum normally
If it is stereo sound multiply by 2
⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
⸻— Data compression and lossy lossless RLE :

Why do we need to compress data :


Some image and sound files are very large so they need to be compressed. To save up
storage on devices
Reduce time taken to stream a music or video file
Increase upload /download speed
Reduce network bandwidth

Lossy file compression :


this file algorithm eliminates unnecessary data from the file . The original file cannot be
reconstructed back to its original detail after it was sent and compressed. Results in loss
of detail . For an image it might reduce
The resolution and for sound the sampling rate and / or the resolution

Common lossy algorithms : MPEG-3 (MP3) and MPEG-4 (MP4) and JPEG

Lossless file compression :


With this type of data compression , all the data from the original file can be
reconstructed . This is important for files where any loss of data would be bad . Like a
huge spreadsheet or a computer application

Common lossless file compression : RLE

RLE (run length encoding) : used for lossless compression


It is a form of reversible compression, it reduces image size by compressing repeated
values like identical colors in an image .
The repeating string has 2 values number of times repeated and the code of data item .
Only effective when there is long run of repeated units

RLE in text and images :


Shows how many times its repeated and the character code for the letter . For aaaaa there
are 5 A’s and the code for a is 97 so we can write 0597

For images we in black and white we can see the pixels row by row and show them as
black and white . Instead of 0000100000 we can write 4A 1B 5A in which a is 0 and b is
1

For images with color you can use values for rgb and mix and match it and also how
many times it is repeated in a row .

Pixel density : number of pixel per square inch measured in ppi


⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
⸻ CHAPTER 2 DATA TRANSMISSION :

Data packets : when data is sent over long distances it is broken into data packets . It is
quite small and is easier to control than a huge stream of data
. Each packet can be sent on a different rout to its destination
.
Benefits of data packets : info can be sent much better through smaller bits and
transmission routes will not be overloaded or very busy .

Drawbacks of packets : you will have to reassemble the data from each packet and this
can result in many errors

Packet structure :
A packet consists of a packet header , the payload and a trailer

Packet header :
the header consists of the IP address of sending and receiving device Sequence number of
packet so all packets can be assembled in order Packet size

Payload : the middle segment that consists of the actual data in 64 KiB

Packet trailer :
includes some way of identifying the packet so they can be separated and reassembled .
An error checking method that can compare original vs sent data to see if there are any
errors .

Router : when data packets are separated and sent through different routes , each stage in
a route needs a router .
A router receives a data packet and decides where to send it based on the info

Packet switching :
a method of data transmission where a message is broken into many packets .
Each packet is sent separately from start to end point . At the end , packets need to be
reassembled in the correct order using info sent by header .

Nodes : they contain a router and they are in the network between computer a and b , they
decide the best route for the packet for its destination .

Steps of packet switching :


Data is split into packets
Packets are checked by routers and sent separately
Routers find the most uncrowded and short route
Nodes in network also check data and send it on shortest path Sometimes packets are
received in a different order that they are sent . Computer b will now have to reassemble
the data based on headers

Benefits of packet switching :


Easy to send without overloading routes
Increases transmission speed
Can easily overcome bad transmission routes by rerouting
No need for only one transmission line that be slow
Drawbacks of packets switching :
Packets can be lost and need to be resent
Prone to errors with real time streaming
There is delay because packets have to be rearranged

Hopping :
when packets get lost in the network , it clogs up the routs and is stops transmission .
Hopping is used to add a hop number to each header of a packet and this number is
reduced each time it leaves a router.
Each packet has a starting hop number and it counts down , when it reaches 0 and the
packet hasn’t reached destination , the packet is deleted
Then the missing packets will be flagged and the receiving computer will ask to resend

⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
⸻—

TYPES OF DATA TRANSMISSION


:
Data transmission :
it is sent by 3 things ,
1=where it is going , one direction or both simultaneously in both directions , 2=method
of transmission how many bits can be sent at the same time , 3=how data will be
synchronized how received data is in correct order

Types of transmission modes : simplex , half duplex ,full duplex ,

Simplex :
When data is sent in one direction only and is one way .

Uses of simplex : sending data to a printer , speaker , radio , monitor , keyboard , mouse

Half duplex :
When data is sent in both direction but not at the same time . Data can be sent from
computer a to computer b and also computer b to computer a but it cant be done
simultaneously .
Uses of half duplex :
Walkie talkie (you can talk to eachother but only one message at a time) USB
two way radio

Full duplex:
Data is sent in both ways at the same time . Info is sent and received at the same time

Uses of duplex :
Live chat Messages
Phone conversation
Zoom call and video conferencing

How to draw duplex and simplex :

Serial :
Occurs when data is sent one bit at a time over a single wire and bits are sent.one after
another. It can be simplex , half duplex of full.

Benefits of serial : works well over long distances , data will arrive fully synchronized
and in correct order , mostly used for outside computer and is better at resisting outside.
Can connect computer to printer

Drawbacks of serial : slower transmission rate and is mostly used outside of the
computer..

Parallel : occurs when several bits of data are sent down several channels /wires all at the
same time .
Each channel transmits one bit . It can be simplex , half or. Full duplex .

Benefits of parallel : works well over shorter distances , faster transmission rate , used
inside that computer and works well inside

Drawbacks of parallel :
data can be skewed when traveling long distances and can become unorganized .
Becomes damaged when places out of the computer and does not work with external
parts
⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
⸻— USB :
Usb :
universal serial bus is a form of serial data transmission and is most common type of
input and output port. Allows both half and full duplex
Usb cables consist of 4 wired shielded cable .
2 wires for power (red and black) and 2 for data transmission (white and green)

How computers interact with usbs :


computer automatically detects device because change in voltage.
The usb is recognized and a driver software is loaded so the usb can communicate and
download

Benefits and drawbacks of usb :

Benefits = Automatically detected , prevent incorrect connection, no need for external


power source , error free transmission , backwards compatible

Drawbacks= Supports maximum cable length of 5m only ,not always backwards


compatible with older versions in latest computers , slower compared to ethernet

USB-C:
A new type of usb cable being used in modern devices . Much smaller than usb .
Backwards compatible and has more voltage .

⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
⸻—
ERROR CHECKING:

Why do we need to check for errors :


because there is always a risk that data might get corrupted or lost

Error checking techniques :


checksum , parity checks , echo checks , ARQ , Check digit
CRC:
cyclic redundancy checks are used to check data packets . Calculates the sum of all bits in
the payload and writes the number in the trailer . When it arrives , the other computer
adds up all the bits and compares it to the hex sum written in the trailer .
If they match , there are no errors , otherwise the packet needs to be resent.

Parity checks :
used to find if data has been changed or corrupted .
Data can either be odd or even . Odd means the number of 1s in a byte are an even
number . This means the parity bit will be 0 if its odd ,the parity bit will be 1 . Based on
the parity given you have to make the number of 1s even or odd

Problems with parity :


When 2 bits are added , this still keeps the number even or odd and the system doesn’t
catch the problem . It will be impossible to find the problem in the byte.

We can solve this with parity blocks , where a square of numbers is given parity and then
seen horizontally and vertically for mistakes until one bit is found

Checksum :
A method used to check if data has been changed or corrupted .
Data is sent in blocks and an additional value , the checksum is sent at the end of the
block of data .

Steps of checksum:
Sending computer adds all the data and writes the checksum at the end Data is
transmitted with checksum
Receiving computer adds all data
Then it compares sum to the checksum given
If it is different , a request is made to resend data

Echo check :
When data is sent to other device , the data is sent is sent back to sender . The sender
compares it to the original data to see if its different . If its different then an error has
taken place .
Steps of echo check :
Sent data is resent to sender
Resent data is then compared with original data If errors are found data is found

Problems with echo check :


You don’t know if the data has been corrupted in the original send or the resend .

Check digits :
Check digit is the final digit in the code . It is calculated from all the other digits in the
code .
It is used to find any mistypes in passwords and extra digits in a password
.
Common check digit algorithms :
ISBN-13
Modulo-11

ISBN-13:
The check digit in isbn 13 is the 13th digit .
Add all odd digits
Add all even and multiply by 3
Add odd and even and divide by 10
Take remainder.
If remainder is 0 , check digit will be 0 , other wise , subtract the remainder from 10 .

MODULO 11:
Each number in code has been given weight of 8 ,7 ,6 ,5 ,4 .. 1 will be for the check digit
Multiply the numbers except the check digit by its weighting value separately
Add all numbers
Divide total by 11
If remainder is 10 , use 10 as the check digit , otherwise ,subtract the remainder from 11
for the check digit
How to calculate if answer is correct : do calculation with check digit .if check digit is 0 ,
then answer is correct
Uses of check digits :
Used in barcodes and passwords
ARQ:
automatic repeat requests is a way to check errors.
Receiving computer will send an acknowledgement if the data is correct .
The sending computer will resend data will resend data if the acknowledgment is not sent
in time . This is by using at timer to count down for an acknowledgement .

Why do we encrypt data:


To prevent the risk of data being intercepted and hacked .
Encryption alters data into a form that is unreadable by hackers or people whom the data
is not intended for .

Plaintext:
The original way the data was sent

Cipher text:
The altered , encrypted data after it goes through an encryption algorithm

Symmetric encryption:
Uses and encryption key which is a code . This alters the numbers / letters .

Eg:
Cs is exciting
+11 11 11111111 (shifting the alphabets 1 up) =dt jt fydjujoh
This is unreadable

Disadvantages of symmetric:
Modern computers can easily decrypt the data without any key or code. It also needs to
keep the key a secret and if the key gets out , the data will easily get intercepted

Asymmetric encryption:
Uses 2 keys called public and private key
The public key can be accessed by anyone and is used to encrypt data . The private key is
only used by 1 person and is used to decrypt data
————————————————————————————————————
————
CHAPTER 3: HARDWARE

CPU : central processing unit is a processor or microprocessor that is central in all


modern computer systems even tablets and phones . It executes and processes all the data
and instructions in a computer application .

Where is the cpu installed:


It is installed as an integrated circuit and is on a single microchip

What does the cpu consist of :


Control unit (CU)
Arithmetic and logic unit (ALU)
Registers and Buses

⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
⸻-

CHAPTER 4 :SOFTWARE

2 types of software :
System software and application software

Features of system software:


Set of programs to manage the operation of hardware.
Platform for other software to run
Provides human computer interface
Controls usage of hardware

Features of application software:


Used to perform various applications on the computer
Allows users to perform tasks on applications
Can be a single app (word) and not a collection of them (microsoft office)
Examples of application software:
● Word processor = used to copy , paste , type and etc text
● Spreadsheet = organises data into cells and can turn it into a graph
● Database=analyses , summarises and organises data and has tables
● Apps=a program that can serve multiple purposes that is downloaded
● Graphics manipulation software= edits and changes bitmap and vector image
settings
● Video editing software= edits video and video settings and adds colour etc
● Photo editing software=edits digital photos and changes photo settings
● Control and measuring software= measures physical quantities and temp .
Controls apps and data

Examples of system software :


● Utilities = vital programs that carry out specific functions like anti virus that are
already pre installed
● Device drivers = communicates between software and hardware and input output
● Linkers= links and compiles objects and software into one single program and
simplifies tasks
● Compilers=translates code in high level language into machine code so the
computer can understand
● Operating system = controls the basic functions and interprets and translates
between the user and computer

Utility software:
Software that are pre installed and run in the background .

Examples of utility software:


Virus checkers
Defragmentation software
File compression and file management Security
Screensavers

Virus checkers:
Computers use this because many systems get infected with malware . There are ways to
prevent this by not downloading from unsecured websites . But this is not reliable so this
is why anti-virus software needs to be downloaded.
How do virus checkers work :
They check files and software for traces of malware and checks for unusual behaviour .

Defragmentation software:
As an HDD becomes full , blocks used for files become scattered all over the disk surface
. This leads to slower data access time .

When removing and adding data in and hdd , the HDD stops organising the data and puts
it where ever it finds space . Then some of the game data can be misplaced into the music
file . The defragmentation software compiles all the parts of data and segregates it into
specific categories .

Track : the entire circle row of the HDD


Sectors : section of the the HDD that is a column

Advantages of defrag:
Faster data access time
Less storage required
Organized storage

Back-up software:
A separate replica of your data incase it is corrupted during an update , etc.

Security software :
A software that manages access control and user accounts (usernames and passwords) .
Links into other utilities like anti virus , etc .
Protects networks with firewalls .encrypts data .

Screensavers:
Programs that moving and still images on the screen after inactivity from the user.
Originally it was used in computers to prevent screen burns but now they are used for
customisation in OLED and LCD screens . But it is also used as a security measure .
If the user is inactive , the device will log out and put a screensaver to prevent other
people from accessing the users device.

Device drivers:
Software that communicates between the OS and translate data to communicate to
hardware peripheral devices . Otherwise hardware would not be able to work with the
computer .

How do USB’s communicate with the computer :


USB contains descriptors with info about the USB and the descriptors contain a unique
serial number to show the computer what it is .
Then the computer sends specific device drivers to communicate to it .

Operating system:
A software that operates and manages all tasks in the computer . It provides an
environment for applications to be run and acts as a human computer interface (HCI) . It
also simplifies the complexity of computer software .

Types of OS:
MacOS
LinuxOS
AppleOS
IOS
Google android

Where is the OS stored :


In the HDD on computers and on the SSD in tablets and phones.

Functions of typical operating system:


Human computer interface. (Interpreter)
Multitasking. (Multitasking)
Platform for running apps software (Apps platform)
User accounts. (User account)
Managing files. (Storage)
Hardware peripheral management. (Hardware)
Memory management. (Memory)
Interrupts handling routines. (Interrupts)
Security management. (Security)

Human computer interface:


An interface program that allows the user to execute actions into the computer

2 types of HCI:
Command line interface (CLI)
Graphical user interface (GUI)

CLI:
A more primitive type of HCI .
User needs to memorise and input lines of code to execute actions on the computer . It is
much more slower and is very primitive . But an advantage is that it communicates
directly to the communicates to the computer .

GUI:
The modern HCI and allows the user to interact with the device using pictures or symbols
and with a mouse instead of lines of code .
You can just select an icon for an action to be executed .
The GUI simplifies the machine code and computer actions .

Difference between GUI and CLI


WIMP:
A type of GUI used by Microsoft . (Windows icons menu and pointing device) Contains a
mouse and can open windows and apps .

Post WIMP:
Tablets and phones can now use touchscreen and perform a wide amount of gestures such
as pinching and rotating . This would be difficult for a WIMP GUI

Memory management :
OS manages the primary and secondary storage (ram and rom) and allows data to be
moved between
Keeps track of memory locations
Carries out memory protections so data isnt lost and data isnt breached and apps dont
display wrong results
Security management:
● A part of OS and is the part that ensures that the data is confidential and well
protected .
● The OS has to carry out regular updates Updating antivirus software
● Prevent illegal intrusion and privacy of data
● Using password and firewalls

Hardware peripheral management:


The OS manages all the input and output peripheral devices .
It communicates with all the input and output devices
Uses device drivers to send messages
Manages hardware by using buffers
Receives and handles interrupts from the printer

Buffers:
A temporary waiting area for data to be processed . Sometimes some high value data has
to be processed first so the low value one has to wait in a
buffer.

File management:
The OS has to name the file based on data
Eg: filename.docx , filename.htm , etc
It helps to open , close , delete , rename ,etc for a file and allows it to move from rom to
ram and vice versa
Maintains security for all files and organization

Multitasking:
Allows computers to do more than one task at a time . To make sure both tasks don’t
clash , the OS. Has to constantly monitor both processes under its control . Tasks are
given high or low priority , based on that , the OS can choose to multitask or etc

Management of user accounts:


The OS. Manages the data and username , passcode for various user accounts logging
into the computer , the OS. Will store the separate users data in different parts of the
memory.
Running of applications:
The OS. Provides a platform on which software can run

Booting up:
When the computer starts , part of the OS is loaded into RAM . The start up of the
motherboard is handled by the basic input/output system (BIOS) . The BIOS tells the
computer in which storage the OS is in so it can be transferred and started .

Firmware :
A type of program that provides low level control for devices . BIOS is type of firmware
as well as drivers

How is the BIOS stored :


The BIOS program is stored on a special type of ROM known as EEPROM (electrically
erasable programmable ROM) . EEPROM is in a flash memory chip . This means that its
content is still there even when the computer is turned off .

But the BIOS settings are stored in the CMOS (complimentary metal oxide semi
conductor) chip . The CMOS is powered at all times by a battery on the motherboard.
The BIOS setting will reset if the battery is taken out . Once the CMOS is restarted , it
will access work with the same BIOS settings in the EEPROM but the settings will be
reset to the factory default

Interrupts:
A signal sent from a software or device to the microprocessor. This makes the
microprocessor stop what its doing to service the interrupt .

What causes interrupts:


A timing signal
Hardware fault
Completed process
Input / output process .
User input / gesture

Interrupt priority:
The microprocessor gets the interrupt and decides if it is a high or low priority.
A low priority will not be that important that the microprocessor has to completely stop
what its doing and the high level one will be vice versa .

Types of programming language:


High level and low level

Machine code:
A code in binary and numbers that computers only understand .

Computer program:
A list of instructions for a computer to do a task

High level languages:


Allow a programmer to focus in a problem to be solved . It requires no knowledge of
hardware and instruction set of the computer.

Advantages of high level:


Read and understood easily because language is close to english
Writes in a shorter time
Can be debugged in developed stage
Can be maintained once in use

Types of high level programming:


C++ , Delphi , Java , Python , Visual Basic .

Low level languages:


Relate to specific hardware and architecture on a particular computer
Can refer to machine code or assembly language that needs to be translated into machine
code

Assembly language :
It assembles variables into one thing and needs to be translated by an assembler
Used to make use of special hardware
Used for special machine instructions
Used to write code that doesn’t take much space in the primary memory Performs task
very quickly

Executable file :
.exe means it does not need to be processed again and again

Translator:
A program that translates programs and codes and inputs into binary and machine code

Compilers:
A type of translator that translates the entire whole HIGH LEVEL code into machine
code all at one time .
Can be used again and again without the need to recompile and is faster than interpreters.
(Exe file)
Used for general use
Translated into 1 whole instruction

How compilers compile:


They translate the entire code at once and then looks for errors in the code such as syntax
, etc . Then it either outputs an exe file or outputs errors and their location on error at a
time . Once all errors are corrected it will re compile and produce an exe file.

Interpreters:
A program that executes a HIGH LEVEL language one statement at a time
Once interpreted , it does not become an exe file and needs to be reinterpreted over and
over
Used when a program is being developed Translated into several instructions

Assemblers:
Translates an LOW level assembly language program into machine code so it can be
directly used for a task .
After once assembled , the code can be used again and again without any re-assembly
(exe file)
Used for general use
Usually translated into one whole instruction
Advantages of compilers:
Can be stored and ready for use
Takes up less space in memory when executed Executed in shorter time
Doesnt need to be recompiled

Disadvantages of compilers:
Takes longer to debug and write and test during development Less reliable and less
precise

Advantages of interpreters:
Easier and quicker to debug and write in development More precise and accurate

Disadvantages of interpreters:
Take longer to execute
Programs need to be interpreted again and again

Summary:
Interpreters are more precise but take more time
Compilers are quicker but are less quick in debugging and are less precise

IDE:
Integrated development environment is used by programmers to aid writing and develop
programs . Ides support different languages .
Eg: pycharm for python

Features of IDE:
Code editors
Translator
Run time environment with debugger
Error diagnostics
Auto completion
Auto correction
Auto documenter and pretty printing

Code editor:
Allows program to be written and edited without the need for an external text editor .
This speeds things up since you don’t have to switch software when you need to correct
your program

Translator inside IDE:


IDEs provide a translator . This can be a compiler or interpreter , etc . They are done for
the program to be executed

Runtime environment with a debug:


A debugger runs a program under development and allows the person to step through the
program at a certain point in the source code
It allows the person to see if theres any logic errors

Error diagnostics and autocorrection:


Finds out errors when the program is being typed . It alerts the programmer about the
error and suggests a solution . This makes programming easier

Auto-completion:
Use prompts to help the user based on context and tries to think and type what the user is
going to program.
This makes it easier to type large loops.

Auto-documenter and pretty printing:


Use auto documenters to explain the function of programming code . Code editors colour
code in a meaningful way . This is known as prettyprinting
⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
⸻—
CHAPTER 5 : THE INTERNET AND ITS USES

Internet:
A worldwide Interconnected network and is a huge collection of those networks .
Relies on physical infrastructure that allows networks and devices to connect with each
other

WWW:
World wide web is only a part of the internet that you can access using a browser
software Consists of massive webpages collection and is based on hypertext transfer
protocol

HTML:
Hypertext markup language is sent from websites to the user to display the webpages .

URL’s:
Uniform resource locators are text addresses to access websites. It uses the format
protocol://website address/path/filename

HTTP and HTTPS:


(Hypertext transfer protocol is a set of rules that has to be done when transferring files
across the internet. When an extra protection is used as well as http then it converts to
HTTPS . S stands for secure.
Extra Security (SSL or TLS) + HTTP = HTTPS

Web browsers:
A software that allows you to access and display web pages . They interpret HTML from
websites and display the result like videos , photos ,audio , text

Features of web browsers:


Home page
Bookmarks (ways to store users favorite websites)
User history
Allows the user to go back and forth through opened websites
Has multiple tabs (allow more than 1 page to be open)
Use cookies
Use hyperlinks to navigate through webpages
Data is stored in cache
Uses address bar
Uses javascript

DNS servers:
(Domain name servers) a server system for finding the IP address for websites . It
converts the website url into IP address
How webpages locations and data are found:
We search a website on the browser
Browser asks DNS for the location and ip address of the website
Dns server finds ip address and sends it back to computer
If it does not , it checks with other dns servers
Then the computer find the location of the website and downloads data

Cookies:
● Small files or code stored on a users computer that is sent from the webpage to the
browser on the users computer.
● Every time a user enters a website . It checks if the user has cookies .if it does , the
browser reads the cookies which holds key info about the user .
● Cookies maintain user preferences and shows results that are related to user
searches

Information pairs on cookies:


Hold info like : (music,rock) (surname , jones)
Help to personalize searches and results

2 types of cookies:
Session cookies and persistent cookies

Session cookies:
A type of cookie that is stored in temporary memory and deosnt personally identify the
user and any info from the computer .
They cease to exist after the session finishes or the browser is closed

Persistent cookies:
They remember lo in details and are stored on the hard drive of a users computer until
expiry date.
These cookies continue to exist even after the browser is closed and the session is over.
They remove the need to type in log in details .
Websites ask for permission to install these cookies and encrypt data stored

Digital currency:
A type of currency that exists in digital form . It has no physical form like conventional
fiat currency

Fiat currency:
A currency supported by governments and is directly related to physical cash and silver
and gold reserves. It can be in cash , credit and online payment like apple pay.

Central banking system :


A central bank system is when 2 banks are connected to one system so money can be
transferred between them.
Problem with centralization:
There is no confidentiality and security when transferring money through a central
banking system .

Cryptocurrency:
A digital currency created to solve the security and confidentiality problems faced in fiat
currency and cbs .
Before all the exchange rates are determined by the 2 banks but with crypto , the rates
and rules are determined by the community .
Unlike fiat , crypto transactions are public which means they can monitor the amount of
crypto and keep it regulated
Uses blockchain

Blockchain:
Is a decentralized database and all the transaction are stored on this database . Consists of
a number of interconnected computers but they are not connected by a central server .
When a new transaction takes place all the computers get a copy of it . This is so it cant
be changed with all of the consent of all the network .
Removes the risk of security

Uses of blockchain:
Cryptocurrency
Smart contacts
Research
Politics
Education
How does blockchain work:
When a new transaction is made a block is created.
It has data , hash value , previous hash value
Every time

a new block is created , it is chained to the previous one and has a unique hash as well as
the hash of the previous one .
The hash also includes a timestamp .
What is block 2 in a block chain called: The genesis block

How is blockchain good for security:


If there is any tampering in the data of a block , its hash value changes , this changes all
the chain values and makes them all invalid since the hash of one block affects the one
after it.

Proof of work:
It takes 10 minutes to create and certify a single block which is done when miners solve a
very complex math problem. This 10 minute time stops hackers from creating a whole
new chain

Key terms:
Internet= interconnected network
WWW= worldwide web
IP= internet protocols
TCP = transmission protocols
HTTP= hypertext transfer protocol
HTTPS = hypertext transfer protocol secure URL = uniform resource locators
HTML = hypertext markup language
DNS= domain name server

Types of cyber security threats :


Brute force attacks
Data interception
Distributed denial of service Hacking
Malware
Phishing Pharming
Social engineering
Brute force attacks:
When hackers systematically try all different combinations of all letters and character to
eventually find your password .

Common cyber-security threats:


● Brute Force attacks
● Data interception
● DDoS attacks, (Distributed Denial of Service).
● Hacking
● Malware
● Phishing
● Pharming
● Social engineering

Brute force attacks:


Where an attacker tries all different combinations of letters, numbers and other symbols
until they crack your password.

2 logical steps to reduce the number of attempts needed to crack a password:


Step 1: Check if the password is one of the 5 most common passwords. 123456,
password , qwerty , 111111 , abc123
Step 2: If it isn’t in the common list, then you start with a strong word list.

Word list:
● Text file containing a collection of words.
● Can contain a million words.
Step 2 would still take several hours until the password is found.

Data Interception:
Stealing data by tapping into wired or wireless communication links . It gets your
confidential and private information.

Packet sniffers:
Used in data interception and checks for all packets being transmitted and all intercepted
data is sent back to the hacker .
Wardriving:
● Sometimes called Access Point Mapping
● Data can intercepted using a computer or phone, antenna and a GPS device, outside a
building or someone’s house.
● The intercepted wifi signal can reveal personal info to the attacker.
● The user often isn’t aware of this.

How to protect from data interception:


Use data encryption like WEP to make the data unreadable by the hacker . The only way
to read it is with a decryption key. This stops the hacker from getting info.
Also do not use public wifi since there will be no data encryption

WEP:
Wired equivalency privacy is an encryption protocol that is recommended with a firewall
to stop data interception .
Wireless networks mean Wi-Fi.

DDOS attacks:
Stands for Distributed Denial of Service.
Prevents users to access a part of a network.
Usually temporary but can be very damaging act or a large breach of security.
Affects networks and individuals.

The attacker may prevent the INDIVIDUAL from:


● Accessing their emails
● Accessing website
● Accessing online services

Spam Traffic ( A DDoS attack method):


when a hacker Floods the network with useless spam request traffic to overload it and
make many users lose access to the server . This is because the server cant handle all the
spam requests and then ignores any requests from the victim.

How it works:
● The attacker adds thousands of requests (spam traffic) when the user submit a request.
● Since the server can only handle a certain number of requests, it wont be able to
process the users request.
● This is a denial of service

Why is DDOS worse than DOS :


Because the dos attack comes from many computers it is hard to track and hard to stop.
Since the spam traffic comes from many computers, it becomes hard to block the attack.

Ways to guard against these attacks, up to some degree:


● Using an up to date malware checker
● Setting up a firewall to restrict unnecessary traffic.
● Applying email filters for unwanted traffic, spam email.

Certain signs to look out for:


● Slow network performance
● Inability to access certain networks
● Large amounts of spam email to the users account.

Hacking:
The act of gaining illegal access to a computer system without the users permission.
Usually leads to identify theft or losing personal info.
Data can be deleted, passed on, changed or corrupted.
Encryption does NOT stop hacking because it does not stop them from deleting and
corrupting data

Ways to prevent against hacking:


● Using firewalls
● Usernames
● Frequently changed strong passwords
● Anti-hacking software
● Intrusion detection software

Ethical Hacking:
● A University course
● Companies authorize paid hackers to check their security measures.
● And check how good their computer systems are against hacking attacks.

Malware:
● One of the biggest risks to the integrity and security of data on a computer.
● Many forms of malware:

Viruses:
Programs that replicate themselves and delete and corrupt data .
They fill up the hard drive with useless info and delete executable files to overload and
cause the computer to malfunction

Active hosts :
Viruses need to be on an active host program that will only run and cause harm when
executed or opened . This is why viruses are sent in websites , downloads and email links
since the user activates it with an action .
This is known as a trigger

Ways to prevent:
● Don’t open unknown emails
● Don’t install non-original software
● Always run an up-to-date virus scanner.

Worms:
A type of malware that self replicates and doesnt only destroy 1 computer but aims to
spread to others and corrupt entire networks .
They dont need an active host program to start and remain inside apps so they can travel
through networks without the user activating it .
They enter when there are security failures instead of targeting 1 file like viruses

Example of worm:
I love you worm infected many windows pcs through a love letter file on email . It
overloaded phone systems and brought down networks .

To prevent it:
● Don’t open unknown emails
● Don’t uninstall unoriginal software
● Run up to date virus scanner together with an up to date anti virus program.

Botnet:
When worms take over many computers and make them bots that all create a network
and send the worm to others . It makes it hard for people to detect where the worm was
initiated

Trojan horse:
a program that is disguised as a legitimate software but hide malicious code inside .
Needs to be executed by end user and can be downloaded as email or from infected
website . It mainly does not cause damage but gives out personal info to hackers who
download spyware and ransomware into the system . Trojan horses work as a way to
allow more malware to enter .
Can surpass firewalls

Spyware:
● Software that gathers information by monitoring a user’s activities done on their
computer.
● Gathered info is sent back to the cyber criminal who sent the spyware.
● Designed to monitor and capture web browsing and other activities.
● Eg: Bank account details, passwords and credit card details etc etc.
● Can be detected and removed with an anti spyware program.
● Biggest danger is finding the method used to enter a users computer.
● This indicates a weakness in the system has been found that could be exploited by more
dangerous malware.
● Used to make way for even more malware to enter

Adware:
● Type of malware.
● Not necessarily harmful.
● Usually floods an end user with unwanted ads.
● Can highlight weaknesses in a users security defenses.and can appear in fake download
ads and redirects
● Can be hard to remove since it defeats most anti-malware software as it’s hard to
determine whether it’s harmful or not.

Ransomware:
● Programs that encrypt data on a users computer and hold the data hostage.
● The cyber criminal waits until ransom money is given and sometimes the decryption
key is given to the user.
● Can be installed through a Trojan horse or social engineering.
● When executed it either encrypts files instantly or waits a while to determine how much
the victim can pay.
● Once executed it becomes almost impossible to reverse the damage caused.

Prevention methods:
● Avoiding phishing attempts.( Unknown emails and links).
● Ensure regular back-ups of key file.

Phishing:
● When a cybercriminal sends out legitimate looking emails to victims.
● The emails may contain links or attachments that take the user to a fake website.
● Also trick the user into giving personal information.
● Non specific targeting an individual.

Prevention methods:
● Awareness behind identifying phishing scams.
● Don’t click on unknown emails unless they are confirmed to be genuine.
● Running anti-phishing toolbars on browsers.
● Always look for https or the padlock symbol because that means a website is secure.
● Regular checking of online accounts.
● Maintaining passwords regularly.
● Run a up to date browser is running on the computer.
● Run a good firewall at all times.
● Be vey wary of pop-ups and use the browser to block them.
● If the pop up gets through your defenses do not click on cancel since that usually leads
to the malicious site.
● Instead click on the small x at the top to close it.

Spear phishing:
Where the criminal targets a SPECIFIC individual or company for financial information
or industrial espionage.

Pharming:
● Mainly create websites that have same spelling so when user is typing url , if it
typed wrong it will show the fake website . The fake replicates the real one to get
all the login details of the user .
● Malicious code installed on a users computer or on an infected website.
● The code redirects the users browser to a fake website without users knowledge.
● No action needed to initiate.
● The attacker can gain personal and financial data.
● Website often appears as trusted website and lead to fraud and identity theft

Ways to prevent pharming :


Typing in the proper url code and also making sure the website mainly uses https and
.com
Use bookmarks to prevent any mistypes

DNS cache poisoning:


● Type of Pharming.
● Changes the real Ip address to fake malicious address.
● The dns cache is poisoned so that the ip of the website changes from real to fake
website

Ways to mitigate the risk of Pharming:


● Use of anti-virus software, can detect alterations to a website address.
● If DNS server has been infected then it becomes more difficult to mitigate the risk.
● Many modern browser can detect attacks.
● Check website spelling to make sure it’s correct.
● Check for https or padlock symbol, means It’s secure.

Social engineering:
● Social engineering is a tactic used by cybercriminals.
● It involves creating social situations to catch victims off guard.
● The goal is to manipulate people into ignoring security procedures.
● This can lead to individuals not following best practices for security.
● Effective way to introduce malware into users system.
● No hacking involved since user is allowing the attacker to get access.
● Uses human behavior to trap people

3 common emotions exploited:


● Fear, suppose a virus attack.
● Curiosity, scams saying you won a car, etc.
● Trust and empathy, fake emails and calls from well known company imposter.
Fear :
User is tricked into panicking to believe their system is at danger and download some
shady software

Curiosity:
Hackers trick them into thinking they won a car or prize and make them download a
malware

Trust:
Use fake emails from trusted companies to trick people who rely on them to scam and
install malware into the system

5 types of social engineering threats:

Instant messaging:
● Instant messages often contain malicious links.
● These links may appear as important software upgrades.
● Relies on user curiosity.

“Scareware”:
Relies on users fear and makes a pop up message for a fake virus .
This makes the user download a fake antivirus that is actually a malware

Phishing scams(Emails):
● A seemingly “genuine” email is sent and contains a link.
● The link redirects the user to a fake website.
● Relies on trust of well known companies.

Baiting:
● Attacker leaves an infected memory stick in a specific location.
● The user then picks it up and plugs it in to see whose it is.
● The infected stick then downloads malware on the computer.
● Relies on user curiosity

Phone calls:
● So called “professional” calls saying their device has been compromised.
● The criminal is requested to download a software that gives access to their computer,
eg: AnyDesk.
● Relies on fear.

Steps of cybercriminal :
Step 1 - victims info is gathered and victim is selected with method of attack decided
Step 2 - victim is being targeted by email or trojan horse in phone call
Step 3 - attack is executed by hackers and criminal gets all info
Step 4 - when they got enough info , the criminal removes all traces of malware from the
system

Keeping data safe from threats:


● Access levels
● Anti malware
● Anti spyware
● Authentication
● Biometrics
● 2 step verification
● Automatic software updates
● Checking spelling of URL
● Firewalls
● Proxy servers
● Privacy settings
● Secure socket layer SSL

Access levels :
This allows only certain users to have access to databases . Eg : janitor cant have access
to medical data like the nurse can . This allows info to be private and ensures not all data
can be visible to everyone

Types of access levels :


Public - anyone from public can access it
Friends - only identified friends on computer by owner can view it
Custom - user can set requirement for viewing and can select few people Data owner -
the data is owned by the owner
Anti malware :
Includes antivirus and anti spyware

Anti spyware :
Detects and moves any spyware programs on a system . Based on rules which are criteria
that if the program doesn’t meet it is removed . Also file structures since structures
associated with potential spyware are deleted

Features of anti spyware :


Detects and removes and spyware
Prevents user from downloading it
Encrypts files to make data unreadable
Encryption of keyboard strokes for key loggers
Blocks access to webcams
Scans for if personal info has been stolen

Authentication :
Refers to ability to let the user prove who they are through PIN , something you have like
a tablet . Something unique to you like biometrics .

Passwords and usernames :


They are used to restrict access to data or systems and allow for authentication . Should
be hard to crack they are used frequently in the internet for emails , banking , shopping
and can be paired with biometrics.

Biometrics :
Used in the same way as passwords and are unique to an individual .
It can be fingerprint scans , retina scans , face recognition , voice recognition

Where is it used :
In latest phones for authentication and is used in devices and transactions

Fingerprint scans :
Images and scans of your fingerprint will be checked with the saved requirement in the
database on the device . It compares ridges and valleys that are unique and have a 1 in
5000 accuracy . If they have a decent match percentage authentication is allowed
Benefits of fingerprint scanning :
It is unique and cant be brute forced and improves security .
Other authentication can be lost but this has little to no chance to being stolen or lost .
It is impossible for other people to sign in because only 1 persons fingerprint is on the
database They cant be misplaced

Drawbacks of fingerprints :
Relatively expensive to install and also is not on all devices If finger is damaged , this can
have an effect on scanning Some people think it is civil infringement

Retina scans :
Uses infrared light to scan unique pattern of blood vessels in the retina . It is unpleasant
as it takes 10 to 15 seconds to. It is very secure and accuracy is 1 in 10 million

2 step verification :
Uses a second authentication step to sign in to an account . The first is the normal
password and second is a secure digit code sent to other email or phone that should be
entered to sign in . Main use is in banking and shopping .
One time passcodes PINS are used

Automatic software updates :


Automatically updates the software on a device . This can be done overnight or when you
are logged off .

Why are automatic updates important :


Important because they contain patches for malware and firewall detections and improve
performance . Removes bugs and adds new features and cybercriminals target lower
software update version when users have not downloaded it .

Checking spelling and tone of communication and URL links :


Always check spelling of any email senders account , links , check the tone of content
and if it is inappropriate then it can be phishing . Common scams include Amazzon.com

5 things to look out for in URL links :


1 - Check email address of sender . If sender is legitimate , they will not use @gmail.com
. Proper senders from amazon use @amazon.com
2 - tone of email and bad typos indicates a clear scam since trusted companies usually
have no typos
3- misspelling the domain and website URL names like gougle.com or amozon.com .
This is TYPO SQUATTING
4 - suspicious links that do not match the domain of the website should be checked and
avoided .
5- Always make sure the link has https (s for secure) and .com (large companies use
.com) and check for proper spelling and syntax

Firewalls:
A software or hardware that monitors and filters information coming in from the
computer to the external internet and vice versa based on a set criteria that is set by the
computer . It allows the user to not interact with harmful malware from an external
source . It protects from
malware ,phishing and pharming .

Tasks done by firewalls :


● Examines traffice between users computer and internet
● Checks if data meets set criteria
● If it doesnt the firewall will block the dataset access into the computer and give the
user a warning about the data .
● Logs all the traffic to allow later interrogation from user
● Also warns the user and gives a prompt to not go ahead . This doesnt work against
social engineering

Things firewalls cant protect against :


● Cant prevent users to use their own hardware like smatrphones and computers to
bpass the firewall
● Misconduct and control of passwords by user (like password being lost)
completely makes firewall useless
● Users on stand alone computers cna disable firewalls and be exposed to harmful
malware

Proxy servers:
● Act as a middle intermediate between the user and the web server . Allows web
traffic to be filtered ,
● Keeps users IP address secret and improves security
● If traffic is valid , only then will it be allowed by the proxy
● Prevents direct access and information to be stolen via IP by the web servers so if
an attack launched , it hits the proxy instead of the actual user
● Directs invalid traffic away from server

Cache in proxy servers:


When a website is visited , it is stored on the proxy server , when it is visited again , the
stored data is loaded directly from the proxy server and this speeds up access times and
also help with protection since the proxy server is handling it .

Privacy setting :
Controls available on web browsers , social networks , etc that allow to limit who can see
what content and who are only allowed to see a users personal profile .

Types of privacy settings :


● Do not track - option that stop websites from accessing personal browsing data
from the user and cookies .
● Saving payment methods - saves the passwords for payments so user can quickly
type and autofill
● Safer browsing - alerts when any dangerous website is encountered and bed
websites will be on a blacklist , this help to protect from malware
● Privacy options - browsing history and cookies management

Stopping website ads - option to not allow 3rd party websites to access your personal data
● Apps - allow you to not share location and not track in applications

Secure socket layer (SSL) :


A type of protocol and rules that are used by computers to communicate with each other .
This allows data to be secure when sent

Steps of SSL:
When user logs into website , SSL encrypts data and only the users computer and the web
server are able to see the data . SSL is there when near the http and secure or a small
padlock . If it says i then its not useing https s and SSL
⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
⸻—
CHAPTER 7 :
Algorithms , programming and logic

Program development life cycle:


Analysis = finding out the problem and working on a solution
Design = how the solution should be done and how everything should work
Coding = programming based on the design
Testing = checking for any errors and improving on the code

Computer systems and sub systems:


Functions of computer systems are split up into sub systems. This division is shown using
top down design . Sub systems have sub routine that can be coded using flowcharts or
pseudocode .

Top down design:


A diagram that divides the computer system into smaller sub systems until each sub
system only does one action

Flowchart:
A diagram that shows the steps of a program algorithm and show the steps to complete
the task

If , then , else if , endif:

Case statement:
A conditional statement that when you put in a different inputs you will get different
outputs

Using boolean operators in if then else:

Nested if loop:
Having a loop being connected to another
3 loop structures: For , to , next counter Repeat until
While , do , end while

For , to next loops: always iterates a set amount It sets a counter and does a loop multiple
times

Repeat until loops:


It repeats a loop until the condition is satisfied . A post condition loop
Always iterates at least once

While , do , end while loops :


A pre-condition loop and while the condition is not satisfied , the loop will continue

Total:
Finding a total of the sum of all the values inputted in a list

Counting:
Counting the number of variables inputed . It can count up or down

Maximum :
Finding the max value . Start by making it zero and then comparing the numbers until
you find the largest

Minimum:
Finding the smallest value . Start by make the value 100 and keep on comparing the
values until you get the smallest one

Average:
Add all the inputs into a total and then divided that by the counter.

Validation and verification :


Checking of data by the program to see if the data is reasonable

Range check:
Checking if the number inputted is in the range

Length check:
Checking if the length of characters inputted is correct used like
is length(number) > 5

Type check:
Checking if the data type is correct

Presence check:
Checks if the input prompt has been filled and makes sure nothing is left blank

Format check: checks if the input given is in the correct order .

2 types of verification:
Double entry = when data is entered twice to maintain accuracy Screen/visual check =
user is asked too check if the information is correct

Abnormal / erroneous test data:


Data that does not fit inside the range or data type Eg: if range is 1 to 10 , abnormal will
be -12 or “nine”

Extreme data:
The largest or smallest number in the normal range. Eg: from range 1 to 100 . Extreme is
1 and 100

Boundary data:
Contains the boundary of the range . It has 4 values . Eg: from 1 to 100 . Boundary is 1 ,
100 , 0 , 101

Linear searches:
Used to check for the correct values in an array . Uses boolean values and count / for loop
as well as repeat until loops that work until boolean is satisfied and then outputs the
number
⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
⸻ CHAPTER 8: if you didn’t, I’ll be better if you can, it’s better

Five constructs to developing a program :


● Data use=variables , constants , arrays
● Sequence=order of steps in a task
● Selection=choosing a path through a programk
● Iteration=repetition of a sequence of steps in a program
● Operator=arithmetic for calculation , logical , boolean for decisions

Variable:
it is a named data store that contains a value that may change during the execution of the
program . Variables should be give meaningful names.
Constant :
a named data store that has a value that does not change during the execution of the
program

Declare : some languages require specific declarations . It is declaring that your variable
is something so it can be used properly

Integer : a positive or negative number that can be used with mathematical operators

Real : a positive or negative number with a fractional part (decimal) can be used in
operators

Char:a variable or constant that is a single letter

String : a variable or constant that has several characters and can have letters and
numbers and symbols

Boolean : variable or constant that can have only 2 values , true and false
Input / output: to enter any info into a program or output results you need an input /
output statement.
Prompt:
A message accompanied by the input statement that tells the user what to enter in .

Input functions : Input() = for string Int() = for integers Float()

Message:
A message accompanied by the input statement that tells the user what the output is

example of complete programs:


Length=float(int(“please input the length”)) Width=float(int(“please input width”))
Height=float(int(“please input height”)) Volume=length*width*height
Print(“your volume is”,volume)

Basic concepts of code:


Sequence
Selection
Iteration
Counting and totaling String handling
Use of operators

Sequence : the ordering of steps in an algorithm . If it is incorrect you can get a wrong
result . Eg: doing a calculation before and input or doing and output before a calculation
Pseudocode repeat until function : crates a loop

Selection : it is a technique that allows different routes through the steps of a program .
Data can be picked based on criteria . Eg: largest number will be selected

Case statements :
Used when there are more than 2 choices to be made . Different programming languages
have different ways of doing this .

Iteration :
A type of loop system that makes it easier to produce long results .
A section of many lines of similar codes can be reduced to 1 or 2 lines based on a loop
system .

3 types of loops :
Count-controlled loops =for a set of iterations Pre-condition loops=may have no
iterations

Post conditioned loops=always has at least one iteration

Count controlled loops:


For loops when a set number of iterations is required . It can loop 5 ,or 4 ,or any amount
of times set . It cannot do more

Condition controlled loops :


When the number of iterations is not known . There are 2 options

Pre conditioning loops = may have no iterations


Post conditioning loops = always have at least 1 iteration

Length :
Finding the length of characters inputted

Substring:
Extracting part of a string eg = science from computer science

Upper: converting all characters to uppercase

Lower: converting all characters into lowercase


Procedure : a group of code that works together to do one task

Function : like a procedure but it will return a result to the program

MOD = returns remainder of a division Eg: MOD(10,3) = 1

DIV = quotient of the division Eg: DIV(10,3) = 3d

ROUND = returns value rounded up to a given number of decimal places Eg:


ROUND(6.97354 , 2) = 6.97

RANDOM = returns a random number within the range

Arrays:
A data structure that stores many values of the same data type under the same identifier
name.position of the value in the array is shown by its index . Most programming
languages start the array with a 0 as the index instead of 1
Difference between list and array:
List holds all data types while arrays only hold 1 type.

Things to use with arrays:


Linear searches - check in the array to find specific values
While loop - checks for if wrong inputs are entered
For loop - put a while of if loop in a for loop
If statement - used to check for values in the array when being inputted
⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻—
CHAPTER 9 : DATABASES

Database:
Structured collection of online data that allows people to extract data based on needs.
Data can be numbers , text or pictures or anything that can be stored on a computer .

Single table database:


Database that contains only one table

Why are databases useful:


Changes only have to be done once and is consistent
Same data is used by everyone
No data duplication

Uses of databases:
Patient list in hospital
Students grades
Book id in a library

Table:
Where data is stored

Fields:
Categories that are columns and stores the same data from the same category from
different people

Records:
Rows that store one persons data that has many categories and overlaps many fields
records consist of many fields . Each record has SAME NUMBER OF FIELDS

Validation of data in databases:


Data is automatically validated on entry based on the data criteria and it is based on
guidelines of the developer of the database . Some are provided by the management
software .

Eg of validation:
● Any dates inputted into a database will be checked to see if its valid date.
● Any numbers can be set to only input in a range so if the range is 1 to 10 , 12 will
be rejected

6 basic data types in databases:


● Text / alphanumeric
● Character
● Boolean
● Integer
● Real
● Date/time
Data type:
Classifies how data is stored , inputted and represented and how operations are performed
on the data .

Primary keys:
A category (field) that has a unique number or code that uniquely identifies each record .
This number has to never repeat and is a specific fields that is important while accessing
data

Eg of primary keys:
ISBN codes or unique patient IDs to identify them

SQL:
Structured query language is a language used to obtain information from databases . It is
used for single - table databases

SQL scripts:
List of commands that obtains specific info based on criteria , ranges , characteristics and
data types

Types of SQL statements:

Compulsory SQL statements:


SELECT (Chooses which field to output)
FROM (shows which table it is from)
; (Every sql code ends with semicolon)
———————————————————————————————
Chapter 10
Electronic circuits in computers, solid sate drives and controlling devices are all made up
of thousands of logic gates.
The checking of the output from a logic circuit/gate is done using a truth table.

Types of logic gates:

Truth tables are used to trace the output in a logic gate/circuit. A truth table lists all the
possible binary input combinations and their outputs, the number of outputs will depend
on the number of inputs, 2 inputs have 4 possible binary combinations (2 to the power of
2). 3 Inputs will have will have 8 binary combinations and so on.

Not gate: The output of X is 1 if A is 0 and Vice versa.


And gate: The output of X is 1 if both inputs, A and B, are 1
Or Gate: The output of X is 1 if either input, A and B, or both are 1.

NAND gate: The output of X is 1 if Input A and Input B are NOT both 1. NOR gate: The
output of X is 1 if neither input A nor Input B is 1

XOR gate: The output of X is 1 if, ( input A is 1 AND input B is 0) Or (if input A is 0
And input B is 1.)

XNOR: the output X is just like xor but the answer is reversed How to write them:

When logic gates are combined together to carry out a particular function they form a
logic circuit.
Produce a truth table for logic circuit, eg:

Writing logic expressions, eg:

Produce a logic circuit and truth table for a statement, eg:

Look at the truth table and in each case produce a logic expression and the
corresponding logic circuit, eg:
Finding out which Boolean expression is represented by the following truth table:

————————————————————————————————————
————
CHAPTER 9 : DATABASES

Database:
Structured collection of data stored on a computer that allows that allows people to
extract information . Can store text , numbers , pictures ,etc .

Why are databases important:


They prevent problems and any changes only have to be done once .
Same data can be used by everyone
No data duplication

Use of databases:
Student names
Patient names
Cars to be sold
Hotel bookings
Result of running race

Tables:
Databases have data stored on tables and have horizontal and verticals rows. Tables are
given names

Records:
Horizontal rows of a table and stores data of different categories

Fields:
Vertical columns that stores data from only one category . They are named by a primary
variable identifier

Eg of a database:
The table would be called patient_table
There would be fields like familyname , bednumber , consultant , etc for each patient
There would be many records for each patient that shows all the info that the fields show
.

⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
⸻⸻⸻⸻⸻ Symbols for logic gates:
Not gate= hyphen on top
And gate = . For multiplication Or gate = ()+()
Nor gate=(-)+(-)
Xor gate=ā.b+-b.a
Nand=-a.-b

⸻⸻⸻⸻⸻⸻⸻—————
Python andpseudocode codes:

How to write a 1 dimensional array :


● Start by naming and declaring the array , this also initialized the size of it
● Start a loop either with for , while or repeat until
● Use condition statements to check if the input is valid
● Now use this space to find max , min , average and all other functions
● Once the array is filled up , end the loop

How to write linear search (using the array already made before)
● If you are using linear search , open a for loop for the array and set a boolean to
false that only becomes true if it is found
● Go through each variable in the array until it matches your value , this changes the
boolean to true
● Keep the count and position of it in the array
● Close the loop and then finish off your average and etc functions
● Output everything and finish

How to write bubble sort:


● Initialize 2 variables for the count (one being upper bound , one being lower
bound)
● Start a repeat until loop
● Create a boolean called swap and set it to false
● Start a for loop with the 2 variables
● Check if the value is greater than the one infront of it . You can do this by using if
and comparing the position in the array with the position +1
● If you want to make it into descending order then change the direction of the
greater than sign
● If it is greater , store it in a variable used for transition
● Then , set its old position with the value of the smaller one
● Now take the value of the greater one and put it in the position that is +1
● Make swap into true
● End the if statement
● End the for loop
● Subtract 1 from your upper boundary
● End your repeat until loop (only ends when not swapped or if upper bound = 1)

Example of bubble sort:


First <- 1
Last <- 11
REPEAT
Swap <- FALSE
FOR index <- first TO last -1
IF runs[index] < runs[index+1] THEN
Run <- Runs[index]
Runs[index] <- runs[index+1]
Runs[index+1] <- run
Swap <- TRUE
ENDIF
NEXT index
Last <- last -1
UNTIL (NOT SWAP) OR Last =1

You might also like