Al 2024 Eng Full
Al 2024 Eng Full
Instructions:
⁕ Answer all the questions.
⁕ Write your Index Number in the space provided in the answer sheet.
⁕ Instructions are also given on the back of the answer sheet. Follow those carefully.
⁕ In each of the questions 1 to 50, pick one of the alternatives from (1), (2), (3), (4), (5) which is correct or
most appropriate and mark your response on the answer sheet with a cross (x) in accordance with the
instructions given on the back of the answer sheet.
⁕ Use of calculators is not allowed.
5. The figure below shows some components and connections on a computer motherboard.
Power supply
Y B Battery
A
Connector
X Connector
Fan
C Z D E
6. A person notes that a desktop computer was booting very fast from the hard disk after the
computer was repaired. Which of the following would have been done during the repair?
(1) decreasing RAM and reinstalling the operating system
(2) formatting the hard disk only
(3) installing a new CD drive only
(4) replacing the small fan inside the computer only
(5) replacing the hard disk with a Solid-state Drive (SSD) and reinstalling the operating system
10. The second and third rows of the following table contain two English words and their binary
representations according to the ASCII code. The binary representation of No! is kept blank.
Word Binary representation
no 1101110 1101111
N! 1001110 0100001
No!
What is the correct replacement for the blank?
(1) 0100001 1001110 1101111
(2) 1001110 0100001 1101111
(3) 1001110 1101111 0100001
(4) 1101110 0100001 1101111
(5) 1101110 1101111 0100001
11. 110012 + 100012 =
(1) 1010102 (2) 1010112 (3) 1011002 (4) 1110012 (5) 1110102
cc
12. Which of the following express the output (F) of the given circuit?
X
F
Y Z
(1) (𝑋 + ̅
𝑌)𝑍 (2) ̅̅̅̅̅̅̅̅̅̅
(𝑋 + ̅ 𝑌) + 𝑍 (3) ̅̅̅̅̅̅̅̅̅̅
(𝑋 + ̅ 𝑌)𝑍 (4) 𝑋𝑌̅ + 𝑍 (5) ̅̅̅̅̅̅
(𝑋𝑌̅) + 𝑍
14. What is the most simple Boolean expression that can be obtained through the given Karnaugh
map?
xy
00 01 11 10
0 0 1 1 1
z
1 0 1 1 0
15. Which of the following are correct regarding the Process Control Block (PCB)?
Ae–eIt is a data structure used by the operating system to manage information about a
eeeeeprocess.
Be–eIt is created during the compilation of a program
Ce–eThe Program Counter values of two PCBs can be the same.
(1) A only (2) A and B only (3) A and C only
(4) B and C only (5) All A, B and C
16. Amara switches on a multi-user computer system. After it has booted, Sama logs on to the
computer from a terminal and starts a web browser. After sometime, Sama starts a text editor also
to work on her Python program. Then Rani also logs on to the computer from another terminal
and starts a web browser.
Which of the following are possible execution sequences on the processor of this computer?
(1) BIOS → OS → Sama's web browser process → OS → Sama's text editor process → OS →
eeeeRani's web browser process → OS → Sama's text editor process → ...
(2) BIOS → OS → Sama's web browser process → Sama's text editor process → OS → Rani's
eeeeweb browser process → OS → Sama's web browser process → ...
(3) BIOS → Sama's web browser process → Sama's text editor process → OS → Rani's web
eeeebrowser process → OS → Sama's text editor process → ...
(4) OS → BIOS → Sama's web browser process → OS → Sama's text editor process → OS
eeee→ Rani's web browser process → OS → Sama's web browser process → ...
(5) OS → BIOS → Sama's web browser process → Sama's text editor process → OS → Rani's
eeeeweb browser process → OS → Sama's web browser process → ...
17. Each block of a disk is 512 bytes. When a file of size 1959 bytes is stored on that disk, how
many bytes allocated to the file would be wasted?
(1) 89 (2) 423 (3) 512 (4) 601 (5) 1447
cc
18. Which of the given statements (I, II, III) are true with respect to the following two diagrams?
(Note: V – Voltage, t – time)
20. What is done by a modem when it receives an analog signal from a PSTN (Public Switched
Telephone Network) line?
(1) It amplifies the signal for better clarity.
(2) It compresses the signal for storage.
(3) It demodulates the signal back into digital form.
(4) It encrypts the signal for security.
(5) It modulates the signal further for transmission.
[See page five
AL/2024/20/E-I -5- #ictfromabc
25. During the feasibility analysis of a software development project, it was discovered that the
development team does not have the knowledge and the skills to develop the software. Which
component of the feasibility study would have identified this issue?
(1) economic feasibility (2) legal feasibility
(3) operational feasibility (4) schedule feasibility
(5) technical feasibility
26. Which of the following shows the correct order of stages in the System Development Life Cycle?
(1) Feasibility study → Requirements analysis → System design → Implementation → Testing
eeeeeeeeeee
eeee→ Deployment
(2) Feasibility study → System design → Requirements analysis → Implementation → Testing
eeee→ Deployment
(3) Requirements analysis → Feasibility study → System design → Testing → Deployment →
eeeeImplementation
(4) Requirements analysis → System design → Feasibility study → Deployment → Testing →
eeeeImplementation
(5) System design → Requirements analysis → Feasibility study → Implementation → Testing
eeee→ Deployment
27. Which of the following is not true regarding the prototyping technique used in system development?
eeeeeeeeeee
(1) Prototypes need to be approved by the users, during the ‘system testing’ phase.
(2) Prototyping is neither necessary nor appropriate in every project.
(3) Successful prototyping helps to develop a system that better addresses user needs and expectations.
(4) Successful prototyping helps to eliminate costly late changes to a system.
(5) To get the benefits of prototyping, user feedback on the prototypes is extremely important.
28. Which of the following statements regarding software tests are correct?
A – White-box tests involve testing the internal structures and workings of a software.
B – Unit tests are usually performed after the system test.
C – System developers should take every effort to make the acceptance test successful.
(1) A only (2) A and B only (3) A and C only
(4) B and C only (5) All A, B and C
29. Which of the following contains the suitable replacements for the above blanks?
(1) A – DISPLAY existing bookings B – GET date/time C – GET NIC number D – Complete
eeEeuser's credit/debit card payment
(2) A – DISPLAY existing bookings B – GET date/time C – Complete user's credit/debit card
eeEepayment D – GET NIC number
(3) A – DISPLAY existing bookings B – GET NIC number C – Complete user's credit/debit card
eeEepayment D – GET date/time
(4) A – GET date/time B – DISPLAY existing bookings C – GET NIC number D – Complete
eeEeuser's credit/debit card payment
(5) A – GET NIC number B – DISPLAY existing bookings C – GET date/time D – Complete
eeEeuser's credit/debit card payment
30. Which of the following suggestions about the above system is not suitable?
(1) The list of reservations for a given date should be provided when needed.
(2) Each time a student is making a reservation he/she should be required to enter his/her home
eeeeaddress.
(3) It is suitable to check the validity of the NIC number.
(4) Reservations should not clash with school times.
(5)eFor fairness, the number of reservations that a particular NIC number is allowed per day
eeeeshould be limited.
31. Consider the following relation about a student who is registered in a programme at an institute:
STUDENT(Sno, Snic, Sname, Sphone, Prog_number)
Note: Sno - the unique registration number of the student
Snic - the national identity card number of the student
Sname - the name of the student
Sphone - a phone number of the student
Prog_number - the unique number of the programme for which the student has registered
Which of the following are correct?
A – Sno can be the primary key.
B – Snic can be a candidate key.
C – Prog_number can be a foreign key.
(1) A only (2) A and B only (3) A and C only
(4) B and C only (5) All A, B and C
34. Match the Normal forms labelled from 0 to 3 to the corresponding Descriptions labelled from
A to D.
Normal form Description
0 – Zero normal form A. single valued attributes
1 – First normal form B. full functional dependency
2 – Second normal form C. repeating data
3 – Third normal form D. transitive dependency
(1) 0 – A, 1 – B, 2 – C, 3–D
(2) 0 – A, 1 – C, 2 – B, 3–D
(3) 0 – B, 1 – C, 2 – A, 3–D
(4) 0 – C, 1 – A, 2 – D, 3–B
(5) 0 – D, 1 – B, 2 – C, 3–A
36. Which of the following will change all occurrences of ‘Mahawa’ in the ‘City’ attribute of USER
in relation to ‘Maho’?
(1) MODIFY USER SET City = 'Maho' WHERE City = 'Mahawa';
(2) MODIFY USER SET City = 'Mahawa' INTO City = 'Maho';
(3) UPDATE USER SET City = 'Mahawa' INTO City = 'Maho';
(4) UPDATE USER SET City = 'Maho' WHERE City = 'Mahawa';
(5) UPDATE USER SET City = 'Maho' WHERE City != 'Mahawa';
37. Which of the following lists the given SQL statement clauses in the correct order?
(1) SELECT, FROM, WHERE, GROUP BY, HAVING
(2) SELECT, GROUP BY, HAVING, FROM, WHERE
(3) SELECT, HAVING, FROM, WHERE, GROUP BY
(4) SELECT, WHERE, GROUP BY, HAVING, FROM
(5) SELECT, WHERE, HAVING, GROUP BY, FROM
38. What would be the execution output of the following Python code if a = 5, b = 3, c = 2 and
d = 6?
x = (a - b) ** c + d % c
print(x)
(1) –22 (2) 0 (3) 1 (4) 4 (5) 7
cc
39. What is the execution output of the following Python code?
qns = ["a" , "b"]
for x in range (1,3):
for y in qns:
print(x,y, end=' ')
(1) 0 a 2 b (2) 1 a 3 b (3) 1 a 1 b 2 a 2 b
(4) 1 a 1 b 3 a 3 b (5) 1 a 3 a 1 b 3 b
i = –1
while i < (len(marks) - 1):
i += 1
if marks[i][2] < 50:
continue
print(marks[i][1], end=" ")
(1) 1 4 (2) 1 amara 4 fahim (3) amara fahim
(4) rajah (5) rajah rani
[See page nine
AL/2024/20/E-I -9- #ictfromabc
42. The output shown in Figure 42.2 can be obtained using exports_imports.txt shown in Figure
42.1 by executing the Python code shown in Figure 42.3 with suitable replacements for its blanks
labelled P – U.
43. Which of the following statements are true about the web pages created using web authoring tools?
eeeeee
A – The HTML Code for such a page is automatically generated.
B – Such a page can be enhanced by manually adding HTML tags later.
C – Multimedia content cannot be added to them.
(1) A only (2) A and B only (3) A and C only
(4) B and C only (5) All A, B and C
45. Which of the following can be used to change the look of an entire website by changing just
one file?
A – external CSS B – inline CSS C – internal CSS
(1) A only (2) A and B only (3) A and C only
(4) B and C only (5) All A, B and C
46. For what purpose is POST used in an HTML form?
(1) to display a confirmation message after form submission
(2) to display form data on the screen
(3) to refresh the web page
(4) to retrieve data from the server
(5) to send form data to the server
47. Which of the following statements are correct regarding website publishing?
A – One has to obtain a domain name to publish a website.
B – Before deciding to host a website on one’s own computer, one has to do a good
eeeeecost-benefit analysis on the same.
C – Shared hosting will provide faster access to the site’s users all the time compared to
eeeeeeither Virtual Private Server (VPS) hosting or dedicated server hosting.
(1) A only (2) A and B only (3) A and C only
(4) B and C only (5) All A, B and C
⁕⁕⁕
AL/2024/20/E-II #ictfromabc
ishÆ u ysñlï weúßKs / முழுப் பதிப்புரிகமயுகடயது / All Rights Reserved ]
YS% ,xld úNd. fomd¾;fïka;=j YS% ,xld úNd. fomd¾;fïka;=j YS% ,xld úNd. fomd¾;fïka;=j YS% ,xld úNd. fomd¾;fïka;=j YS%S ,xld úNd. fomd¾;fïka;=j
YS% ,xld úNd. fomd¾;fïka;=j
இலங்கைப் பரீடகைத் திகைக்ைளம் இலங்கைப் பரீடகைத் திகைக்ைளம் இலங்கைப் பரீடகைத் திகைக்ைளம் இலங்கைப் பரீடகைத் திகைக்ைளம்
இலங்கைப்
Department of Examinations,Sri Lanka Department of Examinations,Sri பரீடகைத்
Lanka Department திகைக்ைளம்
of Examinations,Sri Lanka Department of Examinations,Sri Lanka Department of Examinations,Sri Lanka
YS% ,xld úNd. fomd¾;fïka;=j YS% ,xld úNd. fomd¾;fïka;=j YS% ,xld úNd. fomd¾;fïka;=j YS% ,xld úNd. fomd¾;fïka;=j YS%S ,xld úNd. fomd¾;fïka;=j
Department of Examinations,Sri Lanka
இலங்கைப் பரீடகைத் திகைக்ைளம் இலங்கைப் பரீடகைத் திகைக்ைளம் இலங்கைப் பரீடகைத் திகைக்ைளம் இலங்கைப் பரீடகைத் திகைக்ைளம்
Use additional reading time to go through the question paper, select the questions you will answer
and decide which of them you will prioritise.
PART B – Essay: 9
(pages 9-16) 10
⁕ This part consists six questions, of which, four Total
are to be answered. Use the papers supplied for
Final Marks
this purpose.
In numbers
⁕ At the end of the time allotted for this paper, tie
the two parts together so that Part A is on top In words
of Part B before handing them over to the Code Number
Supervisor. Marking Examiner 1
⁕ You are permitted to remove only Part B of the Marking Examiner 2
question paper from the Examination Hall.
Marks checked by :
Supervised by :
(i) Fill the seven blanks of Figure 1.2 to make the code
complete.
(04 marks)
Figure 1.1
<html>
<h1>Central Province</h1>
<h2>Public concerns form</h2>
<hr style="width:30%;text-align:left;margin-left:0">
<form method="post" ------------------- ="./action_page.php">
<h3>Concern</h3>
<label for="district">District: </label>
< ------------------- name="district" id="district">
<option value="kandy">Kandy</option>
<option value="matale">Matale</option>
<option value="nuwaraeliya">Nuwara Eliya</option>
< ------------------- ><br><br>
<label for="ctype">Type:</label>
<input type=" ------------------- " name="ctype" id="goods" value="goods">
<label for="goods">Goods</label>
<input type=" ------------------- " name="ctype" id="services" value="services">
<label for="services">Services</label><br><br>
<label for="description">Description:</label>
<input type="text" name="description" size="25"><br><br>
<hr style="width:30%;text-align:left;margin-left:0">
<h3>Complainant details</h3>
<label for="name">Name:</label>
<input type="text" name="name"><br><br>
<label for="email">Email:</label>
<input type="email" name="email">
<label for="phone">Phone:</label>
<input type="tel" id="phone" name="phone" size="10" pattern="[0-9]{10}"
title="Invalid telephone number"required><br><br>
<input type=" ------------------- " value=" ------------------- ">
</form>
<br>
<img src="flag.jpg" alt="Central province flag" width="50" height="40">
<a href="http://www.cpca.lk" title="10, Hill street, Kandy">Central Province Consumer
Affairs</a>
</html>
Figure 1.2
[See page three
AL/2024/20/E-II -3- Index No.: …………………………........
Do not
(ii) What happens when the user presses the 'Submit' button on the form? write
in this
...........................................................................................................................................
column
...........................................................................................................................................
(01 marks)
(iii) What is the benefit of using input type="email" for the email address entry field instead of
input type="text"?
...........................................................................................................................................
...........................................................................................................................................
(01 marks)
(iv) What can you guess about the purpose of pattern="[0-9]{10}" with respect to the Phone entry
field?
...........................................................................................................................................
...........................................................................................................................................
(01 marks)
(v) What is the purpose of the use of title="10, Hill street, Kandy" in the <img src code line?
...........................................................................................................................................
...........................................................................................................................................
(01 marks)
(b) Explain the main purpose of the HTML code extract shown in Figure 1.3.
<?php
$host = "localhost";
$db_user = "student_user";
$db_password = "student_pass";
$db_name = "studentDB";
$conn = mysqli_connect ($host, $db_user, $db_password, $db_name);
if (!$conn) {
die("<tr><td colspan='3'>Connection failed:" .
mysqli_connect_error () . "</td></tr>");
}
$sql = "SELECT student_id, first_name, last_name FROM stu-dents";
$result = mysqli_query ($conn, $sql) ;
if (mysqli_num_rows ($result) > 0) {
while ($row = mysqli_fetch_assoc ($result) ) {
echo "<tr>
<td>" . $row["student_id"] . "</td>
<td>" . $row["first_name"] . "</td>
<td>" . $row["last_name"] . "</td>
</tr>";
}
} else {
echo "<tr><td colspan='3'>No students found .</td></tr>";
}
mysqli_close ($conn);
?>
Figure 1.3
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
(02 marks)
[See page four
AL/2024/20/E-II -4- Index No.: …………………………........
Do not
2.(a)(i) Following diagram shows the abstract model of information creation: write
in this
column
A B C
(ii) Write down the A, B and C components of the above model for each of the following online
activities:
Activity 1:
A : ……………………………………………………………………………………………………
B : ……………………………………………………………………………………………………
C : ……………………………………………………………………………………………………
Activity 2:
A : ……………………………………………………………………………………………………
B : ……………………………………………………………………………………………………
C : ……………………………………………………………………………………………………
Activity 3:
A : ……………………………………………………………………………………………………
B : ……………………………………………………………………………………………………
C : ……………………………………………………………………………………………………
(03 marks)
(iii) At a later date, after successfully logging in to this system to purchase the same items, you decide
to use the 'Repeat Previous Order' option given at the site. Write down any changes to your
answer for Activity 2 of part (ii) above.
Activity 2:
A : ……………………………………………………………………………………………………
B : ……………………………………………………………………………………………………
C : ……………………………………………………………………………………………………
(01 marks)
(c) While Information and Communication Technology (ICT) allows us to create and disseminate
our intellectual ideas in more efficient and impactful ways, it also contributes to a higher level of
plagiarism than in traditional (non-ICT) methods. Briefly explain the reason for this observation.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
(01 marks)
(d) Some argue that the increasing use of Information and Communication Technology as an
indirect contributor to global warming. Briefly explain a major reason for this view.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
(01 marks)
(e) You browse an online product catalogue in an e-commerce website looking for a product
purchase and the website collects your product browsing history without obtaining your consent.
What is the security related concern that you face in this situation?
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
(01 marks)
In a reverse auction, from sellers and buyers, . ……………........ do the bidding and usually the
……………………… bid wins.
(01 marks)
(03 marks)
......................................
(02 marks)
(c) Fill the five blanks ^----------------------& of the following Python code which has been written to
find the prime numbers from 2 upto a given number.
Note: A prime number is any whole number greater than 1 that is divisible only by 1 and itself.
e.g., Prime numbers from 2 up to number 5 are 2, 3 and 5.
(05 marks)
(1) : …………………………………………………………………………………………………
(2) : …………………………………………………………………………………………………
(3) : …………………………………………………………………………………………………
(01 marks)
(c) (i) A guest billing system for a hotel is required. The following information is given by the hotel
client to the system analyst.
The hotel has different types of rooms with different rates. Hotel also has a restaurant and a health center. A
guest can take one or more rooms. Once a guest checks-in to the hotel all his transactions at the restaurant
and the health center should be entered to the system. When the guest checks-out by giving his name, his final
bill should be made considering his period of stay, rooms occupied and his transactions at the restaurant and
the health center. When the guest is given the final bill, he makes the payment for which a receipt is given.
Draw the data flow diagram for the check-out process in the above description containing only
the following entity and processes and including the necessary data stores and data flows.
Entity : Guest
Process : 1' Prepare cost of rooms
: 2' Make final bill
: 3' Accept guest payment
(03 marks)
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
(02 marks)
Pilot deployment is a/an ……………………….. scale implementation that is used to prove the
validity of a project idea.
(f) A shop manager needs a stock control system. There are three options. He can either select and
buy one from two off-the-shelf stock control systems (named A and B) or he can develop his own
stock control system (named C).
The manager wants the final stock control system to contain two important features
(named Fl and F2).
Suggest a method that the manager can use to choose one from A, B and C. (Hint: Give marks to
each option.)
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
(01 marks)
**
Part B
⁕ Answer any four questions only.
5. (a) Draw the complete truth table for the following circuit:
A B C
(02 marks)
(b) Write down the following Boolean expression in the simplest form.
aa (𝐴 + 𝐵) ⋅ (𝐴 + 𝐵̅) + 𝐴𝐵̅ (01 mark)
(c) In a circuit with three inputs A, B and C the output (Z) should be 1 when each of two or
three inputs is 1. If none or only one of the inputs are 1, then the output should be 0.
(i) Draw the complete truth table for the above circuit. (02 marks)
(ii) Complete the Karnaugh map relevant to the above circuit according to the following format:
AB
00 01 11 10
0
C
1
(02 marks)
(iii) Using the Karnaugh map, derive the most simplified sum-of-product (SOP) expression for
the output Z. Show the loop clearly on the Karnaugh map. (02 marks)
(iv) Draw a logic circuit for the most simplified expression derived in above (iii) by only using
AND, NOT and OR gates. (01 mark)
(d) (i) Explain the use of half adder in digital circuits. (01 mark)
(ii) Describe how a flip flop works as a memory element in digital circuits. Explain how it
differs from combinational logic gates. (02 marks)
(iii) Draw the truth table for a full adder circuit. (02 marks)
6. (a)aaDraw a sketch to show how a computer and a printer should be connected in a point-to-point
eeeeeeetopology using a twisted pair Ethernet cable. (01 mark)
(b) Consider a network consisting of two separate local area networks (LANs) of two departments
A and B. Each department's LAN has four computers (named C1 to C4 in A, and C5 to C8
in B respectively). In addition, a common server (SVR) for the use of these two departments
is also included.
(ii) Draw the diagram of this network. Clearly indicate on it the network devices that are
used to establish the two local area networks and to connect the entire network to the
Internet. (01 mark)
(iii) Give the reasons for the placement of these devices in their respective locations. (01 mark)
(iv) Suppose a unit of data is being sent from C1 to C6. Indicate that data flow in the above
network diagram using dotted lines. (01 mark)
(c) Suppose an organization is assigned the 192.168.100.0/24 IP address block. Assume that the
organization needs to create six subnets, namely S1, S2, S3, S4, S5 and S6 from this address
block with each subnet having at least 25 usable IP addresses.
(i) Write the subnet mask of the above given IP address block in dotted decimal notation. (01 mark)
(ii) For each subnet, list the network address, first usable IP address, last usable IP address
and the broadcast address in a table. (03 marks)
(d) (i) What is the role of the Domain Name System (DNS) when the user enters a web address
eeeee(e.g., http://www.gmail.com) into the URL field of a web browser? (01 mark)
(ii) What is meant by the ‘hierarchical and distributed structure’ of the DNS? (02 marks)
(e) Write down the name of the TCP/IP model layer responsible for each of the following tasks:
(i) maintaining a smooth connection between the application and the user
(ii) sending and receiving data in binary form
(iii) specifying the path that the data packets will use for transmission
(iv) dividing data into packets (02 marks)
(f) Suppose Kamal wants to send the secret message ADD to Nimal. Kamal converts ADD to CEE
before sending it to Nimal.
(i) Write down the encryption key used by Kamal in this communication. (01 mark)
(ii) If Nimal receives ECD from Kamal in a separate communication using the same security
scheme, what is the original message from Kamal? (01 mark)
7. (a) Figure 7.1 shows the Arduino circuit that Saman implemented to detect a door opening.
Figure 7.1
(i) Explain the behaviour and operation of the sensor used in this circuit. (02 marks)
(ii) To operate this setup Saman wrote the firmware code shown in Figure 7.2. However, the
setup failed to operate as expected due to defects in the code. Write down the corrections
that you would do to the code. (02 marks)
const int SensorP = 9;
const int BuzzerP = 8;
void setup() {
pinMode (SensorP, INPUT);
pinMode (BuzzerP, OUTPUT);
}
void loop() {
int senState = digitalRead(SensorP);
if (senState == HIGH)
tone(SensorP,262);
else
noTone(BuzzerP,0);
}
Figure 7.2
(iii) Saman hopes to extend this circuit to indicate the door openings only at night time. What
does he need to modify in this circuit to add that feature? If any item(s) must be connected
to the ATmega328P, indicate the relevant pin(s). (02 marks)
(b) SuperMobile is an online mobile phone shop where customers can purchase mobile phones
through its e-Commerce site. SuperMobile uses the third-party courier service DeliverToday as its
delivery partner. The customers who purchase mobile phones from SuperMobile become members
of the loyalty program. They can upload their reviews, feedback, and creative content related
to their mobile phone usage to the online site and receive beneficial loyalty points in return.
(i) Write down the e-Business transaction types that are possible with SuperMobile. (01 mark)
(ii) SuperMobile owners speculate that establishing their own delivery team for customer
deliveries can be cost-effective and more profitable than using the DeliverToday service.
Analyse this speculation by giving one reason each for and against this view.
(Note: Consider the financial aspects only.) (02 marks)
(iii) Mobile phones are not perishable and thus don’t indicate expiry dates. However, they
often have a finite shelf life beyond which the customers are reluctant to purchase them.
Give a reason for this observation. (01 mark)
(iv) Suggest a suitable business strategy that SuperMobile can use both to reduce the environmental
damage due to e-waste and also to increase its sales. (02 marks)
[see page twelve
AL/2024/20/E-II -12- #ictfromabc
(c) Consider a multi-agent system where agents (mobile robots) are designed to collaborate in a
warehouse package moving task.
Each package is to be moved from its storage point (A) to its assigned delivery point (B)
across the warehouse floor area. Each agent is tasked with moving the assigned goods from
point A to point B in an optimum manner. Each agent has its own utility function that helps
the agent to make optimum decisions based on the given set of parameters.
(i) Highlighting the key characteristics, write down how the concept of ‘agents’ in this
multi-agent system differs from a standard software program. (01 mark)
(ii) Write down one positive (reward) and one negative (punishment) factor that could be
considered in the utility function definitions of the agents (robots). (02 marks)
8. (a) Write the output of the Python code given in Figure 8.1.
def calculate(n):
result = 0
for i in range(1, n+1):
for j in range(i):
result += i * j
return result
print(calculate(4))
Figure 8.1 (02 marks)
(b) Figure 8.2 contains a labeled Python code to print the binary equivalent of an input decimal
whole number. Write down the suitable replacements for the labels P–U to complete the code.
while n >= 1:
reversed_binary = reversed_binary + R (S)
n=T
binary = U [::-1]
print(binary)
Figure 8.2
(03 marks)
(c) There is a limit imposed on the maximum weight of an airline passenger's bag. Thus when
a person is flying, s/he should select the items which are most important for him/her for the
trip.
From three items, a labeled Python code written to help a person decide on the ‘highest value’
items that s/he should choose for a bag, is shown in Figure 8.3. The total weight of the bag
should be within the airline's capacity limit for a bag which is 50 Kg. The weights, values
and the names of the three items are in the relevant arrays. The output of the code is given
in Figure 8.4.
# Input:
bag_capacity = 50
weights = [49, 10, 35]
values = [60, 100, 120]
names = ["Laptop", "Book", "Clothes"]
Merged: [(60, 49, 'Laptop', 0), (100, 10, 'Book', 1), (120, 35, 'Clothes', 2)]
Sorted records: [(120, 35, 'Clothes', 2), (100, 10, 'Book', 1), (60, 49, 'Laptop', 0)]
Selected items: Clothes Book
Figure 8.4
(i) Write down the suitable replacements for the nine labels (A–I) in the Python code given
in Figure 8.3.
Notes:
• The Python sort() method could be used to sort a list.
Syntax : list.sort(reverse=True|False, key=myFunc)
• When ‘reverse=True’, the list is sorted into descending order.
• How the sorting is to be done could be indicated through the ‘key’.
e.g., ‘key=lambda x: x[0]’ in the above code indicates that the sorting is to be done
based on the numbers in the ‘values’ array. (09 marks)
(ii) Describe the changes that should be done to the code to increase the number of items
from three to five. (01 mark)
9. (a) Consider the following description relevant to a database that is to be developed for a fuel
eeeeeeestation to manage the details of customer transactions:
• Each customer [Customer] has a unique identifier [Cid], a name [Cname] (consisting of
a first name [Cfname] and a surname [Csname]) and a phone number [Cphone]. Each
customer may have multiple phone numbers. Each customer owns [owns] one or more
vehicles.
• Each vehicle [Vehicle] has a unique vehicle number [Vno] and a model [Vmodel]. Each
vehicle is owned by only one customer.
• The fuel station sells several petrol types [Petrol]. Each petrol type has a unique identifier [Pid]
and a price per liter [Pprice].
• Different petrol types can be purchased for a vehicle [purchases], and each petrol type
may be purchased for multiple vehicles.
• Each petrol purchase is recorded with a vehicle number [Vno], a petrol type identifier
[Pid], the quantity of petrol sold [Sqty] and the date of sale [Sdate].
• Each employee [Employee] has a unique number [Eno], a name [Ename], a position
[Eposition] and a type [Etype] (which could be either full-time or part-time). An employee
may sell [sells] multiple petrol types. Each petrol type can be sold by many employees.
(i) Draw an ER Diagram for this application showing the entities, attributes and relationships.
Underline the key attributes. Note: Use only the terms given within square brackets in the
above description for the entities, attributes and relationships. Use upper case letters for
entities and relationships. (04 marks)
(ii) Write the relational schema for the ER diagram.
Note: List only the tables with their attribute names. Underline the primary keys. Draw an
arrow from each foreign key to the table it references with the arrow head pointing to
the primary key of the referenced table. (04 marks)
(b) Consider the following Result table containing the details about students, their subjects, the
teachers of those subjects, the exam dates and the marks.
(i) In which normal form does the Result table exist? Justify your answer. (02 marks)
(ii) Describe how you would convert the Result table to its next normal form. (02 marks)
(d) A computer uses 16-bit virtual addresses. This computer has a 32 KB physical memory and a
4 KB page size. (01 mark)
(i) Write down the number of frames in physical memory.
(ii) A user runs a program having a size of 64 KB on this computer. A few selected fields
of the first few rows of the page table of that process at a particular time are shown in
the figure.
Notes:
Frame Validity
0 111 1 • The page number is used as the index into the
1 page table.
100 1
2 110 1 • The frame number is indicated in binary. Validity
3 bit being 1 indicates that the relevant page is in
101 1
physical memory.
4 000 0
5 000 0
6 000 0
Assume that in the above process the virtual address 0010 0000 0000 0100 is wanted.
Write down the 15-bit physical address that the above address would get mapped to.
(01 mark)
(iii) Assume that in the above process given in (ii), the virtual address 0100 0000 0000 0001
is wanted. Write down one reason why the operating system won’t decide frame 011
of memory as the frame for that page. (01 mark)
(iv) In addition to the above fields of the page table, a Modified bit may also exist. It will
be set to 1 when data in a page is changed. Why is that information important for the
operating system? (01 mark)
(e) (i) The data of the average.py file is stored in blocks 100, 125, 150 and 175 on a disk that
eeeeeuses an indexed allocation scheme. In this allocation scheme, what important information
eeeeeis needed by the operating system to find the blocks of this file? (01 mark)
(ii) When contiguous allocation is compared with indexed allocation, which one can cause the
external fragmentation of a disk? (01 mark)
⁕⁕⁕