SOLVED PABSON Kathmandu – Mid Terminal Examination 2082 – COMPUTER
SCIENCE – SET B
Attempt
all questions.
Group ‘A'(10 Marks)
1. Answer the following questions
in one sentence: (6´1=6)
a) Name any two connectors used in computer
network.
BNC and RJ-45
connectors are the any two connectors used in computer network
b) List any two examples of power protection
device.
Any two
examples of power protection device are volt guard and UPS
c) What is social media?
Social media
is an online platform that allows people to share information, ideas, and
communicate with others.
d) Write any two application of Artificial
Intelligence.
Any two
applications of Artificial Intelligence are speech recognition and self-driving
cars.
e) What is database?
A database is
an organized collection of data that can be easily accessed, managed, and
updated.
f) What is actual parameter in QBASIC?
An actual
parameter in QBASIC is the real value or variable passed to a subroutine or
function when it is called.
2. Write appropriate technical
term for the following: (2´1=2)
a)
A network device that connects
dissimilar networks with different protocols. Gateway
b)
A system of paying for goods and
services through an electronic medium. Online payment
3. Write the full form of the following: (2´1=2)
a)
Wi-Fi → Wireless Fidelity
b) G2C → Government to Citizen
Group ‘B' (24 Marks)
4. Answer the following questions: (9´2=18)
a)
What is communication? List the three
basic elements of any communication system.
The process of sending and receiving data
and information between two or more than two people is known as communication.
Three basic elements are: Sender, Medium,
Receiver.
b) What is digital footprint?
A digital footprint is the trail of data and information left behind by
an individual's online activities which includes social media posts, website
visits, online purchases, and other digital engagements
c)
What is biometrics? What does biometrics
use for user authentication?
Biometric is a technology that uses unique
physical or behavioral characteristics, such as fingerprints, facial
recognition, or voice patterns, to identify and authenticate individuals.
It uses fingerprints, face recognition,
iris patterns, or voice recognition for user authentication.
d) Mention any one advantage and disadvantage of
e-commerce.
Advantage:
E-commerce allows to shop 24/7 from anywhere with an internet connection.
Disadvantage:
Risk of online fraud and security issues.
e) What are the goals of E-Government?
The goals of E-Government are:
v Citizens can access government services and information
conveniently from anywhere.
v Reduces paperwork and manual processes, saving time and
resources.
v Promote transparency by making government actions and
decisions visible to the public.
f) What is record? Why is primary key necessary
in record?
A record is a
row in a table which contains information about single items in a database.
Record is complete set of information.
A primary key
is necessary in a database record because it reduce and control
duplication of the record in a table, sets the relationship between tables and
identifies each record of a table uniquely.
g) Differentiate between sorting and filtering.
Sorting |
Filtering |
The process of arranging all
the records in a table either ascending or descending order based on field or
fields is known as sorting. |
Filtering is the process of
viewing required record of a table that matches the specifies criteria. |
Sorting affects the entire
dataset. |
Filtering only affects the data
that is displayed. |
h) What is query? Mention the different types of
action 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.
Types of
action queries:
1. Update
Query
2. Delete
Query
3. Append
Query
4. Make-Table
Query
i)
What is report? Why it is important?
Report is one
of the MS-Access database objects used to present information in an effective
and organized format that is ready for printing.
It is important because it summarizes
information for decision-making, analysis, and sharing results.
5. Write
down the output of the given program. (Show with dry run in table. (2)
DECLARE SUB TEST(S$ )
CLS
E$ ="
PABSON"
CALL TEST (E$)
END
SUB TEST (S$)
FOR I = 1 to
LEN (S$)
IF i MOD 2 < > 0 THEN
EE$ = EE$+LCASE$(MID$(S$,I,1))
ELSE
EE$=EE$+UCASE$(MID$(S$,I,1))
END IF
NEXT I
PRINT EE$
END SUB
Dry Run Table
E$ |
S$ |
I
= 1 to LEN (S$) |
IF
i MOD 2 < > 0? |
Yes EE$
= EE$+LCASE$(MID$(S$,I,1)) |
No EE$=EE$+UCASE$(MID$(S$,I,1)) |
PRINT
EE$ |
PABSON |
PABSON |
1 to 6 yes |
1 mod 2<>0 1=0 Yes |
p |
|
|
|
|
2 to 6 yes |
2 mod 2=0 0=0 no |
|
A |
|
|
|
3 to 6 yes |
3 mod 2=0 1=0 yes |
b |
|
|
|
|
4 to 6 yes |
4 mod 2=0 0=0 no |
|
S |
|
|
|
5 to 6 yes |
5 mod 2=0 1=0 yes |
o |
|
|
|
|
6 to 6 yes |
6 mod 2=0 0=0 no |
|
N |
|
|
|
7 to 6 no Loop exits |
|
|
|
pAbSoN |
The Output of the program:
pAbSoN
6. Re-write the given program
after correcting the bugs: (2)
REM To check the supplied no. is odd or even
DECLARE FUNCTION Check$ (X)
CLS
ACCEPT “ANY NUMBER:”; N
CALL Check$ (X)
END
SUB Check$ (N)
Y=2
R= Y MOD N
IF R=0 THEN
C$= “EVEN”
ELSE
C$= “ODD”
END
C$=Check$
END FUNCTION
Debugged Program
REM To check the supplied number is odd or even
DECLARE FUNCTION Check$ (X)
CLS
INPUT "ANY
NUMBER: "; N
PRINT Check$(N)
END
FUNCTION Check$ (X)
Y = 2
R = X MOD Y
IF R = 0 THEN
Check$ = "EVEN"
ELSE
Check$ = "ODD"
END IF
END FUNCTION
7. Study the following program and answer the given questions: (2´1=2)
DECLARE SUB
TEST (B$)
CLS
INPUT W$
CALL TEST (W$)
END
SUB TEST (B$)
FOR I =1 To LEN (B$)
PRINT RIGHT$(B$), i)
NEXT I
END SUB
Questions:
a)
Write the name of two built in functions
used in the above program.
The name of two built in functions used in
the above program are LEN( ) and RIGHT$( ).
b) List the formal parameters of the above
program.
The formal parameters of the above program
is B$.
Group
‘C’ (16 Marks)
8. Convert / Calculate as per the instruction: (4´1= 4)
i) (231)8
= (?)10 ii)
(1D3)16 = (?)2
iii) (111001
- 11) + 111001 iv)(101101 ÷ 110)
9. Answer the following. (4´2= 8)
a) WAP
to calculate area of rectangle using SUB…. END SUB and
area
of circle using FUNCTION…. END Function. ‘
REM Area of Rectangle using SUB
DECLARE SUB AOR (L, B)
DECLARE FUNCTION AOC (R)
CLS
INPUT "Enter Length of Rectangle:
"; L
INPUT "Enter Breadth of Rectangle:
"; B
INPUT "Enter Radius of Circle: "; R
CALL AOR(L, B)
PRINT "Area of Circle = "; AOC(R)
END
SUB AOR (L, B)
A =
L * B
PRINT "Area of Rectangle = "; A
END SUB
FUNCTION AOC (R)
AOC
= 22/7 * R ^ 2
END FUNCTION
b) Write
a program to ask a number and check it is exactly divisible by 4 and 6 using
SUB……END SUB.
REM Check divisibility by 4 and 6
DECLARE SUB Check (N)
CLS
INPUT "Enter any number: "; N
CALL Check(N)
END
SUB Check (N)
IF
N MOD 4 = 0 AND N MOD 6 = 0 THEN
PRINT N; " is divisible by both 4 and 6"
ELSE
PRINT N; " is NOT divisible by both 4 and 6"
END
IF
END SUB
10. WAP
to find sum of digits of a number using SUB….END SUB. (4)
[Hint:
456: 4+5+6=15]
REM Sum of
digits using SUB
DECLARE SUB
Sum (N)
CLS
INPUT
"Enter a number: "; N
CALL Sum(N)
END
SUB Sum (N)
S = 0
WHILE N <> 0
R = N MOD 10
S = S + R
N = N \ 10
WEND
PRINT "Sum of digits = "; S
END SUB
.
or
Write a program in QBASIC to display sum of
first 10 natural numbers using FUNCTION…. END
FUNCTION.
REM Sum of first 10 natural numbers using FUNCTION
DECLARE FUNCTION Sum()
CLS
PRINT "Sum of first 10 natural numbers = "; Sum
END
FUNCTION Sum()
S = 0
FOR I = 1 TO 10
S = S + I
NEXT I
Sum = S
END FUNCTION
?ÿ@
No comments:
Post a Comment