marking guide for computer science evaluation paper ii...

8
Page 1 of 8 Marking guide for COMPUTER SCIENCE EVALUATION PAPER II FOR S6MCE 2020 /120 marks SECTION A: ATTEMPT ALL QUESTIONS (50 MARKS) 1. Explain the following terms: 5 Marks a. Artificial intelligence is ability of a computer to mimic a human being behavior. (1 mark) b. Pointer is a variable that stores/points the address of another variable. (1 mark) c. Microprocessor is the brain of a computer (1 mark) d. DHCP is short for Dynamic Host Configuration Protocol. Its main task is to automatically assign an IP address to devices across the network. It first checks for the next available address not yet taken by any device, then assigns this to a network device. (1 mark) e. Firewire is external port, similar to a USB port, that provides a high data transmission rate (1 mark) 2. Categorize followings device according to their transmission modes. /2 marks a. Radio: simplex b. WalkieTalkie: half- duplex c. Phone: Full duplex d. Computer: Full duplex 3. Distinguish Bandwidth to latency /2 marks Bandwidth is the amount of data that can be transmitted in a fixed amount of time. Latency is the time between requesting data and receiving data. 4. Which of the following are layers in the TCP/IP model? /1 mark a) Application b) Session c) Transport d) Intranet e) Data Link f) Physical 5. Name the following parts of a computer /3 Marks 1) AC power port 2) Ethernet port 3) VGA port 4) Ventilation 5) HDMI port 6) USB ports 6. State two reasons that make use powder-based fire extinguishers in computer lab is unsuitable. /2 Marks a) Powder may increase friction between mechanical parts. (1 mark) b) Powder may weaken or damage some materials in computer lab. (1 mark) 7. Differentiate the following terms /4 marks a. System software and application software.

Upload: others

Post on 12-Jun-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Marking guide for COMPUTER SCIENCE EVALUATION PAPER II …ifakdonbosco.org/wp-content/uploads/2020/04/MARKING-SCHEME-F… · Marking guide for COMPUTER SCIENCE EVALUATION PAPER II

Page 1 of 8

Marking guide for COMPUTER SCIENCE EVALUATION PAPER II FOR S6MCE 2020 /120 marks

SECTION A: ATTEMPT ALL QUESTIONS (50 MARKS)

1. Explain the following terms: 5 Marks

a. Artificial intelligence is ability of a computer to mimic a human being behavior. (1 mark)

b. Pointer is a variable that stores/points the address of another variable. (1 mark) c. Microprocessor is the brain of a computer (1 mark)

d. DHCP is short for Dynamic Host Configuration Protocol. Its main task is to automatically assign an IP address to devices across the network. It first checks for the next available address not yet taken by any device, then assigns this to a network device. (1 mark)

e. Firewire is external port, similar to a USB port, that provides a high data transmission rate (1 mark)

2. Categorize followings device according to their transmission modes. /2 marks

a. Radio: simplex

b. Walkie–Talkie: half- duplex

c. Phone: Full duplex

d. Computer: Full duplex

3. Distinguish Bandwidth to latency /2 marks

Bandwidth is the amount of data that can be transmitted in a fixed amount of time.

Latency is the time between requesting data and receiving data.

4. Which of the following are layers in the TCP/IP model? /1 mark

a) Application

b) Session

c) Transport

d) Intranet

e) Data Link

f) Physical

5. Name the following parts of a computer /3 Marks

1) AC power port

2) Ethernet port

3) VGA port

4) Ventilation

5) HDMI port

6) USB ports

6. State two reasons that make use powder-based fire extinguishers in computer lab is unsuitable. /2 Marks

a) Powder may increase friction between mechanical parts. (1 mark)

b) Powder may weaken or damage some materials in computer lab. (1 mark)

7. Differentiate the following terms /4 marks

a. System software and application software.

Page 2: Marking guide for COMPUTER SCIENCE EVALUATION PAPER II …ifakdonbosco.org/wp-content/uploads/2020/04/MARKING-SCHEME-F… · Marking guide for COMPUTER SCIENCE EVALUATION PAPER II

Page 2 of 8

System software is software that makes possible the system to run and perform useful work to the user while

applications software are programs that work with operating system to help the users to do specific types of

tasks or works.

b. Physical threat to logical threat. / 2 marks

Physical threats are digital storage media and hardware that can damage or destroy the computer system while

logical threats are events or attacks that remove, corrupt, deny access, or steal information.

c. computer to computer science

Computer is an electronic device capable of receiving raw facts (data) and performing a sequence of

operations on the data based on special computer instructions (processing) to produce desired output

(information) while Computer science is a branch of science that deals with theory of computation, or design

and operation of computer hardware and software and the application of computers in all sectors.

8. Evaluate the following: 5 marks a. Subtract (11110.1101)2 from (111111.1111)2 (1 mark)

𝟏𝟏𝟏𝟏𝟏𝟏.𝟏𝟏𝟏𝟏−𝟏𝟏𝟏𝟏𝟎.𝟏𝟏𝟎𝟏

𝟏𝟎𝟎𝟎𝟎𝟏.𝟎𝟎𝟏𝟎

b. Find binary equivalent of (251.35)10=(?)2 1 (2marks)

256 128 64 32 16 8 4 2 1

1 1 1 1 1 0 1 1

0.35×2=0.7→0 0.7×2=1.4→1 0.4×2=0.8→0 0.8×2=1.6 →1 0.5

(251.35)10=(11111011.0101)2 0.5

c. Find decimal equivalent of (14AC)16=(?)10. (2marks)

(1× 163)+(4×162)+(10×161)+(12×160)= 4096+1024+160+12=5292 1

(14AC)16=(5292)10

9. Observe the following C++ program carefully and show the output /5 Marks

int main() {

int A=2;

int B,C,D,num,X,Y;

cout<<"Enter this number : 45"<<endl;

cin>>B;

D=A+B;

cout<<" The value of d is"<<D<<endl;

X=A+3;

Y=(B/5==A)?20:30;

cout<<"The value of Y is" <<Y <<endl;

num=Y+X;

cout <<" The value of num is"<<num;

return 0;}

output:

Page 3: Marking guide for COMPUTER SCIENCE EVALUATION PAPER II …ifakdonbosco.org/wp-content/uploads/2020/04/MARKING-SCHEME-F… · Marking guide for COMPUTER SCIENCE EVALUATION PAPER II

Page 3 of 8

Enter this number : 45

45

The value of d is 47

The value of Y is 30

The value of num is 35

10. Describe the following terms : data dependence and data independence /2marks

Data dependence: data access changes when data storage characteristics change

Data independence: data storage characteristics do not affect data access

11. Explain why Switch is much preferred than a HUB /2 marks

Answer: A switch is effectively a higher-performance alternative to a hub. For a network with more

computers switch is preferable because it’s built in MAC table. Technically speaking, hubs operate using

a broadcast model where message is received on one port is generated and send to all ports of the hub and

switches operate using a virtual circuit where received on one port is directly sent to its destination.

Therefore, switch is much intelligent that a hub.

12. Define the following data structures and explain their operations. /5 Marks

a. Queue

A queue is a linear list in which data can only be inserted at one end, called the REAR, and deleted from the

other end, called the FRONT. These restrictions ensure that the data mis processed through the queue in the

order in which it is received. In an other words, a queue is a first in, first out (FIFO) structure.

There are two main operations related to queues.

– Enqueue: the enqueue operation insert an items at the rear of the queue

– Dequeue: the dequeue operation deletes the item at the front of the queue

b. Stack

A stack is a restricted linear list in which all additions and deletions are made at one end, the top.

If we insert a series of data items into a stack and then remove them, the order of the data is reversed. Data

input as 5, 10, 15, 20, for example would be removed as 20, 15, 10, and 5. This reversing attribute is why

Stacks are known as Last in, First out (LIFO) data structures.

Operations performed on stacks

• Push: adds an element to the stack

• Pop: removes an element from the stack

• Peek: looks at the top element of the stack

13. How can you identify the IP class of a given IP address? /2 marks

Answer:

By looking at the first octet of any given IP address, you can identify whether it’s Class A, B or C. If the first

octet begins with a 0 bit, that address is Class A. If it begins with bits 10 then that address is a Class B address.

If it begins with 110, then it’s a Class C network.

14. What is the difference between DBMS and RDBMS? /4marks

No DBMS RDBMS

1 DMNS application store data as file RDBMS applications store data in a tabular form

Page 4: Marking guide for COMPUTER SCIENCE EVALUATION PAPER II …ifakdonbosco.org/wp-content/uploads/2020/04/MARKING-SCHEME-F… · Marking guide for COMPUTER SCIENCE EVALUATION PAPER II

Page 4 of 8

2 In DBMS, data generally stored in either a

hierarchical form or a navigation form

In RDBMS , the tables have an identifier called primary

key and the data values are stored in the form of tables

3 Normalization is not present in DBMS Normalization is present RDBMS

4 DBMS doesn’t apply any security with

regards to data manipulation

RDBMS defines the integrity constraint for the purpose

of ACID (Atomocity, Consistency, Isolation and

Durability) property

5 DBMS uses file system to store data, so that

there will be no relation between the tables.

In RDBMS, data values are stored in the form of tables,

so a relationship between these data values will be

stored in the form of table as well

6 DBMS doesn’t support distributed database RDBMS supports distributed database

7 DBMS is meant to be for small organization

and deal with small data. It supports single

user

RDBMS is designed to handle large amount of data.

It supports multiple users

8 Examples of DBMS are file systems, xml etc. Examples of RDBMS are mysql, postgre, sql server,

oracle etc.

15. What the following controls prefix stand for? Chk, fil,cbo,frm,txt. /2 Marks

Chk: Check box

Fil: File list box

Cbo: combo box

Frm: form

16. What is computer security? Give the advantages of computer security to computer system / 3 marks

Answer: Computer security refers to techniques developed to safeguard information and systems stored on

computers.

The protection of data (information security) is important. It reduces the probability of hardware and software

problems and it increases the security of data stored in computers

17. State and explain four characteristics of a computer. (4 marks)

a) Diligence: computer is free from tiredness, lack of concentration after working for long hours; fatigue.

b) Accuracy: the output obtained from a computer mainly depends on input provided.

c) Speed: computer can perform in a few seconds the amount of work a human being can do in days, months

or days.

d) Versatile: it means the capacity to perform completely different type of works.

e) Memory: Any information can be stored and recalled as long as the user requires it, for any period of time.

f) No IQ: computer is a dumb machine and it cannot do any work without instructions from the user, it means

a computer cannot take its own decision as you can.

g) No feeling: it does not have feelings or emotions, taste, knowledge and experience.

SECTION B: ATTEMPT ALL QUESTIONS. (70 MARKS)

18. Write

a. A Java program that takes two numbers as input and display their. / 5 Marks

Answer:

import java.util.Scanner;

public class Exercise5 {

Page 5: Marking guide for COMPUTER SCIENCE EVALUATION PAPER II …ifakdonbosco.org/wp-content/uploads/2020/04/MARKING-SCHEME-F… · Marking guide for COMPUTER SCIENCE EVALUATION PAPER II

Page 5 of 8

public static void main(String[] args) {

Scanner in = new Scanner(System.in);

System.out.print("Input first number: ");

int num1 = in.nextInt();

System.out.print("Input second number: ");

int num2 = in.nextInt();

System.out.println(num1 + " x " + num2 + " = " + num1 * num2); } }

b. A C++ program to print the following patterns using for loop. / 5 Marks

0

0 5

0 5 10

0 5 10 15

0 5 10 15 20

19. List and explain 5 basic concepts of Object oriented programming. (15 marks)

ANS:

1. OBJECTS: are basic runtime entities in an object oriented systems. They may represent a person, a place,

a table of data or any item that the program must handle. Object contain data and code to manipulate the

data. Or

OBJECT: is an instance of a class (element).

2. CLASS: class is a way to bind the data and its associated functions together. A class allows its data to be

hidden from its external use.

Or

CLASS: is a collection of object which have the same data type.

3. DATA ENCAPSULATION: is the wrapping up of data and functions into a single unit.

4. INHERITNCE: is the process by which objects of one class acquire properties of objects of another class.

5. POLYMORPHISM: polymorphism means ability to take more than one form.

6. ABSTRACTION: abstraction refers to showing only the essential features of the application and hiding

the details.

In C++, classes provide methods to the outside world to access and use the data variables but the

variables are hidden from direct access.

7. Exception handling is a feature of OOP, to handle unresolved exceptions or errors produced at runtime.

20. Swapping means exchanging the values of one variable with another variable. Write a C++ program that

swaps two numbers and display the values of those numbers before and after swap.

(10 marks)

#include<iostream>

Page 6: Marking guide for COMPUTER SCIENCE EVALUATION PAPER II …ifakdonbosco.org/wp-content/uploads/2020/04/MARKING-SCHEME-F… · Marking guide for COMPUTER SCIENCE EVALUATION PAPER II

Page 6 of 8

using namespace std;

int main(){

float Num1, Num2, Num;

cout<<”Enter two numbers:”<<endl;

cin>>Num1>>Num2;

cout<<”Numbers before swap: First number=”<<Num1<< ”= Second number= ”<<Num2<<endl;

Num=Num1;

Num1=Num2;

Num2=Num;

cout<<”Numbers after swap: First number=”<<Num1<< ”= Second number= ”<<Num2<<endl;

return 0;}

21. a) What is an array? (2marks)

An array is set of data stored under a single name which have same datatype

b) As a programmer how can you access the element of array? (2marks)

Elements of array are accessed by specifying name and the index of needed element

c) Write a pseudocode to read and display the elements of array of size 30. (6marks)

BEGIN 05 Var Index, Scores (30) as integer 05

FOR Index=0 To 29 Do 1

READ Scores (Index) 05

Index=Index+1 05

END FOR 05

FOR Index=0 To 29 Do 05

WRITE Scores (Index) 05

Index=Index+1 05

END FOR 05

END 05

22. The database below is composed of two tables. Use it to answer asked questions Table 1: Borrowers

BORROWERS BorrowerId BorrowerName DOB 112018 KAMANA 12/12/1989 122018 KAMANA 12/12/1989 132018 KAMIHANDA 12/01/1996

Table 2: Books

BOOKS BookId BookTitle BorrowerId 10 Computer Science for Rwandan Schools Senior 4 112018 12 Data communications and Networking 112018 13 Fundamentals of Mathematics 122018 14 Production Economics: The Basic Theory of

Production Optimisation 132018

15 Encyclopedia of Mathematics 122018 i. What is primary key for each table and give reasons. ii. Identify the foreign key in the BOOKS table.

Page 7: Marking guide for COMPUTER SCIENCE EVALUATION PAPER II …ifakdonbosco.org/wp-content/uploads/2020/04/MARKING-SCHEME-F… · Marking guide for COMPUTER SCIENCE EVALUATION PAPER II

Page 7 of 8

iii. Identify the candidate keys in both tables. iv. Identify the relationship between BORROWERS and BOOKS tables and draw the E-R model. v. Does the BOOKS table exhibit referential integrity? Why or why not?

Answers i. Borrowerid, BookId are unique and stable (2 marks) ii. BorrowerId (1 mark) iii. BORROWERS candidate keys are: BookId,BookTitle BOOKS candidate keys are: BorrowerId, BorroweName-Assume that there is no borrowers having same name (2 marks ) iv. Relationship between BORROWERS and BOOKS is borrows. (1 marks)

ER Diagram (3 marks)

vi. Yes, table BOOKS exhibits referential integrity. Because BorrowerId appears in BOOKS entity is

foreign key from reference table BORROWERS. (1 mark) SECTION C: ATTEMPT ANY ONE QUESTION. (15 MARKS)

23. The government of Rwanda is helping students wishing transfer from SCHOOL A to SCHOOL B. The students must send their request to REB website using the form below. Write HTML code that display this form. (15 marks)

Page 8: Marking guide for COMPUTER SCIENCE EVALUATION PAPER II …ifakdonbosco.org/wp-content/uploads/2020/04/MARKING-SCHEME-F… · Marking guide for COMPUTER SCIENCE EVALUATION PAPER II

Page 8 of 8

<HTML>

<b><caption>BOARDING SCHOOL REQUEST FORM </caption><BR><BR></b>

<form action="uploader.php" method="post">

STUDENT ID:<input type ="text"><br>

FIRST NAME:<input type="text"><br>

LAST NAME:<input type ="text"><br>

AGE: <input type="text"><br>

SEX:

<select><option>&nbsp;</option><option>male</option><option>female</option><br></select><br>

PROVINCE:<input type="text"><br>

DISTRICT:<input type="text"><br>

SECTOR:<input type="text"><br>

MARKS:<input type="text"><br>

SCHOOL A: <input type="text"><br>

SCHOOL B: <input type="text"><br>

CLASS: <select><option>&nbsp;</option><option>s1</option><option>s2</option>

<option>s3</option><option>s4</option><option>s5</option>

<option>s6</option></select><br>

PHOTO:<input name="uploadedfile" type="file"/><br/>

<input type ="submit" value="send"/>

</FORM>

</HTML>

24. Describe each one of the 7 layers of the OSI model. (15 marks)

a. Application: To allow access to network users

b. Presentation: To translate, encrypt and compress data

c. Session: To establish, manage and terminate sessions. For example, once user/password verification is

done, the remote host maintains this session for a while and does not ask for verification again in that time

span.

d. Transport: This layer is responsible for end-to-end delivery between hosts.

e. Network: To move packets from source to destination to provide internetworking.

f. Data link: To organize bits into frames; to provide hop-to-hop delivery

g. Physical: To transmit bits over a medium; to provide mechanical and electrical specifications.