PABSON,
KATHMANDU
SEE
PRE-QUALIFYING EXAMINATION-2081
Subject-Opt
II. Computer Science
Time:
2 hrs
Attempt all
questions.
Group
A [20 Marks]
1. Answer the
following questions in one sentence: (6x1=6)
a)
List
any two examples of unguided media.
Satellite and Microwave are the two examples of unguided media.
b)
Write
any one disadvantage of social media.
Any
one disadvantage of social media is:
Personal
information can be exposed or misused.
c)
What
is the purpose of table in database?
The
purpose of table is to store data in an organized way. i.e. row and column.
d)
What
data type is used to store images in MS - Access?
OLE
object data type is used to store images in MS – Access.
e)
What
is the use of EOF( ) function?
The
use of EOF ( ) function is to determine whether a record is last or not.
f)
What
is the function of scanf( ) and printf( ) in C language?
scanf( ) is used to input all types of data and printf( )
is used for output of all types of data .
2. Write the
technical term for the following statements:
a)
Device
used to connect a PC with a telephone line. MODEM
b)
Law
that governs the legal issues in cyberspace. Cyber Law
3. Write the
full forms of the following:
a)
TCP/IP
– Transmission Control Protocol / Internet Protocol
b)
BIT
– binary digit
Group B [24 Marks]
4. Answer the following questions: [9 x 2=18]
a)
What is network topology? Write down the advantages of BUS topology.
Network topology is
the cabling structure of a network.
Advantages of bus
topology:
It’s
easy to set up and doesn’t require a lot of cables.
It
is used in small networks where not many devices are connected.
b)
What is computer ethics? Write any two commandments of it.
Computer
ethics is a set of moral principles or code of conducts that regulate the use
of computers systematically without making harm to other users.
Any two commandments of computer ethics are:
We should not snoop around the others computers files
We should not steal others data.
c)
What is biometric verification?
Biometric verification is the process of using unique
physical or behavioral characteristics, like fingerprints or facial features,
to confirm a person's identity.
d)
Differentiate between traditional commerce and e-commerce.
Traditional Commerce |
E-commerce |
Traditional commerce refers
to the buying and selling of goods and services from person to person without use
of internet. |
E-commerce refers
to the buying and selling of goods and services over the internet |
Its accessibility
is for limited time in a day. |
Its accessibility
is 24×7×365 means round the clock. |
e)
Define cloud computing? Name any two services of it.
Cloud computing is a
technology that allows users to access and manage computing resources such as servers,
storage, and applications over the internet.
Any two
services of cloud computing are:
IaaS (Infrastructure
as a Service)
PaaS
(Platform as a Service)
f)
What is DBMS? Give some example of DBMS.
DBMS is a software that stores
data, processes them and provides information in an organized form. E.g.
MS-Access, Oracle, MySQL, Fox Pro etc.
g)
What is data sorting?
The process of arranging all the
records in a table either ascending or descending order based on field or
fields is known as sorting. Sorted data is easier to handle than unsorted data.
h)
What is query? List the different type of query.
Query is an object of database
that is used to view, retrieve, change and analyze records from a table or
multiple linked tables based on specified condition.
The different type of query are:
Select Query
Action Query (Update, Delete, Append and Make
Table Query)
i) List any two major
differences between forms and reports.
Form |
Report |
Form is primarily used for entering
data |
Report is used for presenting the
data. |
Form is designed to be used on
screen. |
Report are designed to be printed. |
Write the output of
the given program showing the dry run table. (2)
DECLARE FUNCTION
OUT (A, B)
CLS
A=17
B=7
PRINT OUT (A, B)
END
FUNCTION OUT (A, B)
R=A MOD B
IF R MOD 2=0 THEN
C=R MOD 6+30
ELSE
C=R MOD 6+15
ENDIF
D=C\5
OUT=D
END FUNCTION
Dry Run Table
A |
B |
PRINT
OUT (A,B) |
R=A
MOD B |
IS
R MOD 2=0? |
YES C=R
MOD 6 + 30 |
NO C=R
MOD 6 + 15 |
D=C\5 |
OUT=D |
17 |
7 |
3 |
17
MOD 7 =3 |
3
MOD 2=0? 1=0?
NO |
|
3
MOD 6 + =3+15=18 |
18\5 =3 |
OUT=3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The output of the
program is :
3
6. Re-write the
following program correcting the bug.
REM To store name,
age and salary in a sequential data file REC.DAT
CLS OPEN
"Employee.dat" FOR OUTPUT AS #1
DO
INPUT "Enter
employee's name"; N$
INPUT "Enter
employee's address"; A$
INPUT "Enter
employee's age"; Al
INPUT "Enter
employee's gender";G$
INPUT "Enter
employee's salary";S
WRITE #1,A$,AI,G$,S
INPUT "Add
more records(Y/N)";A
LOOP WHILE
UCASE(A$)="Y"
CLOSE 1
END
Debugged Program
REM To store name,
age and salary in a sequential data file REC.DAT
CLS
OPEN "REC.DAT " FOR OUTPUT AS #1
DO
INPUT "Enter
employee's name"; N$
INPUT "Enter
employee's address"; A$
INPUT "Enter
employee's age"; Al
INPUT "Enter
employee's gender";G$
INPUT "Enter
employee's salary";S
WRITE #1,A$,AI,G$,S
INPUT "Add
more records(Y/N)";A$
LOOP WHILE UCASE$(A$)="Y"
CLOSE #1
END
7. Read the program
given below and answer the questions that follows.(2)
DECLARE SUB FACTORS(N)
N=10
CALL FACTORS(N)
END
SUB FACTORS(N)
FOR J=1 TO N
R=N MOD J
IF R=0 THEN PRINT J;
NEXT J
END SUB
Questions:
a) Write down the use of MOD in the program.
The use of MOD is
to return remainder in the program.
b) How many time the loop executes in the above program?
The loop executes 10 times in the
above program.
Group C [16 Marks]
8. Convert /Calculate
as per the instructions. (4 x 1)
i. (111011 + 11011)
– (10011)
|
|
1 |
1 |
1 |
0 |
1 |
1 |
|
|
+ |
1 |
1 |
0 |
1 |
1 |
|
1 |
0 |
1 |
0 |
1 |
1 |
0 |
|
|
- |
1 |
0 |
0 |
1 |
1 |
|
1 |
0 |
0 |
0 |
0 |
1 |
1 |
(111011 + 11011) –
(10011) = (1000011)
ii. (10011 x 101) ¸ 111
|
|
|
1 |
0 |
0 |
1 |
1 |
|
|
|
|
× |
1 |
0 |
1 |
|
|
|
1 |
0 |
0 |
1 |
1 |
|
|
0 |
0 |
0 |
0 |
0 |
× |
|
1 |
0 |
0 |
1 |
1 |
× |
× |
|
1 |
0 |
1 |
1 |
1 |
1 |
1 |
111) |
1 |
0 |
1 |
1 |
1 |
1 |
1 |
(1101 |
|
|
1 |
1 |
1 |
|
|
|
|
|
|
1 |
0 |
0 |
1 |
|
|
|
|
|
|
1 |
1 |
1 |
|
|
|
|
|
0 |
0 |
1 |
0 |
1 |
1 |
|
|
|
|
|
|
1 |
1 |
1 |
|
|
|
0 |
0 |
0 |
1 |
0 |
0 |
|
Q = 1101
R = 100
iii. (458)10 into
octal
Soln:
Divide by the base 8 to get the digits
from the remainders:
Division |
Quotient |
Remainder (Digit) |
Digit # |
(458)/8 |
57 |
2 |
0 |
(57)/8 |
7 |
1 |
1 |
(7)/8 |
0 |
7 |
2 |
= (712)8
(458)10
= (712)8
iv. (8C3)16 into binary
Soln:
Convert each hex
digit to 4 binary digits (see conversion table below):
8C3
= 8 C 3
= 8 = 1000
C = 1100
3 = 0011
= 100011000011
(8C3)16 = (100011000011)2
9 a. Write a program in QBASIC that allow user
to enter radius of a circle. Create user define FUNCTION...END FUNCTION to find
area of circle and SUB...END SUB to find volume of a cylinder.
DECLARE FUNCTION AREA(R)
DECLARE SUB VOL(R,H)
CLS
INPUT “Enter Radius”; R
INPUT “Enter Height”; H
PRINT “Area of circle=”; AREA(R)
CALL VOL(R,H)
END
FUNCTION AREA(R)
AREA = 22/7 * R ^2
END FUNCTION
SUB VOL(R,H)
V = 22/7 * R ^ 2 * H
PRINT “Volume of cylinder=”; V
END SUB
b. Write a program to open data file new.dat which may contain
name, address, phone no. and salary. The program should allow user to add few
records on it. (4)
OPEN “NEW.DAT” FOR APPEND AS #1
DO
CLS
INPUT “ Enter Name”; N$
INPUT “ Enter Address”; A$
INPUT “Enter Phone no”; P
INPUT “Enter Salary”; S
WRITE #1, N$, A$, P, S
INPUT “Do you want to add more records (Y/N)”; CH$
LOOP WHILE UCASE$(CH$)=”Y”
CLOSE #1
END
10. Write a program in 'C' language to check whether the supplied
number is divisible by 5 or not.
(4)
#include
<stdio.h>
int main( )
{
int n;
printf("Enter a number: ");
scanf("%d", &n);
if (n % 5 == 0)
{
printf("The number is divisible by
5.");
}
else
{
printf("The number is not divisible
by 5.");
}
return 0;
}
OR
Write a program in 'C' language to find sum of
first ten natural numbers.
#include
<stdio.h>
int main()
{
int i, s = 0;
for (i = 1; i <= 10; i++)
{
s = s + i;
}
printf("The sum of the first 10
natural numbers is: %d\n", s);
return 0;
}
THE
END
No comments:
Post a Comment