SOLVED KAVRE PABSON - SEE PRE QUALIFYING EXAMINATION 2080 - COMPUTER SCIENCE
Subject
:Computer Science
Time: 1 hr. 30 min
Full
Marks:50
Class: X
Group-A
1. Very short answer questions:
a) What is communication?
Ans:
Communication is sending and receiving information between two or more persons.
b) Which data type is used to store picture in Ms-Access?
Ans:
The data type which is used to store picture in Ms-Access is OLE.
c) Define computer security.
Ans:
Computer security means protecting computer and its
content from damage, theft or misuse and action to prevent such incidents
d) What is E-commerce?
Ans:
E-commerce refers to the buying and selling of goods or services using the
internet.
e) What is formal parameter?
Ans:
Parameters are variables that will receive data (arguments value) sent to the
procedures (SUB program and FUNCTION).
f) Define C-programming.
Ans:
C language is a structured programming language that divides program into many
functions.
2.
Write appropriate technical terms for the following: [2×1=2]
a)
The mode of data communication in which data can be transferred in both
directions at a time.
Full Duplex Mode
b)
A unique numerical identifier for every device or network that connects to the
internet. IP Address
3.
Write down the full form of the following: [2×1=2]
a)
SMTP - Simple Mail Transfer Protocol.
b)
MODEM - Modulator-Demodulator.
Group-B
4.
Short Answer Questions: 9×2=18
a) Distinguish between STP and UTP.
Ans:
The difference between shielded and unshielded twisted pair cables are:
STP |
UTP |
UTP
cable is a twisted pair cable with wires that are twisted together |
It
is enclosed within a foil or mesh shield. |
the
UTP cable is used to establish the connection within a short distance, like a
home or small industry. |
Generally,
it is used to establish the connection for enterprises over a long distance. |
b) Explain about star topology with the help of diagram.
Ans:
The
network topology which connects all nodes to central device called
hub/switch through a cable is called star topology. It provides fast performance and low network traffic. The failure of one
node does not affect the rest of the nodes.
Diagram
c) Write about opportunities and threats in social media.
Ans:
Opportunities of using social media
a) It creates awareness and innovate the way people live
b) Social media let us share anything with others around the
world.
c) It keeps us informed about the world.
d) It creates brand exposure for business to the largest
audience.
Threats of using social media
a) Personal data and privacy can be easily hacked and shared
on the internet.
b) More chances of creating fake accounts.
c) Negative impact on the health.
d)
Decrease the working efficiency of people.
e)
Spreading false or unreliable information.
d) Define table in a database? Explain why it is important.
Ans:
Table is a database object that
stores a collection of related data organized in rows and columns, where each
row represents a record and each column represents a field or attribute of that
record.
It is important because entire data is
managed and kept in a table for the future retrieval process. It makes sure that
the information stays accurate and consistent.
e) Distinguish between validation rule and validation text.
Ans:
The difference between validation rule and validation text is
Validation
Rule |
Validation
Text |
A
rule that specifies the valid values or ranges of values that can be entered
in the field. |
A
message that appears if a user enters invalid data in the field. |
f) What is an online payment (electronic payment)? Make a list most
common payment platforms used in Nepal.
Ans; Online
payment refers to the payment for buying goods or services
through the Internet using different online payment gateway. E.g. e-Sewa
Nepal, i-Pay, Khalti, e-banking, etc.
g) "Artificial Intelligence is threat to humans". Give
your opinion.
Ans:
AI can be a threats to human. AI could become
uncontrollable and pose a threat to humanity. This could happen if AI systems
become more intelligent than humans and begin to act on their own, without
human guidance or control. AI could
be used for bad things like cyber attacks or making weapons that can decide on
their own who to attack, causing a lot of harm. It's like giving a sharp knife
to a toddler - bad idea
h) What is global variable? How it is declared?
Ans:
Variables which are declared outside the procedure and whose values can be
accessed from any procedure or module are called global variables. It is declared by using DIM SHARED or
COMMON SHARED statement.
i) Define built in function? Explain about the use of LEN() function
in QBASIC.
Ans:
Built-in functions are readymade
functions provided by QBASIC. LEN ( ) function returns the number of characters
in a string or the number of bytes required to store a variable.
5. Write down the output of the following program
with dry run table.
DECLARE
SUB REG(M,N$,T)
CLS
A=1
X$=”PABSON”
CALL
REG(A,X$,T)
END
SUB
REG(M,N$,T)
FOR
I=LEN(N$) TO 1 STEP-1
PRINT
MID$(N$,I,M)
M=M+1
NEXT
I
END
SUB
Dry Run
A |
X$ |
M |
T |
I=LEN(N$)
TO 1 STEP-1 |
PRINT MID$(N$,I,M) |
1 |
PABSON |
1 |
0 |
6
TO 1 STEP-1 Yes |
MID$(PABSON,6,1) N |
|
|
2 |
|
5
TO 1 STEP -1 Yes |
MID$(PABSON,5,1) ON |
|
|
3 |
|
4
TO 1 STEP -1 Yes |
MID$(PABSON,4,1) SON |
|
|
4 |
|
3
TO 1 STEP -1 Yes |
MID$(PABSON,3,1) BSON |
|
|
5 |
|
2
TO 1 STEP -1 Yes |
MID$(PABSON,2,1) ABSON |
|
|
6 |
|
1
TO 1 STEP -1 Yes |
MID$(PABSON,1,1) PABSON |
|
|
7 |
|
0
TO 1 STEP -1 No Loop Exits |
|
The output of the program is :
N
ON
SON
BSON
ABSON
PABSON
6. Re-Write the given program after correcting the bugs:
DECLARE
FUNCTION RESULT$(X,Y)
CLS
INPUT
“Enter marks in math:”, M
R$=RESULT$(X,N)
PRINT
M$
END
FUNCTION
FUNCTION
RESULT$(X,Y)
IF
X>=40 AND Y>=40 THEN
RESULT$
= "Pass"
ELSE
RESULT$
= "Fail"
END
IF
END
SUB
Debugged Program
DECLARE
FUNCTION RESULT$(X,Y)
CLS
INPUT
“Enter marks in math and science:”, M, N
R$=RESULT$(M,N)
PRINT
R$
END
FUNCTION
RESULT$(X,Y)
IF
X>=40 AND Y>=40 THEN
RESULT$
= "Pass"
ELSE
RESULT$
= "Fail"
END
IF
END
FUNCTION
7. Study the following program and answer the given questions:
DECLARE
FUNCTION MATH$(R)
CLS
DIM
SHARED P
INPUT
"Enter first number:"; P
INPUT
"Enter second number:"; C
Y$
= MATH$(C)
PRINT
Y$
END
FUNCTION
MATH$(R)
F=100
MOD R
IF
20 MOD P > 3 AND F < P THEN
MATH$=”True”
ELSE
MATH$=”False”
END
IF
END
FUNCTION
a) Variable P remained uncalled in the main module. Why?
Ans:
Variable P remained uncalled in the main module because P is declared as global
variable and its value can be accessed by MATHS$ ( ) function without passing
the value.
b) Find the output if the user supplies P=9 and c=4 running the
program.
Ans:
The output of the program if the user supplies P=9 and c=4 running the program
is:
False
Dry
Run
P |
C |
R |
F=100
MOD R |
20
MOD P > 3 AND F
< P |
PRINT
Y$ |
9 |
4 |
4 |
100
MOD 4 =0 |
20
MOD 9 >3 2>3
AND 0<9 Yes
AND No No |
False |
Group-C
8. Convert as instructed:
a)
(B7D)16=(?)8
b)
(645)10=(?)16
c)
(10101)2 ×(110)2
d)
(1110101)2 × (110)2
9. a) Write a program in QBASIC to input length and breadth of a
rectangle and calculate area using function-procedure and perimeter using
sub-procedure.[4]
DECLARE FUNCTION
AREA (L, B)
DECLARE SUB
PER (L, B)
CLS
INPUT
“ENTER LENGTH”; L
INPUT
“ENTER BREADTH”; B
PRINT
“AREA OF RECTANGLE=”; AREA(L,B)
CALL PER(L,B)
END
FUNCTION
AREA (L, B)
AREA = L *
B
END FUNCTION
SUB PER
(L, B)
P = 2 * (L
+ B)
PRINT “PERIMETER
OF RECTANGLE=”;P
END SUB
b) A sequential data file named “user.dat” has data under the fields
[ Name, Age, Sex, Contact No and Address ]. Write a program that displays the
record of those users whose age is more than 35. [4]
OPEN
“user.dat” FOR INPUT AS #1
CLS
PRINT
“Name”, “Age”, “Sex”, “Contact No.”, “Address”
WHILE
NOT EOF(1)
INPUT
#1, N$, A, S$, C, D$
IF
A>35 THEN PRINT N$, A, S$, C, D$
WEND
CLOSE
#1
END
10. Write a C program to find sum of the numbers from 22 to 32 using
FOR loop.
#include
<stdio.h>
int
main ( )
{
int i, sum = 0;
for (i = 22; i <= 32; i++) {
sum += i;
}
printf("The sum of the numbers from 22
to 32 is: %d\n", sum);
return 0;
}
Write a program in C that asks a number and check whether it is
positive, negative or zero.
#include
<stdio.h>
int
main()
{
int number;
printf("Enter a number: ");
scanf("%d", &number);
if (number > 0)
{
printf("%d is positive\n",
number);
}
else
if (number < 0)
{
printf("%d is negative\n",
number);
}
else
{
printf("%d is zero\n",
number);
}
return 0;
}