Download as pdf or txt
Download as pdf or txt
You are on page 1of 40

QUESTION ANSWER & MARKS

1. ANSWER /5marks
• Computer security refers to techniques developed to safeguard
information and systems stored on computers.
• Threat refers to anything that has the potential to cause serious harm
to a computer system. A threat is an activity/ attack/ situation that may
happen, with the potential to cause serious damage.
• Define the following terms used in computer security
• A virus is a self-duplicating computer program or piece of code that
• Computer security is loaded onto a computer without the user’s knowledge and runs
• Threat against his/her wishes.

• Virus • Clear text or Plaintext: The original message, before being


transformed, is called plaintext. After the message is transformed, it is
• Cleartext vs ciphertext called ciphertext.

2.ANSWER/4MARKS

Hardware failure is a malfunction within the electronic circuits or


electromechanical components (disks, tapes) of a computer system while
Software failure is the inability of a program to continue processing due to
2. Differentiate between hardware and software failure. erroneous.

3.Types of biometric authentication technologies:/6MARKS

Retina scans produce an image of the blood vessel pattern in the light-
3.Explain types of biometric authentication techniques sensitive surface lining the individual's inner eye.
Iris recognition is used to identify individuals based on unique patterns
within the ring-shaped region surrounding the pupil of the eye.
Finger scanning, the digital version of the ink-and-paper fingerprinting
process, and works with details in the pattern of raised areas and branches in
a human finger image.
Finger vein ID is based on the unique vascular pattern in an individual's
. finger.
Facial recognition systems work with numeric codes called face prints,
process, and works with details in the pattern of raised areas and branches in
a human finger image.
Finger vein ID is based on the unique vascular pattern in an individual's
. finger.
Facial recognition systems work with numeric codes called face prints,
which identify 80 nodal points on a human face.
Voice identification systems rely on characteristics created by the shape of
the speaker's mouth and throat, rather than more variable conditions

4. ANSWER/4MARKS

4. Write steps to add a new user and password. • From your current account, go to Settings > Accounts > Other
People.
• Click Add someone else to this PC.
click I don’t have this person’s sign-in information.
• click Add a user without a Microsoft account.
• Now create that local user account, entering a short descriptive user
name, a password you’ll be able to remember, and a password hint
(which is mandatory).

5. Contrast between logical and physical threats. • ANSWER/4MARKS

Physical threats are digital storage media and hardware that can damage or
destroy the computer system. Example: Humidity, water While logical
threats are events or attacks that remove, corrupt, deny access, or steal
information. Example: viruses and spyware
1.ANSWER: /2MARKS
Ipconfig or IPCONFIG/ALL

2.ANSWER: /5MARKS

• Identifying errors

• Compressing data
• Deciding how data will be sent

• Network protocols enable computers to exchange data with each other


in a meaningful, organized and efficient way.
• provide easy working to users
1. Which command is used to display a physical address of the computer
• Network protocols enable computers to exchange data with each other
in a meaningful, organized and efficient way.
• provide easy working to users
1. Which command is used to display a physical address of the computer
machine?
3.ANSWER/4MARKS

2.List any 5 main functions of the protocols. Advantages:


- Allows the transmission of very large volumes of data over large distances
-it provides high bandwidth

Disadvantages:
-is expensive technology to set up because the network devices require a
special network card
-also required fiber-optic cabling is expensive than twisted -pair cable

4.ANSWER/5MARKS
3. Outline any two advantages and disadvantages of FDDI within a Local
Area Network.

3.ANSWER: /7MARKS
OSI Model layer Description
Responsible for network services to
Application layer 7
user application
Transforms data formats to provides
Presentation layer 6 a standard interface for the
4. Using a figure, identify TCP/IP and OSI network models with their application layer
associated protocols. Establishes, manages and terminates
Session layer 5 the connection between the local
and remote application.
Provides reliable transport and flow
Transport layer 4
control across the network
Responsible for logical addressing
Network layer 3
and domain of routing (router)
Provides physical addressing and
Data link layer 2
media access procedures (Switches)
5.Describe layers provided by OSI Model. Defines all the electrical and
Physical layer 1 physical specifications for devices
(Hub)
5.Describe layers provided by OSI Model. Defines all the electrical and
Physical layer 1 physical specifications for devices
(Hub)

6. ANSWER: /4MARKS
Two basic types of Optical fibers are:
Single mode fiber: is best designed for longer transmission distances,
• Differentiate two types of Optical Fiber. making it suitable for long distance telephony and multichannel television
broadcasting systems.
Multimode fiber: is best designed for use in LAN systems and video
surveillance.

7.ANSWER/2MARKS
7. What are the advantages of protecting your wireless network with a The protection of wireless network with a password helps to prevent
password? unauthorized access or damage such as downloading pirated movies or porn
to computers using that wireless networks.
It also guarantees the proper utilization of available bandwidth.

8. Observe well the figure and answer the following questions above.
8.ANSWER/5MARKS
• Can the above computers (A, B and C) communicate? How and • Can the above computers (A,B and C) communicate? How and
why? / why? /2marks

• In which case the communication may not be possible? Yes, through the central device
• In which case the communication may not be possible? /1marks
• What type of network does the figure above represent?
When the central device is down (not working)
How the Computers A and B are connected? • What type of network does the figure above represent? /1marks

9. Given the following: Wired network / Guided network Bounded network


Network address: 192.168.10.0 • How the Computers A and B are connected? /1marks
Subnet mask: 255.255.255.224(/27)
A sends the message to the central device, and the device directs the
a) what is the class this IP address is belongs
message to B
b) use the subnet mask to find the number of subnets?
c)use the subnet mask to find the number hosts per subnet?

10. Using smartphone write step for sharing network to


laptop.
9.ANSWER: /6MARKS
10. Using smartphone write step for sharing network to
laptop.
9.ANSWER: /6MARKS

a) class C
b) subnets=23=8
c)host /subnet =25-2=30

10.ANSWER: /5MARKS

Step1 Open the Settings app.


Step2 Click on Tethering & portable hotspot then Put it on
Step3 Set up Wi-Fi hotspot
Step4 Configure the Network name and Security.

1.ANSWER: /6MARKS
a. An access point is a device that is attached to a LAN network and
contains a radio transmitter/receiver, encryption facility and
communications software. It translates computer signals into wireless
signals, which it broadcasts to wireless NICs on the network. NICs,
which are equipped for wireless communications receive these signals,
and can transmit back. They have a fixed or detachable radio antenna
in place of the usual coaxial cable. The access point and the NIC
communicate with each other using a 2.4 gigahertz (GHz) radio band.
The access point performs its role in reverse when transferring signals
from a wireless NIC to the conventional network: it translates wireless
signals received from NICs into wired signals.

b. The devices that form part of the network are connected to switches
or hubs. A switch is a device that connects multiple devices on the
same network to facilitate communication among the devices.

c. Another device that forms part of a network is a router. Router acts


as an interface between two networks. It helps to facilitate
1. Explain the purpose of the following devices in a wireless LAN (WLAN). communication between your home network and that of the internet
a) Access point b) Switch c) Router service provider (ISP). It takes the information provided by the modem
and routes it to the various devices that are connected. Devices (such
as computers, televisions, game consoles, digital picture frames) can
be connected to a router in one of two ways – wired directly to the
router or wirelessly.
and routes it to the various devices that are connected. Devices (such
as computers, televisions, game consoles, digital picture frames) can
be connected to a router in one of two ways – wired directly to the
router or wirelessly.

2.ANSWER: /4MARKS
Routers have a built-in console that lets you configure different settings, like
security and data logging. You can assign restrictions to computers, such as
what resources it is allowed access or what particular time of the day, they
can browse the Internet. You can even put restrictions on what websites are
not viewable across the entire network.

3.ANSWER: /5MARKS

STEP1 Press and hold the reset button on the back of your wireless router.
2. How can you manage a network using a router? You have to hold the reset button from 10 to 30 seconds, depending on your
brand of router.
STEP2 Connect a computer to one of your router's Ethernet ports.
STEP3 Enter the IP address of your router's administrative interface in your
browser's address bar.
Most routers have what is called a no routable internal IP address, such as
192.168.1.1 or 10.0.0.1.
STEP4 Enter the default administrator login name and the default
3. Write steps to Reset the Router changing password.
administrator password.
Step5 Change the router's admin password.

4.ANSWER: /7MARKS

Step 1: Cut into the plastic sheath about 1 inch (2.5 cm) from the end of the
4.Write steps to Steps to build an Ethernet cable. cut cable
Step 2: Unwind and pair the similar colors.
Step 3: Pinch the wires between your fingers and straighten them . The color
order is important to get correct.
Step 4: Use scissors to make a straight cut across the 8 wires to shorten them
to 1/2 Inch (1.3 cm) from the cut sleeve to the end of the wires.
Step 5: Carefully push all 8 unstripped colored wires into the connector
Step 6: Crimping the cable carefully place the connector into the Ethernet
Crimper and cinch down on the handles tightly.
Step 7: Make sure to test the cables before installing them.

5.Write the process to Configure static IP address for a computer in window


Step 6: Crimping the cable carefully place the connector into the Ethernet
Crimper and cinch down on the handles tightly.
Step 7: Make sure to test the cables before installing them.

5.Write the process to Configure static IP address for a computer in window


5.ANSWER: /10MARKS
10.
Process1: In windows 10, go to search and type in Control panel and click on
it
Process2: Click the link “View network status and tasks” under the “Network
and Internet” heading.
Process 3: Click the link on the left of the window labeled Change adapter
settings.
Process 4: You might have more than one Internet connection listed in this
window. If this is the case you will need to determine which one is your
connection to the Internet. Once you have found it, right click on your
network adapter and choose properties to open up the properties window of
this internet connection.
Process 5: Find the option of Internet Protocol Version 4 (TCP/IPv4) and
click on it. Then choose one option (Internet Protocol Version 4)
Process 6: Select “Use the following IP address” and enter the IP address,
Subnet Mask, Default Gateway and DNS server. Click OK and close
the Local Area Connection properties window.
When choosing “Use the following IP address” the IP must be configured as
Static Procces7: As an example, assign one PC1 an IP address of 192.168.0.1
6.Compare peer to peer network and client server network. and use the subnet mask 255.255.255.0.
Procces 8: As an example, assign one PC2 an IP address of 192.168.0.2 and
use the subnet mask 255.255.255.0.

6.ANSWER: /10MARKS
Peer to peer network:
● peer to peer network is that it is easier to set up
● In peer-to-peer networks all nodes are act as server as well as client
therefore no need of dedicated server.
● The peer to peer network is less expensive.
● Peer to peer network is easier to set up and use this means that you can
spend less time in the configuration and implementation of peer to peer
network.
● It is not require for the peer to peer network to use the dedicated server
computer. Any computer on the network can function as both a network
server and a user workstation.
Client server network:
In a client-server network, resources are controlled by a centralized network
administration.
● It is not require for the peer to peer network to use the dedicated server
computer. Any computer on the network can function as both a network
server and a user workstation.
Client server network:
In a client-server network, resources are controlled by a centralized network
administration.
The network administrator implements data backups and security measures.
The network administrator also controls user access to the server resources.
Up gradation and Scalability in Client-server set-up
Security Servers can play different roles for different clients

1.ANSWER: /3MARKS

DELETE is a Data Manipulation language command and is used to remove


tuples/records from a relation/table whereas DROP is a Data definition
language command and is used to remove named elements of schema like
1.Differentiate between DELETE and DROP SQL Statement? relations/table, constraints or entire schema. ... DROP is DDL.

2.ANSWER: /6MARKS

• ALTER TABLE TABLE_NAME COLUMN_NAMEADD


DATATYPE;
2. Write the command syntax with examples for the followings in SQL.
Alter table STUDENT add fname char(15);
• Add a new column for the table • DELETE FROM TABLE_NAME WHERE CONDITION;

• Delete a record Delete from student where stdid=021;


• insert into table_name values (value1,value2,value3,...valuen);
• Insert record
insert into book values(000032S,nkundamahoro,alex kagame,50,5000);
• Select all • SELECT*FROM TABLE_NAME;
SELECT *FROM STUDENT;

3.ANSWER: /5MARKS
3. You are given a flat database named “Library”, with a relation Book (ISBN • CREATE database Library;
(Text, primary key), title (text), author (text), pages (integer), and price
(integer)) CREATE table BOOK(ISBN VARCHAR(20) PRIMARY
KEY,title CHAR(10),auther varchar(20),pages INT,price INT)
• Create this database and relation ii. Select title, pages from BOOK;
iii. select * from BOOK author LIKE ‘C%’;
• Select title and pages of all books
iv. select title from BOOK ORDERED BY title ASC;
• Retrieve books written by authors whose name is started by C. v select TOP 3 * from BOOK;
• Create this database and relation ii. Select title, pages from BOOK;
iii. select * from BOOK author LIKE ‘C%’;
• Select title and pages of all books
iv. select title from BOOK ORDERED BY title ASC;
• Retrieve books written by authors whose name is started by C. v select TOP 3 * from BOOK;

• Order the books ‘titles from A to Z.


• Retrieve top three books. 4.ANSWER: /5MARKS
• create database university;


• create table department(department_id varchar(10) primary key,
4. Analyze The following schema describing a company’s database: department_name varchar(20), location varchar(100));
• create table position(position_id varchar(10) primary key,
Use SQL to answer the following questions: description varchar(100), min_salary int(10), max_salary int(10));
• Create a company’s database called “university”. • create table employee(employee_id varchar(10) primary key,
first_name varchar(100), last_name varchar(100), manager_id int(10)
• To create the department, position and employee relations with its foreign key references manager(manager_id), department_id
descriptions stated above. varchar(10) foreign key references department(department_id),
position_id varchar(10) foreign key references position(position_id);
• To add the following record into department: “1D, Economics,
Butare”.
c.insert into department values(“1d”, “economics”, “butare”);

5.Differentiate between entity integrity from Referential integrity.

5.ANSWER: /4MARKS
Entity integrity concerns the concept of a primary key. Entity integrity
is an integrity rule which states that every table must have a primary
key and that the column or columns chosen to be the primary key
should be unique and not null.
6. Given the following relation:
Student Referential integrity concerns the concept of a foreign key. The referential
StId Names Registered Location integrity rule states that any foreign-key value can only be in one of two
S01 Frederico 1990 Italy states.
S02 Amelia 1998 France
S08 Bosco 2000 Rwanda
6.ANSWER/6MARKS
S10 Joseph 2002 Uganda
S09 Steven 1999 Tanzania
S01 Frederico 1990 Italy states.
S02 Amelia 1998 France
S08 Bosco 2000 Rwanda
6.ANSWER/6MARKS
S10 Joseph 2002 Uganda
S09 Steven 1999 Tanzania • RA: R= πStId,Names,registered,Location(Student)
Write the relational algebra and SQL expressions for:
• Find all students. SQL: Select * from Student
• Find the students registered since 1999. • RA: R= ɕRegistered>=1999(Student)
• Find the number of students grouped by their location. SQL: select * from Student where
Registered>=1999
7. A company, using Database approach has a well manner to manage its • RA: R= Location count(*) (Student)
employees and calculate employee salaries as shown by the table below:
SQL: Select location,count(*) from Student
Group by Location
Employee
EmployeeI Employeen Place_Of_ Working_D
Base_salary
D ame Work ays 7.ANSWER/10MARKS
005 KAREKEZI MUHANGA 28 28,000 i) Select Employee_ID , Employee_name , Place_Of_Work from Employee;
006 MUNEZA BUTAMWA 15 15,000 ii) Select Employee_ID , Employee_name , Base_Salay from Employee
007 SESONGA MUHANGA 18 18,000 where Employee_ID = 006;
MANIRAR • Select sum(Base_Salary) from Employee;
008 KIGALI 22 22,000
ORA • Select * from Employee where Place_Of_Work = ‘MUHANGA’;
009 BUGINGO RILINDO 25 25,000 • Select count(EmployeID) from Employee where Base_Salary >
010 GABINEZA KIGALI 14 14,000 20000;
011 RUGIRA MUHANGA 7 7,000

Write sql commands to create the following queries:


i)
Employee_ID Employee_name Place_Of_Work
005 KAREKEZI MUHANGA
006 MUNEZA BUTAMWA
007 SESONGA MUHANGA
008 MANIRARORA KIGALI
009 BUGINGO RILINDO
010 GABINEZA KIGALI
011 RUGIRA MUHANGA

ii)
EmployeeID Employeename Base_salary
006 MUNEZA 15,000

• The total amount of all employees’ salaries


ii)
EmployeeID Employeename Base_salary
006 MUNEZA 15,000

• The total amount of all employees’ salaries


• All information for employees who work at MUHANGA
• The number of employees that earn more than 20,000

8. What is an ALIAS command in database?

8.ANSWER/2MARKS
ALIAS name can be given to any table or a column. This alias name can be
referred in WHERE clause to identify a particular table or a column.
For example-
Select emp.empID, dept.Result from employee emp, department as dept
where emp.empID=dept.empID
9. What is the role of ALTER statement in SQL? In the above example, emp refers to alias name for employee table and dept
refers to alias name for department table.

9. ANSWER/2MARKS
• The ALTER TABLE statement is used to add, delete, or modify
columns in an existing table.
10. Explain the integrity constraints used during table creation
• The ALTER TABLE statement is also used to add and drop various
constraints on an existing table.
10. a) Constraints are the rules enforced on the data columns of a table. These
are used to limit the type of data that can go into a table.
b) The following constraints are commonly used in SQL:
11. (a)Create a table of your choice with at least 4 different attribute in SQL. NOT NULL - Ensures that a column cannot have a NULL value.
UNIQUE - Ensures that all values in a column are different.
(b)Given an “Employee” table below: PRIMARY KEY - A combination of a NOT NULL and UNIQUE. ...
EVALUATI FOREIGN KEY - Uniquely identifies a row/record in another table
NAME PHONE ADDRESS SALARY
ON
KANAMUG 11. ANSWER/5MARKS
08564433 KACYIRU 185000 0.75
IRE
RURANGW Create table student (SId numeric (5) PRIMARY KEY, Fname char (25),
51231578 NYAMATA 123000 0.90 Lname char (25), Sex char (5));
A
RWAMAGA (b) i) Insert into Employee values (0788111111, “KIGALI”, ”171000”, 1);
BAHIZI 03314563 230000 0.80 ii)UPDATE Employee SET salary= (SALARY + 0.2) WHERE
NA
GIRANEZA 08567838 REMERA 197000 0.85 EVALUATION >=0.8;
RURANGW Create table student (SId numeric (5) PRIMARY KEY, Fname char (25),
51231578 NYAMATA 123000 0.90 Lname char (25), Sex char (5));
A
RWAMAGA (b) i) Insert into Employee values (0788111111, “KIGALI”, ”171000”, 1);
BAHIZI 03314563 230000 0.80 ii)UPDATE Employee SET salary= (SALARY + 0.2) WHERE
NA
GIRANEZA 08567838 REMERA 197000 0.85 EVALUATION >=0.8;
iii)Drop table Employee;
Write SQL statements for: iv)Select Name, Salary, address from Employee where
• Insert the new employee into the table Evaluation NOT BETWEEN 0.8 AND 0.85;

• Update the table to give a salary increase of 20% to those employees


whose evaluation is above or equal to 0.80.

• Destroying table name” Empoyee”.


• List the names, salary and address of employees whose evaluation are
less than 0.8 or greater than 0.85.
12.ANSWER/7MARKS
i. Select max(salary) as Highly_paid_employee from customers;
12.Kigeme Company Ltd is running a business and wishes to manage ii. Select min(salary) as Least_paid_employee from customers;
transactions in computerized way. The database of business contains iii. Select max(age) as oldest from customers;
various entities including “Customers” (id, names, age, address, iv. Select min (age) as youngest from customers;
salary) and orders (id, date,customer_id, amount) which are given v. Select sum(amount) as total_income from orders;
here below. Write a SQL statements to Help your school finding a
vi. Select names,age from customers;
solution to get the follow:
vii. Select avg(amount) as average from orders;
i. The highly paid employee
ii. The least paid employee 13.ANSWER/4MARKS
iii. The oldest employee
iv. The youngest employee Structured Query Language: Structured Query Language is an ANSI
v. To generate total amount of income at a given day. (American National Standards Institute) standard computer language for
vi. To retrieve only the names and age of all employees accessing and manipulating database systems.
vii. To retrieve the average income at a given day. While

13. Differentiate Structured Query Language and Relational Relational algebra: Relational algebra is a procedural query language,
algebra. which consists of a set of operations that take one or two relations as input
and produce a new relation as their result.

14. ANSWER/8MARKS

a.SELECT LOWER (CONCAT (“INFORMATICS”,” PRACTICES”);


CONCAT (“INFORMATICS”,” PRACTICES”);

information , practice
14. ANSWER/8MARKS

a.SELECT LOWER (CONCAT (“INFORMATICS”,” PRACTICES”);


CONCAT (“INFORMATICS”,” PRACTICES”);

information , practice
14. Analyze the following SQL statements and display output.
b.SELECT LEFT(“Abanyarwanda”,8);
• SELECT LOWER (CONCAT (“INFORMATICS”,” PRACTICES”); LEFT(“Abanyarwanda”,8)
• SELECT LEFT(“Abanyarwanda”,8); Abanyarw
• SELECT LENGTH(“Abanyarwanda”);
• SELECT STRCMP (“abana”,” abandi”); c.SELECT LENGTH(“Abanyarwanda”);
LENGTH(“Abanyarwanda”)
12

d.SELECT STRCMP (“abana”,” abandi”);


STRCMP (“abana”,” abandi”)
-1

1.ANSWER: /5MARKS

You can use sub procedures if you want to run a series of statement without
returning any value.
Sub procedures start with "Sub" and ends with "End Sub" statements
Sub procedures can take arguments but cannot return a value
Sub procedures may or may not take an input.

2.ANSWER: /3MARKS
• Explain the characteristics of Sub procedures?
You use Function procedures when you want to execute a series of
statements and return a value.
Function procedures start and end with Function and End Function
statements
A function procedure may or may not take input.
• Mention when to use Function procedures and what are its Function procedures return a value by assigning the value to its name
characteristics?

3.ANSWER: /4MARKS

The InputBox( ) Function


An InputBox( ) function will display a message box where the user can enter
a value or a message in the form of text. The format is
The InputBox( ) Function
An InputBox( ) function will display a message box where the user can enter
a value or a message in the form of text. The format is
myMessage=InputBox(Prompt, Title, default_text, x-position, y-position)
• Write down and explain the general syntax of input box.
myMessage is a variant data type but typically it is declared as string, which
accept the message input by the users. The arguments are explained as
follows:
• Prompt - The message displayed normally as a question asked.
• Title - The title of the Input Box.
• default-text - The default text that appears in the input field where
users can use it as his intended input or he may change to the message
he wish to key in.

4.ANSWER: /5MARKS

private sub command1_click ()


Dim AVG as integer
• Having below, already an initialized array called X: Dim x(8) As integer
X(0)=4
Write a VB Program to perform an average of elements on index 2,5 and 7 X(1)=20
X(2)=40
X(3)=60
X(4)=25
X(5)=30
X(6)=44
X(7)=80
AVG =( X (2) + X (5) + X (7))/3
Print AVG

5.ANSWER: /5MARKS
Private Sub Command1_Click()
Print ("The sum of elements is:");
• Write a VB function to sum all the numbers in a list. FindSum()
End Sub
Function FindSum() As Integer
Dim i, Num(5) As Integer
For i = 1 To 5
Num(i) = Val(InputBox("Enter the first number: ", "Number"))
• Write a VB function to sum all the numbers in a list.
End Sub
Function FindSum() As Integer
Dim i, Num(5) As Integer
For i = 1 To 5
Num(i) = Val(InputBox("Enter the first number: ", "Number"))
Sum = Sum + Num(i)
Next i
FindSum = Sum
End Function

6.ANSWER: /6MARKS

• The first step is to declare a function/procedure (Function prototype):


This is a declaration of a function that specifies the function's name
• Give steps to write a function and a procedure. and type signature (data types of parameters, and return type).
• The second step is to define a function/Procedure: This is a section
of a program that performs a specific task.it is the body of the
function which indicates what to do (the task).
• The third step is to call a function/Procedure: This is a fact of
indicating the compiler to perform the task defined inside function
body. We cannot execute the code defined inside function's body
unless we call it from another function.

7.ANSWER/4MARKS

A Function must return a value but in Stored Procedure it is optional


• Differentiate a function from a procedure.
(Procedure can return zero or n values). Functions can have only
input parameters for it whereas Procedures can have input/output
parameters. Functions can be called from Procedure whereas
Procedures cannot be called from Function.
Function is an independent procedure that is written to perform a specific
task. It is also Non-event procedure. Function returns a single value. to
procedure that execute it. Procedure also type of subprogram, which consists
of a block of statement that carries out well-defined task. It is also called sub
procedure or procedure. This procedure does not respond to any event. They
are called
standard procedure to distinguish them from event procedure. Then Main
difference between procedure and function is that function may return any
of a block of statement that carries out well-defined task. It is also called sub
procedure or procedure. This procedure does not respond to any event. They
are called
standard procedure to distinguish them from event procedure. Then Main
difference between procedure and function is that function may return any
value cannot return any value to calling function

1.ANSWER/6MARKS
a) ADO control: allows connecting a VB program to a text database such as
(sql server, Ms Access, Database…)
• What is the roles of the following in VB connectivity? b) Access Connection: it allows your program to access a data
a)Activex data Object (ADO) control? source using a connection. Its environment deals with transferring
b) Access Connection? data.
c) Record Set? c) RecordSet: This property work with the records which can be
accessed by an ADO control.
2. Answer: /6MARKS
2.List 3 ADO objects • connection data object:
The ADO Connection Object is used to create an open
connection to a data source.
• Recordset data object.
The ADO Recordset object is used to hold a set of records
from a database table.
A Recordset object consist of records and columns (fields).
• command data object:
The ADO Command object is used to execute a single query
against a database.
3. Differentiate a connection string from a datagrid in VB 6.0.
3.ANSWER/4MARKS
-> Connection string: a connection string is a string that specifies
information about a data source and the means to connect to it.

a Datagrid is a graphical user interface element (widget) that presents a


tabular view of data.
4. Assume that a database is connected to the VB form, Write the method that
will help the user to:
4.ANSWER/10MARKS
• Add a new record a) Private Sub Command1_Click()
Adodc1.Recordset.AddNew
• Move to next record End Sub
4.ANSWER/10MARKS
• Add a new record a) Private Sub Command1_Click()
Adodc1.Recordset.AddNew
• Move to next record End Sub

• Move to first record b) Private Sub Command1_Click()


Adodc1.Recordset.MoveNext
End Sub
• Move last record
c) Private Sub Command1_Click()
• Delete record. Adodc1.Recordset.MoveFirst
End Sub
d) Private Sub Command1_Click()
Adodc1.Recordset.MoveLast
End Sub
e) Private Sub Command1_Click()
Adodc1.Recordset.Delete
End Sub

5.ANSWER/10MARKS

a. It is a secret word or phrase that must be used to gain access to a computer


systemor service.
5. The diagram below show the log-in screen on network. To gain access to b.
the internet the user name and password must be entered. Private sub Ok_click()
If Text1.Text = "User" And Text2.Text = "Password" Then
a. What is a password? MsgBox ("Logged successful")
Form2.Show
b. Write VB code for login when Ok button is clicked. For example, if user Login.hide
set user name as “User” and Password as “Password”, Form 2 will appear on Else
screen and Login form disappear. MsgBox ("Logged unsuccessful, Try again")
End If
End sub
6.Write steps to add the ADO control on the form.
6. ANSWER/6MARKS
To add the ADO control on the form, perform the following steps:
1. Select the command Component in the project menu
2. Click on Controls in the dialog box which opens
3. Select Microsoft Ado Data Controls 6.0 (OLEDB)
4. Click ok button
5. This control will be added to the toolbox.
To add the ADO control on the form, perform the following steps:
1. Select the command Component in the project menu
2. Click on Controls in the dialog box which opens
3. Select Microsoft Ado Data Controls 6.0 (OLEDB)
4. Click ok button
5. This control will be added to the toolbox.
6. Place an instance of the ADO Data Control on the form.
• Differentiate preemptive and non-preemptive scheduling giving the
application of each of them.

2. Choose the suitable word(s) in bold to fill the following blanks:


a. An instance of a program execution is called ___________( Process, 1.ANSWER/6MARKS
Instruction, Procedure, Function) In non-preemptive algorithms, once a process enters the running state, it
b. A scheduler which selects processes from secondary storage device is cannot be preempted until it completes its allocated time whereas in
called______________( Short term scheduler, Long term scheduler, Medium preemptive scheduling a scheduler may preempt a low priority running
term scheduler, Process scheduler). process anytime when a high priority process enters into a ready state. FCFS,
c. The ____________ is used as the repository for any information of the SJF and priority based scheduling are examples of nonpreemptive
process. (Process state, deadlock, CPU, PCB). scheduling. SJF, priority based scheduling and RR are examples of
d. ____________is the module that gives control of the CPU to the process preemptive scheduling.
selected by the short term scheduler. (Dispatcher, processor, aging).
e. _____________ Scheduler select the process that is in the ready queue to 2.ANSWER/5MARKS
execute and allocate the CPU to it. (Short term scheduler, Long term
scheduler, Medium term scheduler, dispatcher). • Process
• Long term scheduler
• PCB
3. Which algorithm is defined in Time quantum? • Dispatcher
a) shortest job scheduling algorithm • Short term scheduler
b) round robin scheduling algorithm
c) priority scheduling algorithm
d) multilevel queue scheduling algorithm
3.ANSWER/2MARKS
4. Consider the following set of processes, with the
length of the CPU-burst time given in milliseconds: Answer is b.
Proces Burst
Priority
s Time
P1 10 3
P2 1 1 4.ANSWER/15MARKS
P3 2 3
Proces Burst
Priority
s Time
P1 10 3
P2 1 1 4.ANSWER/15MARKS
P3 2 3
P4 1 4
P5 5 2 • Gantt charts:

The processes are assumed to have arrived in the order FCFS:


P1, P2, P3, P4, P5, all at time 0. P P
• Draw four Gantt charts illustrating the execution of P2 P3 P4
1 5
these processes using FCFS, SJF, a non-preemptive
priority (a smaller priority number implies a higher 0 10 11 13 14 19
priority), and RR (quantum = 1) scheduling.
• What is the turnaround time of each process for
each of the scheduling algorithms in part a? SJF
• What is the waiting time of each process for each of the P P
P2 P4 P3
scheduling algorithms in part a? 5 1
• Which of the schedules in part a results in the minimal average 0 1 2 4 9 19
waiting time
( Non-preemptive priority
o P P
P2 P3 P4
v 5 1
e 0 1 6 16 18 19
r RR (quantum = 1)
a
P P P P P P P P P P P P P P P
l
1 2 3 4 5 1 3 5 1 5 1 5 1 5 1
l
p 0 1 2 3 4 5 6 7 8 9 10
r 11 12 13 14 19
o • Turnaround time = finish time- arrival time
c OR: Turnaround time = CPU burst time+ wait time
e
s By using the first law (Turnaround time = finish time- arrival time) and
s getting finish time
e from Gantt chart:
s
) Turnaround time
?
FCFS RR SJF Priority
P1 10-0=10 19-0=19 19-0=19 16-0=16
P2 11 2 1 1
) Turnaround time
?
FCFS RR SJF Priority
P1 10-0=10 19-0=19 19-0=19 16-0=16
P2 11 2 1 1
P3 13 7 4 18
P4 14 4 2 19
P5 19 14 9 6

c)Waiting time = Turnaround time - CPU burst time

Waiting time
FCFS RR SJF Priority
P1 10-10=0 19-10=9 19-10=9 16-10=6
P2 10 1 0 0
P3 11 5 2 16
P4 13 3 1 18
P5 14 9 4 1
Aver
age
waiti 9.6 5.4 3.2 8.2
ng
time

d)The minimal average waiting time is found in SJF algorithm

5.ANSWER/6MARKS
• FCFS—discriminates against short jobs since any short
jobs arriving after long jobs will have a longer waiting
time.
• RR—treats all jobs equally (giving them equal bursts of
CPU time) so short jobs will be able to leave the system
faster since they will finish first.
• Multilevel feedback queues work similar to the RR
algorithm— they discriminate favorably toward short
jobs.

5. Explain the differences in the degree to which the


algorithm— they discriminate favorably toward short
jobs.

5. Explain the differences in the degree to which the


following scheduling algorithms discriminate in favor of
short processes:
• FCFS
• RR
• Multilevel feedback queues

• a) Is it possible to create a folder using application software? Justify 1.ANSWER/4MARKS


your answer? a) No. Because folders are created by the operating system. Therefore
application software cannot create a folder.
b) Is it possible to create a file using an operating system? Justify your b) No, Ordinary Files / Simple File are normally created by the application
answer? software, operating system cannot create files.

• ANSWER/3MARKS
The advantages are:
• Supports direct access
• Supports sequential access
2. What are the advantages of contiguous allocation? • Number of disks seeks is minimal

• ANSWER/3MARKS
The following are some of the properties of a file:
a. Name: It is the only information which is in human readable form.
b. Identifier: The file is identified by a unique tag (number) within file
3. List and define properties of the saved document. system.
c. Type: It is needed for systems that support different types of files.
d. Location: Pointer to file location on device.
e. Size: The current size of the file.
f. Protection: This controls and assigns the power of reading, writing,
executing.
g. Time, date, and user identification: This control the time, date and user
who access the file for the last time.
• ANSWER/4MARKS
Both sequential and direct file access find and access a record. In sequential
4. Compare sequential and direct file access. access the file pointer begins at the beginning of the file and can only move in
one direction. Thus sequential access is linear: The only record that can be
accessed is the first or the one immediately following the last one accessed.
In direct access the file pointer can be moved to any specific record and the
data accessed from that place.
4. Compare sequential and direct file access. access the file pointer begins at the beginning of the file and can only move in
one direction. Thus sequential access is linear: The only record that can be
accessed is the first or the one immediately following the last one accessed.
In direct access the file pointer can be moved to any specific record and the
data accessed from that place.

5.ANSWER/4MARKS
5. Write steps to view and change the file attributes in Windows 10.
Right-click a file and select the Properties .You can quickly open the file
properties if you press and hold the Alt key and double click the file or press
Enter.
1.ANSWE/2MARKS
It is a process of bringing in each process in its entirety, running it for a
while and then putting it back on the disk. moving process from main
memory to the disk

• ANSWER/2MARKS
When swapping creates multiple holes in memory, it is possible to combine
them all into one big by moving all the processes downward as far as
possible. This process is called memory compaction

3.ANSWER/3MARKS
Every page replacement algorithm is operated by the following three
• Define memory Swapping. operations:
• Search: to search required pages from main memory
• Delete: to delete the evict page from main memory
• Insert: to insert the page into main memory
2.What is Memory Compaction concept?
4.ANSWER/4MARKS

3. What are the operations of page replacement algorithm? Logical address is the address generated by the cpu while physical address
is the address actually seen by the memory hardware

5. ANSWER/6MARKS

FIXED
VARIABLE
4.Differentiate between logical address and physical address. PARTITION

-Each partition holds -Processes are loaded


FIXED
VARIABLE
4.Differentiate between logical address and physical address. PARTITION

-Each partition holds -Processes are loaded


process into memory until
5. Differentiate fixed partition memory allocation from -Operating system the memory is filled
Variable Partition memory allocation. can support -The remaining space
simultaneous is too small to
execution of accommodate
processes, all those another process
processes could be -A process
active at any time terminates, the space
-System manager become free means is
control those process available for the
- Occurrence of the loading of a new
wasted space in this process
way is referred to as -The result of the
INTERNAL free space in the
FRAGMENTATION memory are called
EXTERNAL
FRAGMENTATION

6.ANSWER/10MARKS
First fit best fit
6. Given memory partitions of 100k, 500k, 200k,300k, and 600k, how would 212k is put in 500k partition 212k is put in 300k
each of the first fit, best fit, and worst fit algorithms place processes of 212k, partition
417,112k, and 426k respectively? Which algorithm makes the most efficient 417k is put in 600k partition 417k is put in 500k
use of memory? partition
112k is put in 200k partition 112k is put in 200k
partition
426k must wait 426k is put in 600k
partition

Worst fit
212k is put in 600k partition
417k is put in 500k partition
112k is put in 300k partition
426k must wait
Best fit algorithms turn out to be the best

1.ANSWER/4MARKS
112k is put in 300k partition
426k must wait
Best fit algorithms turn out to be the best

1.ANSWER/4MARKS
Java Collection Framework (JCF) represents a set of interfaces and classes
which provide efficient ways to store and handle data in a Java application. It
includes several classes that support operations like searching, sorting,
insertion, manipulation, and deletion.
While
A collection is a data structure which contains and processes a set of data.
The data stored in the collection is encapsulated and the access to the data is
only possible via predefined methods.

2.ANSWER/5MARKS

The method will be used are:


add (), this will help ta add travels to the ArrayList ,
set (int index, Object o):to update the booking and travels,
set (int index, Object o):to remove the booking already done
Object get (int index):returns the object of list of travels and booking which
is present at the specified index.
• Explain the following: Collection and Java Collection Framework.
3.ANSWER/10MARKS
public class Arraylist2 {
public static void main(String[] args) {
LinkedList<String> district = new LinkedList<String>();
district.add("Gakenke");
district.add("Rubavu");
district.add("Gasabo");
• We want to develop an application called Travel in which will display district.add("Nyagatare");
the travels from the traveling agency companies Alpha Ltd and Beta district.add("Nyabihu");
Ltd and place an order from customers. System.out.println(district);
district.set (3, "Nyarugenge");
Show the methods that will be used by/ the application to keep the System.out.println("Gasabo is replaced:"+district);
travels for every company? district.addFirst("Bugesera");
System.out.println("Bugesera is added to the fist
position:"+district);
district.add(4, "Karongi");
district.removeFirst();
System.out.println(district); } }
System.out.println("Bugesera is added to the fist
position:"+district);
district.add(4, "Karongi");
district.removeFirst();
System.out.println(district); } }

4.ANSWER/4MARKS
The output will be:
• Write a Java program that do the following: {80=tom, 65=Antoine, 50=peter, 75=Alice}

• Create linkedList from linked list with assigned to the variable


district.
5. ANSWER/4MARKS
• Add the following district in the List (Gakenke, Rubavu, Both Queue and Stack are used to store data before processing them. Queue
Gasabo, Nyagatare, Nyabihu ) allows retrieval of element in First-In-First-Out (FIFO) order but it’s not
always the case. Stack is similar to queue except that it allows elements to be
• Add Bugesera District to the front of list and Karongi to the4th
retrieved in Last-In-First-Out (LIFO) order.
position
• Replace Gasabo District with Nyarugenge
6. ANSWER/3MARKS
• Retrieving the Second District using Index Class implementing List interface: ArrayList, Vector, LinkedList ,
Class implementing Set interface: HashSet, TreeSet
• Show the Size and Remove the last district in the List

7.ANSWER/10MARKS
package pkginterface;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
4. Analyze the program and give the output. import java.util.Set;
Map<Integer, String> mapmarks = new HashMap<>();
mapmarks.put(80, "tom"); public class INTERFACE {
mapmarks.put(75, "Alice"); public static void main(String[] args) {
mapmarks.put(65, "Antoine"); // ArrayList
mapmarks.put(50, "peter"); List a1 = new ArrayList();
System.out.println(mapmarks); a1.add("Tom");
a1.add("Paul");
5. What is Queue and Stack. a1.add("John");
System.out.println(" ArrayList Elements");
mapmarks.put(65, "Antoine");
mapmarks.put(50, "peter"); List a1 = new ArrayList();
System.out.println(mapmarks); a1.add("Tom");
a1.add("Paul");
5. What is Queue and Stack. a1.add("John");
System.out.println(" ArrayList Elements");
System.out.print("\t" + a1);
// LinkedList
List l1 = new LinkedList();
6.What are the classes implementing List and Set interface? l1.add("tom");
l1.add("Paul");
l1.add("John");
System.out.println();
System.out.println(" LinkedList Elements");
7.Write a Java program that supports: System.out.print("\t" + l1);
Adding Elements and display those elements using the following classes:
ArrayList , LinkedList, HashSet, HashMap // HashSet
Set s1 = new HashSet();
s1.add("Tom");
s1.add("Paul");
s1.add("John");
System.out.println();
System.out.println(" Set Elements");
System.out.print("\t" + s1);

// HashMap
Map m1 = new HashMap();
m1.put("Tom", "8");
m1.put("paul", "31");
m1.put("John", "12");
m1.put("Alica", "14");
System.out.println();
System.out.println(" Map Elements");
System.out.println("\t" + m1);
}
}

1.ANSWER/5MARKS
a) servlet is convenient in modifying regular html
1.What are any four advantages of servlet? b) we can write the servlet code into the jsp
c)servlet includes the feature of multithreading of java
d)we can make use of exception handling

2.ANSWER/5MARKS
a) servlet is convenient in modifying regular html
1.What are any four advantages of servlet? b) we can write the servlet code into the jsp
c)servlet includes the feature of multithreading of java
d)we can make use of exception handling

2.ANSWER/5MARKS
The life cycle of the servlet is as follows:
1. Servlet class is loaded.
2. what are life cycle of servlet. 2. Servlet instance is created.
3. initialized method is invoked.
4. service method is invoked.
5. destroy method is invoked.

3.ANSWER/4MARKS
GET: not secured because data is exposed in URL bar, can be bookmarked, it
3. Compare between Get and Post method? is more efficient and used than post
POST: secured because data is not exposed in URL bar, cannot be
bookmarked, it is less efficient and used

• ANSWER/4MARKS
Step 1: To install html editor like Notepad++, Editplus, …
Step 2: To install java runtime, JDK, Netbeans, etc.
Step 3: To install a web server like Tomcat, GlassFish, etc.
4. You are requested to make a proposal of the website for your school, Step 4: Create a directory structure for the web site
Explain the process to create that website and test. Step 5: Creating web pages using html, JSP, servlet and JDBC
when necessary.

• ANSWER/4MARKS
A tag is said to be a paired tag if the text is placed between a tag
and its companion tag. In paired tags, the first tag is referred to as
Opening Tag and the second tag is referred to as Closing Tag. An
5. Explain how paired and unpaired tags are used? unpaired tag does not have a companion tag. Unpaired tags are
also known as Singular or StandAlone Tags. Below are examples
of both paired and unpaired tags:
Paired tags: <p>this is example of paired tag</p>
Unpaired tag: <br> <img src='test.png' >

• ANSWER/5MARKS
6. Write a program using the request.getParameter() method to enter the
Name and Password of a user and display the output on another JSP page. <html>
• ANSWER/5MARKS
6. Write a program using the request.getParameter() method to enter the
Name and Password of a user and display the output on another JSP page. <html>
<head>
<title>user</title>
</head>
<body>
<h1>User submission form</h1>
<form action="UserDisplay.jsp" method="post">
Enter User Name:
<input type="text" name="uname">
<br>
<br>
Enter Password:
<input type="password" name="pname">
<br>
<br>
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>

7.ANSWER /3MARKS
7. Write example calling JSP from servlet. One of the way is RequestDispatcher interface for example:
• RequestDispatcher rd=request.getRequestDispatcher(“/login.jsp);
• rd.forward(request,response);
1.ANSWER/5MARKS
• Computer aided design
• Computer art
• Entertainment
• Business
• Education and training

2.ANSWER/2MARKS
Computer graphics involves display, manipulation, storage of
images, and experimental information for proper visualization.
• List five area where computer graphics can be applied.
Computer Graphics is the creation of pictures with the help
of a computer.

3.ANSWER/3MARKS
images, and experimental information for proper visualization.
• List five area where computer graphics can be applied.
Computer Graphics is the creation of pictures with the help
of a computer.

3.ANSWER/3MARKS
– The images are easy to edit in memory and display on TV monitors due to
the arrangement of the pixels in a rectangular array.
2. What is computer graphics? – The image size is determined on the basis of image resolution.
– These images cannot be scaled easily; resizing do not work very well and
can significantly distort the image.
– Bitmap graphics are used for general purpose images and in particular
photographs

3. Give the characteristic of bitmap graphic 4.ANSWER/4MARKS


Computer graphics can make better the understanding of the functioning of a
system. In physical systems, biological systems, population trends, etc.,
models make it easier to understand. In some training systems, graphical
models with simulations help a trainee to train in virtual reality environment.
For example, practice session or training of ship captains, aircraft pilots, air
traffic control personnel.

4.Explain the role of computer graphic in Education and training. 5.ANSWER/5MARKS


Step1 Connect one end of the USB cable to the port in your camera.
Step2 Connect the other end of the USB cable to the USB port in the
computer. This may be in the front or back of the computer.
Step3 Turn on the camera
Step4 A dialog box may appear on the screen. If it does, select “View Files”
5. Write steps to import a picture from camera to computer by using a USB or “Open Folder.”
cable. Step5 The pictures are probably located in a particular photo folder on the
camera.
Step5 The pictures are probably located in a particular photo folder on the
camera.

6.ANSWER/4MARKS
Adobe Photoshop is a raster graphics editor developed and published by
Adobe Systems for MacOS and Windows. Adobe Photoshop is the
predominant photo editing and manipulation software on the market. Its uses
range from full featured editing of large batches of photos to creating
intricate digital paintings and drawings that mimic those done by hand.
6.Compare Paint from Photoshop. While
Microsoft Paint or ‘MS Paint’ is a basic graphics/painting utility that is
included in all the Microsoft Windows versions. MS Paint can be used to
draw, colour and edit pictures, including imported pictures from a digital
intricate digital paintings and drawings that mimic those done by hand.
6.Compare Paint from Photoshop. While
Microsoft Paint or ‘MS Paint’ is a basic graphics/painting utility that is
included in all the Microsoft Windows versions. MS Paint can be used to
draw, colour and edit pictures, including imported pictures from a digital
camera for example. MS Paint is found in the windows start menu within the
Accessories Folder. The primary features of MS Paint are simple drawing
tools that you can use to easily draw on a blank canvas or existing image.
Beyond that, Paint includes cropping, resizing, rotating, skewing, and
selection tools to further.

7.ANSWER/4MARKS

The Image Size command is used when you want to change the size of an
7.Distinguish image size to canvas size. image, such as to print at a different size than the native pixel dimensions of
the image. The Canvas Size command is used for adding space around a
photo or essentially cropping the image by reducing the available space.

8.ANSWER/5MARKS

• Write steps to calculate file size. Step 1: Find the total number of pixels in the image

Image menu and choosing Image Size


Dimensions section that my image has a width and a height
To find the total number of pixels, multiply the width and height together.

Step 2: Multiply the total number of pixels by 39. Answer in bytes

Step 3: Convert the image size from bytes to kilobytes

Convert bytes to kilobytes, divide the total number of bytes by 1024

Step 4: Convert the image size from kilobytes to megabytes


1.ANSWER/3MARKS
The main reason for the popularity of these formats is that they offer good
compression and high quality. They are also cross platform and supported by
most popular web browsers. Sound file extension could.mp3. video files
extensions are.mpg or .mpeg

• ANSWER/3MARKS
most popular web browsers. Sound file extension could.mp3. video files
extensions are.mpg or .mpeg

• ANSWER/3MARKS
Action buttons are built-in button shapes you can add to a
1.What is the main reason for popularity of MP3 formats? presentation and set to link to another slide, play a sound, or
perform a similar action. When someone clicks or moves over
the button, the selected action will occur.
Action buttons to play a CD
1. Action button for Previous media
2. Action button for next media
2. What is action button? List different action buttons to play a 3. Action button for start or begin or play
CD.
4. Action button for end or stop

3.MARKS/4MARKS
Disadvantages:
1. Information overload. Because it is so easy to use, it can
3. Explain any four disadvantages of multimedia. contain too much information only once. Information
overload. Because it is so easy to use, it can contain too much
information only once.
2. It takes time to compile. Even if it is flexible, it needs time
with the original draft.
3. It can be expensive. As one of my previous post mentioned,
and multimedia using a wide range of resources, you can
spend a lot of money.
4. Too unrealistic. Large files such as video and audio effects,
the time it takes to load your presentation. By adding too
much may mean that you must use a larger computer storage
files. If you want to upload to the Internet, there are several
factors, such as bandwidth and the user's ability to keep in
mind.

4. Creating a 3–D animation is a 3-step process.


Modeling: 3D modeling (or three-dimensional modeling)
4.Write process to create 3–D animations. is the process of developing a mathematical representation of
any surface of an object (either inanimate or living) in three
dimensions via specialized software.
Animating: It is the process of generating three-
4. Creating a 3–D animation is a 3-step process.
Modeling: 3D modeling (or three-dimensional modeling)
4.Write process to create 3–D animations. is the process of developing a mathematical representation of
any surface of an object (either inanimate or living) in three
dimensions via specialized software.
Animating: It is the process of generating three-
dimensional moving images in a digital environment.
Rendering: 3D rendering is the 3D computer graphics
process of automatically converting 3Dwire frame models into
2D images on a computer. 3D renders may include
photorealistic effects or nonphotorealistic rendering

5. Differentiate between fade-in and fade-out in audio. 5. ANSWER/4MARKS


When you "fade in," it means to gradually increase the volume level from
silence to the original level. When you "fade out," it means to gradually
decreased the volume level from the original level to silence. ... You
generally fade in at the beginning of an audio segment, and fade out at the
end of an audio segment.
6. Contrast description for each of the following file formats: GIF, JPEG, 6.MARKS/10MARKS
TIFF, BMP, and PNG.
Format Name Description Recognized Extensions
Graphics Interchange
GIF .gif
Format
Joint Photographic
JPEG .jpg, .jpeg
Experts Group
Tagged Image File
TIFF .tif, .tiff
Format
BMP Windows Bitmap .bmp
Portable Network
7. Compare Multimedia and Hypermedia. PNG .png
Graphics

7.MARKS/4MARKS
Multimedia ---- An Application which uses a collection of
multiple media source e.g. text, graphics, images, sound/audio,
animation and/or video.
Hypermedia ---- An application which uses associative
relationships among information contained within multiple media
data for the purpose of facilitating access to, and manipulation of,
the information encapsulated by the data.
1.MARKS/2MARKS
Answer is b
the information encapsulated by the data.
1.MARKS/2MARKS
Answer is b

1.Which operator is used to insert the data into file?


2.MARKS/5MARKS
a) >> #include<fstream.h>
b) <<
int main()
c) < {
ofstream fout;
d)> fout.open("NOTES.TXT");
for(int i=1;i<=100;i++)
fout<<i<<endl;
2. Write a C++ program to write number 1 to 100 fout.close();
in a data file NOTES.TXT return 0;
}

3.MARKS/2MARKS
Answer is b

4.MARKS/3MARKS
If the file is opened for output operations and it already existed, its previous
content is deleted and replaced by the new one.

3.Which is correct syntax? 5.ANSWER/6MARKS


• myfile:open(“example.bin”,ios::out);
• myfile.open(“example.bin”,ios::out);
ofstream
• myfile::open(“example.bin”,ios::out);
• myfile.open(“example.bin”,ios:out); This data type represents the output file stream and is used to create files and
to write information to files.
4. Explain the using of ios::trunc. ifstream
This data type represents the input file stream and is used to read information
from files.
5.Compare the following datatypes ofstream, ifstream, fstream.
fstream
This data type represents the file stream generally, and has the capabilities of
This data type represents the input file stream and is used to read information
from files.
5.Compare the following datatypes ofstream, ifstream, fstream.
fstream
This data type represents the file stream generally, and has the capabilities of
both ofstream and ifstream which means it can create files, write information
to files, and read information from files.

6.ANSWER/4MARKS
Writing to a File
While doing C++ programming, you write information to a file from your
program using the stream insertion operator (<<) just as you use that
operator to output information to the screen. The only difference is that you
use an ofstream or fstream object instead of the cout object.
6. Differentiate reading form a file and writing to a file in c++ file handling. Reading from a File
You read information from a file into your program using the stream
extraction operator (>>) just as you use that operator to input information
f r o m t h e k e y b o a r d . T h e o n l y d i ff e r e n c e i s t h a t y o u u s e
an ifstream or fstream object instead of the cin object.

7.MARKS/5MARKS
#include<fstream.h>

int main()
{
ofstream fout;
7. Write a C++ program, which initializes a string variable and outputs the fout.open("out.txt");
string to the disk file. char str[300]="Time is a great teacher but unfortunately it kills all its pupils.
Berlioz";
fout<<str;
fout.close();
return 0;
}

1.How many Aggregate functions are available in SQL? Explain


fout.close();
return 0;
}

1.How many Aggregate functions are available in SQL? Explain


them.
Answer: SQL Aggregate functions determine and calculate values
from multiple columns in a table and return a single value.
There are 7 aggregate functions in SQL:
• AVG(): Returns the average value from specified columns.
• COUNT(): Returns number of table rows.
• MAX(): Returns the largest value among the records.
• MIN(): Returns smallest value among the records.
• SUM(): Returns the sum of specified column values.
• FIRST(): Returns the first value.
• LAST(): Returns last value.

2.What are transactions and their controls?


Answer: A transaction can be defined as the sequence task that is
performed on databases in a logical manner to gain certain results.
Operations like Creating, updating, deleting records performed in the
database come from transactions.
In simple words, we can say that a transaction means a group of SQL
queries executed on database records.
There are 4 transaction controls such as
• COMMIT: It is used to save all changes made through the
transaction.
• ROLLBACK: It is used to roll back the transaction. All changes
made by the transaction are reverted back and the database remains as
before.
• SET TRANSACTION: Set the name of the transaction.
• SAVEPOINT: It is used to set the point where the transaction is to be
rolled back.
3. Database queries:
• Write a query to display the names (first_name, last_name) using alias
name “First Name", "Last Name". /3marks
SELECT first_name As "First Name", last_name As "Last
Name"
FROM employees;

• Write a query to get unique department ID from employee table. /


3marks
Name"
FROM employees;

• Write a query to get unique department ID from employee table. /


3marks

SELECT DISTINCT department_id

FROM employees;

• Write a query to get all employee details from the employee table
order by first name, descending. /3marks

SELECT *

FROM employees

ORDER BY first_name DESC;

• Write a query to get the names (first_name, last_name), salary, PF of


all the employees (PF is calculated as 15% of salary). /3marks

SELECT first_name, last_name, salary,


salary*0.15 As PF

FROM employees;

• Write a query to get the employee ID, names (first_name, last_name),


salary in ascending order of salary. /3marks

SELECT employee_id, first_name, last_name,


salary

FROM employees

ORDER BY salary;

4.Define: Operating system, Process, Process state, PCB, Dispatcher,


Dispatch latency, Interrupt, protection, Deadlock state, Safe state,
Resource allocation state?
Answer:
Operating system: is a set of programs that control the execution of
4.Define: Operating system, Process, Process state, PCB, Dispatcher,
Dispatch latency, Interrupt, protection, Deadlock state, Safe state,
Resource allocation state?
Answer:
Operating system: is a set of programs that control the execution of
application programs and act as an intermediary between a user of a
computer and the computer hardware.
Process: is a program in execution. It is the unit of work in most
system.
Process state: is the current activity of that process.
The PCB (process Control Block): is a data structure. It use as
the repository for any information that may vary from process to
process. Each process has its PCB.
The dispatcher: is the module that gives control of the CPU to the
process selected by the short-term scheduler.
The dispatcher latency is the time takes for the dispatcher to stop one
process and start another running.
Interrupt: is an event that alters the sequence in which the processor
executes instructions.
Protection: refers to mechanism that control the access of programs or
users to the both system and resources
Deadlock state: A set of processes is in a deadlock state when every
process in the set is waiting for an event that can be caused only by
another process in the set.
Safe state: A state is safe if the system can allocate resources to each
process (up to its maximum) in some order and still avoid a deadlock.
Resource allocation state: It is defined as the number of available and
allocated resources and the maximum demands of the processes.
• Write a VB Program to find the Fibonacci series up to a given term
(userInputBox).
Dim n As Integer
Dim a As Integer
Dim b As Integer
Dim c As Integer
Private Sub Command1_Click()
n = InputBox("Enter the number of terms")
a=0
b=1
Print "Fibonacci series is:"
Print a
Print b
For i = 1 To n - 2
b=1
Print "Fibonacci series is:"
Print a
Print b
For i = 1 To n - 2
c=a+b
a=b
b=c
Print c
Next
End Sub

6.Write a VB code for draws simple circle with width 3, center 2000,2000
radius 1500 and use color blue then using the Circle method in Visual Basic
6.
Private Sub Command1_Click ()
DrawWidth = 3 /1marks
Circle (2000, 2000), 1500 vbBlue
End Sub
7.
i)Define the term computer malware : malware means malicious software is
a kind of program that can enter in your computer and attacks your file and
make your computer to perform in bad conditions. (2marks)
ii) Give two example of computer malware: virus, spyware worms, Trojan,
etc. (2marks)
iii) Explain any three way in which computer devices acquire Malware
(6marks)
Computer can acquire malware through different ways includes
Through storage media: malware are usually transmitted through media
storage by sending or receiving files such us flash disk memory cards etc.
Through internet: during downloading music or other files malicious software
can be downloaded from internet to your computer device
Through receiving mail message: the message we receive every day contains
same malware that can attack our device.

8. Consider the table below and answer the questions:


ACCOUNT
CustomerI AccountNu AccountTyp DateOpene
Balance
D mber e d
1001 9987 Checking 10/12/1989 4000.00
1001 9980 Savings 10/12/1989 2000.00
1002 8811 Savings 01/05/1992 1000.00
1003 4422 Checking 12/01/1994 6000.00
Balance
D mber e d
1001 9987 Checking 10/12/1989 4000.00
1001 9980 Savings 10/12/1989 2000.00
1002 8811 Savings 01/05/1992 1000.00
1003 4422 Checking 12/01/1994 6000.00
1003 4433 Savings 12/01/1994 9000.00
1004 3322 Savings 08/22/1994 500.000
1004 1122 Checking 11/13/1988 800.000

CUSTOMER
Customer
Names Address City State Zip
ID
123
1001 Smith Smithville KY 91232
Lexington
12 Davis
1002 Jones Smithville KY 91232
Ave.
443
1003 Axen Grinder Broadville GA 81992
Ln.
661
1004 Builder Parker Streetville GA 81990
Rd.

Question: Design the following queries. (2marks )


• List all the details of customers.
Rep/select * from customer;
b) List all the different account types. (2marks)
Rep/ select distinct AccountType from account;

c Display all customers whose the names contain the character “n”.
(2marks)
Rep/select * from customer where names like ‘%n%’;
d) Find the total savings of all customers.
(2marks)
Rep/select sum(balance) as Total from account where
AccountType=’Savings’;
e) What will be the output of the following sql query (2marks)
Select* from ACCOUNT where AccountNumber <=4422 and balance
>500.00;
CustomerI AccountNu AccountTyp DateOpene
Balance
D mber e d
1003 4422 Checking 12/01/1994 6000.00
Select* from ACCOUNT where AccountNumber <=4422 and balance
>500.00;
CustomerI AccountNu AccountTyp DateOpene
Balance
D mber e d
1003 4422 Checking 12/01/1994 6000.00
1004 1122 Checking 11/13/1988 800.000

9.With Diagram compare a list and a tree.


(5marks)

Rep: Definition:
• A list is a collection of data in which each element of the list contains
the location of the next element. /
2.5marks
• A tree consists of a finite set of elements, called Nodes (or vertices),
and finite set of directed lines, called Arcs, that connect pairs of the
nodes. /2.5marks

10. Video conferencing is a method of communication that uses the web to


connect a group of people via a live video and audio feed
Advantages:
Saves time and money.
No traveling required.
It's Efficient.
Brings remote workers and telecommuters together.
More personal and engaging than phone conferencing alone.
Increased efficiency and productivity.
Improves relationships.
It Connects Teams.

You might also like