Professional Documents
Culture Documents
Grade 11 2021 Lesson 2
Grade 11 2021 Lesson 2
Write a program to enter the name and mark of 200 pupils. Then output
(a) all the names and marks entered for example Krishna 45
(b) all names and marks of those who have got above 80 marks
(c) all names and marks of those who have obtained below 40 marks
23 AUGUST 2021
All Array:
CounterMore= 0
CounterStart = 0
CounterDivisble = 0
For Index = 1 to NumbeofEmployee
Console.writeline(“Please enter Name”)
ArrayName(index) = Console.readline
NEXT
30-AUGUST 2021
Predefined Function
RIGHT(T,3) = “and”
RIGHT(T,5) = “chand”
MID(T,4,3) = “tab”
MID(T,9,3) = “Bac”
MID(T,1,1) = “A”
MID(T,2,1) = “m”
LEN(T) = 15
INT(8.9) =8
INT(87.672) = 87
INT(0.782)= 0
LCASE(T) = “amitabh bachand”
UCase(T) = “AMITABH BACHAND”
Qu. Write a program to enter two values M and N. Then program code must output all the integers
between M and N inclusive.
M = 12
Dim M, N, i as integer N = 17
Console.writeline (“Please enter value of M “) OUTPUT
M = Console.Readline
For i = M To N
Console.Writeline (i)
Next
Qu
Dry run the following given the following code
For i = 1 to 4
Console.writeline(“OK”)
Next
i output
1 OK
2 OK
3 OK
4 OK
Qu write a code to output all integers that are exactly divisible by 3 from 3 to 103. Do not use MOD
Use FOR loop
i
Dim i as integer 3 3
6 6
For i = 3 to 103 step 3 9 9
Console.writeline(i)
Next
i output
For I = 20 To 15 step -1 20 20
Console.writeline(i) 19 19
Next 18 18
17 17
16 16
15 15
13 September 2021
Write a program to enter the date of departure and date of arrival of a fishing boat. Output number of
days the boat was at the sea.
Module Module1
Sub Main()
Dim DateofDeparture, DateofArrival As Date
Dim NumofDays As Integer
Console.ReadKey()
End Sub
End Module
TO WORK OUT the pre-release Nov 2016 P22
Pseudocode: MOD
DIV returns the quotient
50 DIV 10 = 5
14 DIV 6 = 2
100 DIV 8 = 12
Write a pseudocode to enter a number and then output the quotient when it is divided by 4
20 September 2021
Qu 1 Give 3 Programming Concept.
1. Sequence
2. Selection
Examples of selection:
a. IF.. Else.. Endif
b. Case.. Endcase
3. Repetition/ Loop/Iteration
a. For..To..Next
b. While..Endwhile
c. Repeat..Until
4. Assignment
For example X← 20, X←Z+Y, count = count + 1
5. Totalling. Example TotalMark = TotalMark + Mark
6. Counting. Example Counter = counter + 1, Total=Total + 1
Qu 2 Write an algorithm, using pseudocode and a FOR..TO..NEXT loop structure or other loop structure,
to input 200 even numbers. If not even the user must enter the number again.
NEXT
27 September 2021
What is a database? It is a collection of tables. It can have a number of tables.
6.
(a Complete the table below with a query to display all patients who live at Riviere Du
Rempart.
Display their name, Fees Paid and Gender
SORT
SHOW
Riviere Du Rempart
CRITERIA
OR
(b Complete the table below with a query to display all patients who live at Riviere Noire and and
have paid more than Rs 50000. Display their name, Fees Paid and number of days spent.
PATIENT PATIENT
TABLE PATIENT PATIENT
SORT
SHOW
CRITERIA
Riviere Noire >50000
OR
(b Complete the table below with a query to display all male patients who live either at
Riviere Noire or Amaury and have spent less than 10 days. Display their name and number
of days spent in ascending order of fees paid.
SORT Ascending
SHOW
CRITERIA
Riviere Noire Male <10
OR
Amaury
08 November 2021
Instruction Format:
Operand Opcode
2. DEC
Here we have only one part in the instruction. This means we have only the operand.
DEC is the operand
3. LDA #230
Load into the Accumulator the value 230.
15 November 2021
Storage
Primary Storage
Secondary Storage
OFF Line Storage
Primary Storage
These storages are directly accessible by the processor.
ROM
It is a non-volatile memory which means that it keeps its contents (data/program) permanently. That is
its contents do not disappear when the power is disconnected.
Its contents cannot be deleted or altered.
ROM holds the
1. (Basic Input Output System) BIOS
2. Bootstrap: This program is used to start the computer
3. Any firmware for description of the manufacturer
Types of ROM
Programmable ROM (PROM)
Erasable PROM (EPROM0
Electrically Erasable PROM (EEPROM). This technology is used in Flash Memory
RAM
It is a volatile memory. It holds its contents temporarily. That is when the power is off, all its contents
disappear.
Its contents can be deleted or altered.
It is considered as the working space of the computer. Any program needs to be loaded into RAM for
execution.
Types of RAM: SRAM, DRAM NVRAM Contents
of RAM:
Part of the Operating system is held in the RAM
The program currently being executed
The data that are needed by the program
RAM Contents:
Input data such as time set for washing, drying etc.
Data received from sensors such the weight from weight sensor, water level from water level sensor
and so on
27 Nov 2021
Free software
- Users have the freedom to run, copy, change or adapt free software. [cie] Examples include:
F-spot (photograph manager), Scribus (DTP)
- This software is free of charge. Can be downloaded and used. The source code of the software is
made available. The user can alter the source code to meet their needs and requirements.
- a user is guaranteed the freedom to study and modify the software source code in any way to
suit their requirements. [cie]
- it is not protected by any copyright restrictions.
- The originators of this type of software stress this is based on liberty and not price.
Summary
The user has the freedom to run, copy, modify or adapt the free software.
The user is availed with the source code which he can modify to suit his requirements.
The software is free of charge, does have any copyright.
The user can distribute the software to anyone without charging. It does not involve any cost.
Freeware
- FREEWARE is a software that a user can download from the internet free of charge.
- Once it has been downloaded, there are no fees associated with using the software
examples include: Adobe, Skype or media players.
- freeware is subject to copyright laws and users are often requested to tick a box to say they
understand and agree to the terms and conditions governing the software.
- Normally the user is not provided with the source code of the software.
Summary.
It is free of charge. No cost is involved. No licence fee to be paid.
Users can download and use the software only after having accepted the terms and conditions.
The software is copyrighted. This means it is protected by the law.
Shareware
• Users are allowed to try out the software free of charge for a trial period.
• At the end of the trial period, the author of the software will request that you pay a fee if you
like it.
• Once the fee is paid, a user is registered with the originator of the software and free updates
and help are then provided.
• Very often, the trial version of the software is missing some of the features found in the full
version, and these don’t become available until the fee is paid.
• Obviously, this type of software is fully protected by copyright laws and a user must make sure
they don’t use the source code in any of their own software.
Summary
1. This software is used for a certain period of time on trial basis free of charge.
2. Definitely the user is not provided with the full version of the software. This means some
features are missing and are available only after the user has registered.
3. After that period, the user can no longer use the software and therefore the user is given the
options whether to purchase.
4. To purchase the user has to pay a cost so that he\she can be registered for the full version of the
software.
5. The user is then provided with updates and helps.
6. Example of such software is antivirus software.
7. It is copyrighted. Must pay a fee for full version of the software and continue to use the
software.
8. On purchase the user gets a registration key/code.
9. Registration can be for a certain period of time and thus must be renewed.
29 Nov 2021
Firewalls
A FIREWALL can be either software or hardware.
It sits between the user’s computer and an external network (e.g. the internet).
Filters information in and out of the computer.
The firewall can be a hardware interface which is located between the computer (or internal
network external link) and the internet connection.
• it cannot prevent individuals, on internal networks, using their own modems to bypass the firewall
• employee misconduct or carelessness cannot be controlled by firewalls (for example, control of
passwords or use of accounts)
• users on stand-alone computers can chose to disable the firewall, leaving their computer open to
harmful ‘traffic’ from the internet.
Summary
It prevents virus from entering a system/Prevents hackers to gain access to the system
It logs all the incoming and outgoing ‘traffic’
It checks whether data going out or coming in meets certain criteria. If it does not the access is blocked
by the firewall by giving a warning to the user.
04 Dec 2021
PROXY SERVER
1. It also known as Internet server.
2. PROXY SERVERS act as an intermediary between the user and a web server:
User’s Computer send a request to the web server to get access to a particular website.
This request goes through the Proxy server. It is the responsibility of the proxy server to check whether
to grant forward or block the request based on certain criteria.
If not blocked, the request is forwarded to the web server.
The web server then send the response to the proxy server.
The web server response is filtered by the proxy server and is forwarded to the user’computer
What happens when a user wants to access a secure website and receive and send data to it?
INTERNET
Web Server
User’s Computer
1. The user’s computer web browser sends a message so that it can connect with the required
website which is secured by SSL. [cie]
The user’s computer uses its web browser to send its request to the web server. SSL encrypts
the request and then forwarded to the web server
2. The web browser asks the web server to identify itself.
3. The web server responds by sending a copy of its SSL certificate to the user’s web browser.
4. The web browser checks the authenticity of the certificate. If the certificate is authentic then
the web browser will send a message to the web server to start communication. Otherwise no
communication will start.
5. Once the message is received, the web server acknowledges the web browser.
6. The SSL two-way data transfer begins.
6 Dec 2021
Authentication:
Authenticity is the need to identify who sent the data and verify that the source is legitimate.
Data Integrity is that data should reach its destination without any changes.
Handshaking means exchange of signals between to devices over a network in order to establish
communication. For example computer to modem and so on.
Session caching
When opening a TLS session, it requires a lot of computer time (due mainly to the
complex encryption keys being used.
The use of session caching can avoid the need to utilise so much computer time for each connection.
TLS can either establish a new session or attempt to resume an existing session; using the latter can
considerably boost system performance.
Session Caching refers to the attempt to resume an existing session so as to considerably boost system
performance.
8 Dec 2021
Symmetric Encryption.
1. Plain Text
2. The encryption of the plain is done using a Secret Key.
3. Both the sender of the message and the receiver must know the secret key.
4. The sender use the secret key to encrypt the message (cipher Text) and then both the cipher
text and the secret key are sent to the receiver.
5. Hacker can intercept the secret key and thus be able to decipher the message.
Asymmetric encryption
There are four main security concerns when data is transmitted:
1 Confidentiality is where only the intended recipient should be able to read or decipher the data.
2 Authenticity is the need to identify who sent the data and verify that the source is legitimate.
3 Integrity is that data should reach its destination without any changes.
4 Non-repudiation is that neither the sender nor the recipient should be able to deny that they were
part of the data transmission which just took place.
Each user gets a unique pair of keys (private key and public key).
private key and public key (H,I)
Internet
Fred Bobby
private key and public key (F,G) private key and public key (D,E)
The public key of user is known to everyone who wants to communicate with the user.
For example, the public key of User 3 is known to user 1, user 2 and so on whereas the private key is
known only to the user and not others.
Let Bobby is sending a message to Fred
Bobby uses the public key of Fred to encrypt the message. The encrypted message (cipher text)
is then sent to Fred.
Fred will use his private key to decrypt the message.
Will not it be possible for Honey to intercept the cipher text and decrypt it using his private key?
No, because Honey’s private key and the Fred’s public key used to encrypt the message will not
match as a UNIQUE pair of keys.
With asymmetric encryption, the message will be confidential.
Note
Each user who wants to send a message on a network a unique pair keys.
The pair of keys are private key and public key
The sender uses the receiver’s public key to encrypt the message.
Only the intended receiver will be able to decrypt the message by using his private key. This is because
the private key and the public key used for encryption form the legitimate unique pair of keys.
08 January 2022
12 6 3 1
8 4 2 6 8 4 2 1
Answer: 7A 0 1 1 1 1 0 1 0
Answer: 22
12
8 64 32 16 8 4 2 1
0 0 1 0 0 0 1 0
Qu 2
(i) Draw and complete the truth table for the following Boolean expression
[4]
Truth table:
a.b a'.
a b X b' ' a' b
0 0 0 1 0 1 0
0 1 1 0 0 1 1
1 0 1 1 1 0 0
1 1 0 0 0 0 0
Uni
Directional
Bi-
directional
Qu
(a) What is COMPUTED TOMOGRAPHIC (CT) SCANNER? [2]
(b) How tomographic technology is used? [3]
(c) Give two different names of tomographic scanner. [1]
Answer
(a) COMPUTED TOMOGRAPHIC (CT) SCANNERS are used to create a 3D image of a solid object. They are
3-D scanners. / They are 3D scanners to create 3D image of a solid object.
(b)
To build up an image of the solid object through a series of very thin ‘slices’.
Together these 2D ‘slices’ make up a representation of the 3D solid object.
Each slice is built up by use of X-rays, radio frequencies or gamma imaging.
Each ‘slice’ is then stored as a digital image in the computer memory.
The whole of the solid object is represented digitally in the computer memory.
(c)
• X-rays: CT scanners computerised tomography
• radio frequencies: MRI magnetic resonance imaging
• gamma rays: SPECT single photon emission computed tomography.
15 January 2022
Qu an advantage that a programmer would get if he/she program code in assembly language.[2]
1. The program takes up less memory space.
2. The program runs faster than if it would have been developed in high level language.
3. Can write instruction to make use of special hardware.
Q2. Explain how an error detection method can be used to detect error on arrival of a message at its
destination. [4]
Advantage
Very large volume of data can be stored.
Can rely on a it is most commonly used technology
Disadvantage:
Hard disk drive has very slow data access as compared RAM
LATENCY: many applications require the READ/WRITE heads to constantly seek for the correct blocks of
data. This means a large number of head movements.
LATENCY is defined as the time it takes for a specific block of data on a data track to rotate around the
READ/WRITE head.
virus
precaution:
Use of an up-to-date antivirus software.
Do not open suspicious emails.
Use of firewall to detect and block virus.
Do not download and install software form unknown sources.
Must be very careful using free internet connection in public.
Pharming
Use anti-spyware software that can identify and remove Pharming code
The user should always be alert and looks out for clues that they are being redirected.
Do not surf on website not having the padlock in its URL.
19 Feb 2022
Latency is defined as the time it takes for a specific block of data on a data track to rotate around to the
read–write head.
Users will sometimes notice the effect of latency when they see messages such as ‘please wait’ or, at its
worst, ‘not responding’.
Solid-state Drives (SSD)
SOLID-STATE DRIVES (SSD)
Examples: Pendrive, SD Card, Flash Memory
1. They have no moving parts and all data is retrieved at the same rate. No moving parts means
they are robust.
2. They don’t rely on magnetic properties.
3. The most common type of solid-state storage devices store data by controlling the movement of
electrons within NAND chips.
The data is stored as 0s and 1s in millions of tiny transistors within the chip. This effectively
produces a non-volatile rewritable memory. This means the contents of the storage can be
deleted, modified or added and they are permanent. Here NAND technology is being used.
4. A number of solid-state storage devices sometimes use ELECTRONICALLY ERASABLE
PROGRAMMABLE READ-ONLY MEMORY (EEPROM) technology. This means NOR chip is used
instead of NAND chip
5. EEPROM technology makes them faster in operation than using NAND technology.
6. But devices using EEPROM are considerably more expensive than those that use NAND
technology.
7. EEPROM also allows data to be read or erased in single bytes at a time. Use of NAND only allows
blocks of data to be read or erased. This makes EEPROM technology more useful in certain
applications where data needs to be accessed or erased in byte-sized chunks.
8. Because of the cost implications, the majority of solid-state storage devices use NAND
technology.
9. The two types are usually distinguished by the terms FLASH (use NAND) and EEPROM (use NOR).
NOTE never compare two storage devices in terms of storage capacity. For example give a difference
between HDD and SSD.
HDD has larger storage capacity than SSD. X Never such answer. You will get Zero Mark
Drawback of SSD
1. It has a shorter longevity than HDD.
2. SSD endurance is lower than HDD. This is why they are not used in servers where a huge
number of write operations take place every day.