SOLVED PABSON Kathmandu SEE COMPUTER SCIENCE 2081 FIRST TERMINAL EXAMINATION-2081[B]
FIRST TERMINAL EXAMINATION-2081
Subject: Opt. II Computer Science Full
Marks: 50
Class: 10 Time:
2 hrs.
Candidates are required to answer the
questions in their own way words as far as practicable. Figures in the margin indicate
the full marks.
Attempt
all questions.
Group ‘A'
1. Answer the following questions in one sentence: (6´1=6)
a) What is
an uploading?
Upload is the process of transferring
files or data from user’s computer or device to a remote server or another
device.
b) Write
few popular ISP's of Nepal.
Mercantile and Wlink, are few popular ISP’s
of Nepal
c) List
any two examples of cybercrimes.
Ay two cybercrimes are phishing and
hacking.
d) List
any two services of internet.
Any two services of internet are E-Mail
and E-Commerce.
e) What is
local variable in QBASIC?
A
variable which is defined in a module and is not accessible to any other module
is called local variable.
f)
Which statement is used to call FUNCTION
and SUB procedure?
A SUB procedure is called using the CALL
statement.
A FUNCTION procedure is called using its
name in an expression or an assignment statement.
2. Write appropriate technical term for the following: (2´1=2)
a) A group of
computers that functions both as a client and server.
Peer to Peer Network
b) The
unauthorized duplication and use of computer software.
Software Piracy
3. Write the full form of the following: (2´1=2)
a) URL – Uniform
Resource Locator
b) ICT - Information and Communication
Technology
Group ‘B'
4. Answer the following questions: (9´2=18)
a)
Write any two advantages and
disadvantages of computer network.
Any
two advantages of computer network are:
v
Users can share resources like hardware
(printers) and software (applications) across the network.
v
Allows users to easily share and access files
from different computers.
Any two disadvantages
of computer network are:
v
Networks can be hacked, leading to loss or theft
of important data.
v
Keeping a network running smoothly can be
expensive and requires regular updates.
b) What is
network connecting device? Write any two of them.
A network connecting device is hardware
that connects computers and devices to enable communication, data sharing, and
resource access. Any two network connecting devices are router and switch.
c) What is
data communication mode? List its type.
Data
transmission mode is the way of transmission of data from one location to
another.
Its types
are:
Simplex mode is the transmission
of data and information that takes place in only one direction.
Half-duplex is the transmission of
data and information that flows in both directions but only one direction at a
time
Full duplex mode is the
transmission of data and information that flows in both direction
simultaneously on the transmission path
d) What is
internet? Write any one negative impact of internet.
The Internet
is a global network of connected devices enabling communication, information
sharing, and access to online services.
Any one
negative impact of internet is:
Personal
information can be exposed to hackers or misused by online services.
e) What is
cyber law? Why is it important?
The law which
governs the legal issues in the cyber space regarding the internet or WWW for
digital data processing and transaction is called cyber law.
The
importance of cyber law is that it controls cyber-crime and misuse of computer.
f) What is
hacking? What is the purpose of hacking?
Hacking is
the act of gaining unauthorized access to computer systems, networks, or
devices to manipulate, steal, or disrupt data.
The purpose
of hacking is to steal personal or sensitive information, damage systems, or
disrupt services.
g) What is
digital signature? Why is it necessary in E-commerce?
Digital signature is a security mechanism system used on
the internet for data and information transaction by attaching a code at the
end of the electronic message that confirms the authenticity of sent message.
It is necessary
in E-commerce to provide legal framework to facilitate and safeguard electronic
transaction in the electronic media.
h) Differentiate
between SUB and FUNCTION procedure.
Sub procedure |
Function procedure |
Sub procedure name cannot have type declaration
sign |
Function procedure name not have type declaration
sign |
Sub procedure does not return value to calling
module |
Function procedure returns value to the calling
module |
i) Define
'formal parameter' and 'actual parameter'.
Formal parameter are variables which are used to specify or declare types
of data to be passed to the procedure either sub or function.
Actual parameter is argument which is used to pass real value or data to
the procedure.
5. Write
down the output of the given program. \Show with dry run in table. (2)
DECLARE SUB
SERU ( )
CLS
CALL SERU
END
SUB SERU ( )
X=2
C=1
WHILE
C<=10
S=X^C
PRINT S;
C=C+1
WEND
END SUB
Dry Run
X |
C |
C<=10 |
S=X^C |
PRINT
S; |
C=C+1 |
2 |
1 |
1<=10
Yes |
2^1=2 |
2 |
1+1=2 |
|
2 |
2<=10
Yes |
2^2=4 |
4 |
2+1=3 |
|
3 |
3<=10
Yes |
2^3=8 |
8 |
3+1=4 |
|
4 |
4<=10
Yes |
2^4=16 |
16 |
4+1=5 |
|
5 |
5<=10
Yes |
2^5=32 |
32 |
5+1=6 |
|
6 |
6<=10
Yes |
2^6=64 |
64 |
6+1=7 |
|
7 |
7<=10
Yes |
2^7=128 |
128 |
7+1=8 |
|
8 |
8<=10
Yes |
2^8=256 |
256 |
8+1=9 |
|
9 |
9<=10
Yes |
2^9=512 |
512 |
9+1=10 |
|
10 |
10<=10
Yes |
2^10=1024 |
1024 |
10+1=11 |
|
11 |
11<=10
No Loop
Exits |
|
|
|
The output of the program is
2 4 8
16 32 64 128 256
512 1024
6. Re-write the given program
after correcting the bugs: (2)
CREATE FUNCTION SQUA(A)
REM to print square of a number
CLS
Get "Enter a number"; A
Call SQUA(A)
END
FUNCTION
SQUA(A)
ANS=A^2
8ANS=SQUA
END FUNCTION
Debugged Program
DECLARE FUNCTION SQUA(A)
REM to print square of a number
CLS
INPUT "Enter a number"; A
PRINT SQUA(A)
END
FUNCTION
SQUA(A)
ANS=A^2
SQUA =
ANS
END FUNCTION
7. Study the following program and answer the given questions:
(2´1=2)
DECLARE SUB
RESULT(A$)
A$="COMPUTER"
CALL
RESULT(A$)
END
SUB
RESULT(A$)
FOR I= 1 TO
LEN(A$) STEP 2
X$=MID$(A$,C,
I )
PRINT X$;
NEXT I
END SUB
Questions:
a) List
the library functions used in above program.
The library functions used in above
program are
LEN ( ) and
MID$ ( )
b) How
many times loop executes in above program.
The loop executes four times in above program.
Group
‘C'
Long question Answers: (4´4=16)
8. Convert / calculate as per the instruction:
i) (111101 -
1101) + (11011)
|
1 |
1 |
1 |
1 |
0 |
1 |
|
|
- |
1 |
1 |
0 |
1 |
0 |
1 |
1 |
0 |
0 |
0 |
0 |
|
+ |
1 |
1 |
0 |
1 |
1 |
1 |
0 |
0 |
1 |
0 |
1 |
1 |
(111101 -
1101) + (11011) = (1001011)
ii) (110111
11) |
1 |
1 |
0 |
1 |
1 |
1 |
(10010 |
|
1 |
1 |
|
|
|
|
|
|
|
0 |
0 |
1 |
1 |
|
|
|
|
|
|
1 |
1 |
|
|
|
|
|
|
0 |
0 |
|
|
|
|
|
|
|
1 |
|
|
|
|
|
|
|
1 |
|
|
Q = 10010
R = 1
1 |
0 |
0 |
1 |
0 |
+ |
1 |
1 |
0 |
1 |
1 |
1 |
1 |
1 |
1 |
(110111
iii) (129 )10 into binary
Divide by the
base 2 to get the digits from the remainders:
Division |
Quotient |
Remainder (Digit) |
(129)/2 |
64 |
1 |
(64)/2 |
32 |
0 |
(32)/2 |
16 |
0 |
(16)/2 |
8 |
0 |
(8)/2 |
4 |
0 |
(4)/2 |
2 |
0 |
(2)/2 |
1 |
0 |
(1)/2 |
0 |
1 |
= (10000001)2
(129 )10 = (10000001)2
iv) ( DA3 )16
into decimal
(DA3 )₁₆
= (13 × 162)
+ (10 × 161) + (3 × 160)
=13 x 256 +
10 x 16 + 3 x 1
=3328 + 160 +
3
=3491
( DA3 )16
=(3491)10
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)
CLS
INPUT “Enter Radius”; R
INPUT
“Enter Height”; H
PRINT
“Area of circle”; AREA(R)
CALL
VOL(R, H)
END
FUNCTION
AREA(R)
A
= 22/7 * R ^ 2
PRINT
“Area if circle=”; A
END
FUNCTION
SUB
VOL(R)
V
= 22/7 * R ^ 2 * H
PRINT
“Volume of cylinder=”; V
END
SUB
b) WAP to reverse a number using SUB…END SUB.
DECLARE SUB REV
(N)
CLS
INPUT
"ENTER ANY NUMBER"; N
CALL REV (N)
END
SUB REV (N)
S = 0
WHILE N <
> 0
R = N MOD 10
S = S * 10 + R
N = N \ 10
WEND
PRINT "REVERSED
DIGITS="; S
END SUB
10. Write FUNCTION program to check whether
the supplied number is divisible by 5 or not.
DECLARE
FUNCTION CHECK$ (N)
INPUT
“ENTER ANY NUMBER”; N
PRINT
“THE NUMBER IS”; CHECK$ (N)
END
FUNCTION
CHECK$ (N)
IF
N MOD 5 = 0 THEN
CHECK$
= “Divisible by 5”
ELSE
CHECK$
= “Not divisible by 5”
END
IF
END
FUNCTION
Or
Write a program to count the occurrence of
letter 'a' in the supplied string using SUB…END SUB.
DECLARE
SUB COUNT (S$)
CLS
INPUT
"ENTER ANY STRING"; S$
CALL
COUNT(S$)
END
SUB COUNT
(S$)
AC = 0
FOR I = 1
TO LEN(S$)
B$ =
MID$(S$, I, 1)
C$ =
UCASE$(B$)
IF C$ =
"A" THEN AC = AC + 1
NEXT I
PRINT
"TOTAL NO. OF LETTER E = "; AC
END SUB
?ÿ@
No comments:
Post a Comment