Set
4: PABSON 2080 (Gandaki)
Opt.
II Computer Science
Time : 2 hours Full Marks: 50
Candidates are required
to give their answer according to the given instructions.
Attempt all
questions.
Group
'A
1. Answer the
following questions in one sentence.
a)
What is e-banking?
Ans:
E-banking refers to performing banking transactions online using the internet.
b)
What is mobile computing?
Ans:
Mobile computing refers to the use of portable computing devices like
smartphones and tablets to perform tasks and access data from anywhere.
c)
Give any two example of DBMS.
Ans:
Two examples of DBMS are MySQL and Oracle.
d)
Which view of Ms Access helps us to modify table?
Ans:
The Design View in MS Access helps us to modify a table.
e)
Write down the types of modular programming.
Ans:
Sub Procedure and Function procedure are the types of modular programming.
f)
Write any two name of data types used in C programming
language.
Ans:
Two data types in C are int and float.
2. Write
appropriate technical terms for the following.
a)
A
device that connects two dissimilar networks. Gateway
b)
The
technology to encode file or message. Encryption
3. Write the full
forms of the following:
a)
ISDN - Integrated Services Digital Network
b)
STP
- Shielded Twisted Pair
4. Answer the
following questions:
a)
What is browser? Give any two examples of browser.
Ans:
Web browser is a computer program that access web pages and displays them on
the user’s computer. Two examples are Google Chrome and Mozilla Firefox.
b)
Define digital footprint. How can you manage your
digital footprint?
Ans:
A digital footprint is the trail of data left behind by users on the internet. We
can manage it by controlling privacy settings, being cautious about sharing
personal information, and regularly reviewing online activities.
c)
What is software security? Write any two principles of
information security?
Ans:
Software security is the protection
of computer systems and applications from threats, such as hacking, virus
attacks, and unauthorized access, to ensure their confidentiality, integrity,
and availability. Two principles of information security are confidentiality
and integrity.
d)
What is E-commerce? Write any two advantages of E-commerce.
Ans:
E-commerce refers to the buying and selling of goods and services over the
internet.
Any
two advantages of e-commerce are:
·
Faster
buying/selling procedure, as well as easy to find products.
·
There
are no geographical limitations, can deliver service globally.
e)
What is contemporary technology? Write any two advantages
of cloud computing.
Ans:
Contemporary technology refers to modern-day technologies that are currently in
use.
Any
two advantages of cloud computing are:
It allows to quickly
and easily access, store information anywhere, anytime in the whole world,
using an internet connection.
It is easier to get back-up and restore the data.
f)
Differentiate between data and information with examples.
Ans:
The difference between data and information are:
Data |
Information |
Raw form of any facts, figures or
entities are known as data. |
The processed form of data is
known as information. |
For example, Aaradhya, 1000,
account, balance etc. are raw data individually does not give any meaning. |
For example, Aaradhya has 1000
balance in his bank account. Here Aaradhya, 1000, account, balance all have
their significant meaning. |
g)
What is RDBMS? Write any two examples of it.
Ans:
RDBMS is a type of DBMS that uses a relational model to organize and manage
data, allowing users to easily retrieve and manipulate it. Two examples are MySQL
and MS Access.
h)
What is key in DBMS? Write any two name of keys available
in DBMS.
Ans:
A key in DBMS is an attribute or set of attributes that uniquely identifies a
record. Two keys are Primary Key and Foreign Key.
i)
What is query? Write any two ways of creating query.
Ans:
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.
Any
two ways of creating query are Design View and Using Wizard.
5. Write down the
output of the given program. Show with dry run in table.
DECLARE SUB DTB
(N)
CLS
N = 5126
CALL DTB (N)
END
SUB DTB (N)
WHILE N < >
0
R = N MOD 10
S = S + R
N = N \ 10
WEND
PRINT S;
END SUB
Dry Run Table
N |
WHILE N <
>0 |
R = N MOD 10 |
S=S+R |
N=N\10 |
PRINT S; |
5126 |
5126<>0
YES |
=5126 MOD 10 =6 |
=0+6=6 |
5126\10 =512 |
14 |
|
512<>0 YES |
512 MOD 10 =2 |
=6+2=8 |
512\10 =51 |
|
|
51<>0 YES |
51 MOD 10 =1 |
=8+1=9 |
51\10=5 |
|
|
5<>0 YES |
5 MOD 10 =5 |
9+5=14 |
5\10=0 |
|
|
0<>0 NO LOOP EXITS |
|
|
|
|
|
|
|
|
|
|
The output of the
program is:
14
6. Rewrite the
given program after correcting the bugs:
REM WAP to create
file “detail.dat” and insert some records.
CLS
OPEN “detail.dat”
FOR APPEND AS $5
TOP:
INPUT “Enter name,
class and address”; n$, cl, a$
INPUT #5, n$, cl,
a$
INPUT “Do you want
to add more? {Y/N)”; C$
IF UCASE$(C$)=”Y”
OR C$=”y” THEN GOTO down
CLOSE #5
END
Debugged Program
REM WAP to create
file “detail.dat” and insert some records.
CLS
OPEN
"detail.dat" FOR OUTPUT AS #5
TOP:
INPUT "Enter
name, class, and address"; n$, cl, a$
WRITE #5, n$, cl, a$
INPUT "Do you
want to add more? (Y/N)"; C$
IF UCASE$(C$) =
"Y"
THEN GOTO TOP
CLOSE #5
END
7. Study the
following program and answer the given questions.
DECLARE FUNCTION
count (N$)
INPUT “Enter a
word”; W$
C=count (W$)
PRINT C
END
FUNCTION count (N$)
FOR K=1 TO LEN
(N$)
X$ = MID$ (N$, K, 1)
IF UCASE$(X$) =
“A” THEN
X = X+1
END IF
NEXT K
Count = X
END FUNCTION
a. What are the
library functions used in the above program?
Ans: The library
functions used are LEN( ), MID$( ), and UCASE$( ).
b. Write the use
of variable ‘C’ in line 3 in program [i.e. C=count(W$)]
Ans: The variable
C stores the result returned by the count function, which counts the number of
occurrences of the letter "A" in the input word.
Group
C
(A4D)16 = (?)2
Convert each hex
digit to 4 binary digits (see conversion table below):
A4D
= A 4 D
A = 1010
4 = 0100
D = 1101
= 101001001101
(A4D)16 = (101001001101)2
(37)10 = (?)8
Divide by the base
8 to get the digits from the remainders:
Division |
Quotient |
Remainder (Digit) |
Digit # |
(37)/8 |
4 |
5 |
0 |
(4)/8 |
0 |
4 |
1 |
= (45)8
(37)10 = (45)8
(10101)2 / (101)2
101) |
1 |
0 |
1 |
0 |
1 |
(100 |
|
|
1 |
0 |
1 |
|
|
|
|
|
0 |
0 |
0 |
0 |
1 |
|
|
|
|
|
|
|
0 |
|
|
|
|
|
|
|
1 |
|
|
Q=100
R=1
(1111)2 x (101)2
|
|
|
1 |
1 |
1 |
1 |
|
|
|
|
1 |
0 |
1 |
|
|
|
1 |
1 |
1 |
1 |
|
|
0 |
0 |
0 |
0 |
x |
|
1 |
1 |
1 |
1 |
x |
x |
1 |
0 |
0 |
1 |
0 |
1 |
1 |
(1111)2 x (101)2 =
1001011
9. a) Write a
program in QBASIC that asks height and radius of cylinder and calculate its
volume by user define function and total surface area by sub procedure.
DECLARE FUNCTION VOL
(R, H)
DECLARE SUB AREA
(R, H)
CLS
INPUT "Enter
radius of the cylinder: ", R
INPUT "Enter
height of the cylinder: ", H
PRINT "Volume
of cylinder: "; VOL(R, H)
CALL AREA(R, H)
END
FUNCTION VOL (R,
H)
VOL = 22 / 7 * R * R * H
END FUNCTION
SUB AREA (R, H)
TSA = 2 * 22 / 7 * R * (R + H)
PRINT "Total Surface Area of cylinder:
"; TSA
END SUB
b) A sequential
data file called “student.txt” has stored data under the field heading Name,
Class, Address and Age. Write a program to display all the information of those
whose class is 10 and gender is “male”.
OPEN
"student.txt" FOR INPUT AS #1
PRINT
"Name", "Class", "Address", "Age"
CLS
WHILE NOT EOF(1)
INPUT #1, Name$, Class, Address$, Age$,
Gender$
IF Class = 10 AND UCASE$(Gender$) = "M"
THEN
PRINT Name$, Class$, Address$, Age$
END IF
WEND
CLOSE #1
END
10. Write a progam
is C language to check the students whether that are pass or fail, when the
pass mark is 45.
#include
<stdio.h>
int main() {
int marks;
printf("Enter the marks: ");
scanf("%d", &marks);
if (marks >= 45) {
printf("Pass\n");
} else {
printf("Fail\n");
}
return 0;
}
OR
Write a program in
C language to display the series with their sum 40, 41, 42, 43…….10th
terms.
#include
<stdio.h>
int main() {
int sum = 0, i, term = 40;
for (i = 1; i <= 10; i++) {
printf("%d ", term);
sum += term;
term++;
}
printf("\nSum of the series:
%d\n", sum);
return 0;
}
No comments:
Post a Comment