0% found this document useful (0 votes)
100 views296 pages

46 Solved Computer Science 2081

The document provides solutions to a computer science set of questions, covering topics such as data transmission modes, internet services, database management, and programming concepts. It includes answers to various technical questions, programming tasks in QBASIC and C, and explanations of computer-related terms. The content is structured into groups with specific marks allocated for each question.

Uploaded by

mightysaurya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
100 views296 pages

46 Solved Computer Science 2081

The document provides solutions to a computer science set of questions, covering topics such as data transmission modes, internet services, database management, and programming concepts. It includes answers to various technical questions, programming tasks in QBASIC and C, and explanations of computer-related terms. The content is structured into groups with specific marks allocated for each question.

Uploaded by

mightysaurya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 296

SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.

np/ SOLVED BY: DEEPAK SHRESTHA


Set 6: SOS 2080

1. Answer the following questions in one sentence: [6×1-6]


a. Write any two examples of full duplex mode of data transmission
Ans: Telephone communication and video conferencing are examples of full duplex data
transmission.

b. Mention any two services of the internet.


Ans: Email and Chat are two services of the internet.

c. Which query is used to make changes in data stored in the database?


Ans: The UPDATE query is used to make changes in data stored in the database.

d. Which data type is also known as logical data type in MS-Access?


Ans: The Yes/No data type is also known as the logical data type in MS-Access.

e. List the modes of operations for opening a sequential file.


Ans: Sequential files can be opened in modes such as OUTPUT, INPUT, and APPEND.

f. Write any two looping statements used in C language.


Ans: The for loop and while loop are two looping statements used in C language.

2. Write the appropriate technical term for the following statements: [2×1-2]
a Network connecting device that boosts the data signals. Repeater
b. The use of computer technology to create a simulated environment. Virtual Reality (VR)

3. Write the full form of the following acronyms: [2×1-2]


a. OTP – One Time Password
b. PaaS - Platform as a Service

Group 'B’ -24 Marks

4. Answer the following questions: [9×2=18]


a. The Internet is called network of networks." Justify in your own words.
Ans: The Internet is called a "network of networks" because it connects millions of private, public,
academic, business, and government networks globally, enabling them to communicate and share
resources.

b. What is hacking? What is the purpose of hacking?


Ans: Hacking is the unauthorized access to or manipulation of computer systems or networks, typically to
steal, alter, or destroy data, or disrupt services.
The purpose of hacking can be to steal or alter data, disrupt services, spy on communications, or
sometimes, to test and improve security measures (ethical hacking).

c. Define antivirus software with four examples.


Ans: Antivirus software is a program designed to detect, prevent, and remove malware from computer
systems. Examples include Norton, McAfee, Avast, and Bitdefender.

d. What is E-commerce? Write any four Nepali e- commerce web sites.


Ans: E-commerce is the buying and selling of goods and services over the internet. Four Nepali e-
commerce websites are Daraz, SastoDeal, HamroBazar, and NepBay.

e. What is Al? List any four areas of AL


1|P a g e CS SEE PABSON SOS 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
Ans: Artificial intelligence (AI) is an area of computer science that emphasizes the creation of intelligent
machines that work and reacts like humans.
Four areas of AI are natural language processing, robotics, expert systems, and computer vision.

f. What is DBMS? Name any four examples of database.


Ans: DBMS is a computerized system that stores data, processes them and provides information in an
organized form. E.g. MS-Access, Oracle, MySQL, Fox Pro etc

g. Differentiate between field and record.


Ans: The difference between field and record are:
Record Field
A record is a row in a table which contains information about A field is a column in a table which contains
single items in a database. information about a certain type for all
records.
For example, in Table – Book Records, all the information For example, in Table – Book Records,
about a book is record. Here, the combination of Code, Book Code, Book Name, Level, Author, Year of
Name, Level, Author, Year of Publication values forms a Publication are the fields of book records
record. table.

h. What is the report? Write any two importance of the report.


Ans: Report is one of the MS-Access database objects used to present information in an effective and
organized format that is ready for printing.
Any two importance of the report are:
• Reports provide a formatted presentation of data that is easy to read and understand.
• Reports enable users to summarize, analyze, and visualize data in meaningful ways.

i. Write any four advantages of a computerized database.


Ans: Any four advantages of a computerized database
a) It reduces data redundancy which means duplication of data.
b) It allows multiple users to access the same data simultaneously.
c) Large volume of data can be stored and updated easily.
d) It provides high security of data as well as maintains accurate database.

5. Write down the output of the given program (Show with a dry run at a table).
DECLARE SUB SHOW(A)
CLS
N-87
CALL SHOW(N)
END

SUB SHOW (A)


DO
B=A MOD 6+3
IF B MOD 4=0 THEN GOTO AA
PRINT B;
AA:
A=A-10
LOOP WHILE A>=50
2|P a g e CS SEE PABSON SOS 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
END SUB

6. Rewrite the given program after correcting the bugs:


REM so add more data in a sequential file
OPEN “EMP.DAT” FOR INPUT AS #2
DO
INPUT “ENTER NAME”; N$
INPUT “ENTER ADDRESS”; A$
INPUT ENTER SALARY”; S$
WRITE #1, N$, A$, S
INPUT “Do you want tis add more records”; M$
LOOP WHILE UCASE(M$)="Y"
END

Debugged Program
REM To add more data in a sequential file
OPEN "EMP.DAT" FOR APPEND AS #1
DO
INPUT "ENTER NAME"; N$
INPUT "ENTER ADDRESS"; A$
INPUT "ENTER SALARY"; S$
WRITE #1, N$, A$, S$
INPUT "Do you want to add more records"; M$
LOOP WHILE UCASE$(M$) = "Y"
CLOSE #1
END

Study the following program and answer the given questions:


DECLARE SUB PC (N)
CLS
INPUT "Emer a number"; N
CALL PC(N)
END
SUB PC (N)
FOR 1=2 TON-1
R=N MOD I
IF C=0 THEN
PRINT "Prime number”
ELSE
PRINT "Composite number”
ENDIF
END SUB
a. What is the name of the sub procedure? The name of the sub procedure is PC ( )
h List the local variables. – N, I, R and C

Group C -16 Marks

8. Convert/calculate as per the instructions: 141-415


(100111101)2 = (?)16
Convert every 4 binary digits (from bit0) to hex digit (see conversion table below):
100111101
= 1 0011 1101
1=1
3|P a g e CS SEE PABSON SOS 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
0011 = 3
1101 = D
= 13D
(100111101)2 = (13D)16

(912)10 = (?)8

Divide by the base 8 to get the digits from the remainders:


Division Quotient Remainder Digit #
by 8 (Digit)
(912)/8 114 0 0
(114)/8 14 2 1
(14)/8 1 6 2
(1)/8 0 1 3
= (1620)8

(912)10 = (1620)8

(10010)2 x (1110)2 – (10101)2 = (?)2

1 0 0 1 0
1 1 1 0
0 0 0 0 0
1 0 0 1 0 x
1 0 0 1 0 x x
1 0 0 1 0 x x x
1 1 1 1 1 1 0 0
- 1 0 1 0 1
1 1 1 0 0 1 1 1

(10010)2 x (1110)2 – (10101)2= (11100111)2

(1011101)2 / (111)2

111) 1 0 1 1 1 0 1 (1101
1 1 1
1 0 0 1
1 1 1
0 0 1 0 0 1
- 1 1 1
0 0 1 0
Q=1101
R=10

Wise a program in QBASIC that asks any number and display its square and square root: Create a user-
defined function to calculate square root and a sub program to display the square of a number.

DECLARE FUNCTION SQRT(X)


DECLARE SUB SQUARE(X)

4|P a g e CS SEE PABSON SOS 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
CLS
INPUT "Enter a number: ", N
SQUARE N
PRINT "Square root: "; SQRT(N)
END

FUNCTION SQRT(X)
SQRT = SQR(X)
END FUNCTION

SUB SQUARE(X)
PRINT "Square: "; X * X
END SUB

A data file "Staff.dat” has stored records of few employers with EmpID, name, address post and salary.
Write a program is display all the records of the employees whose address is "Nepal" and salary is than
40.000 (4)

OPEN "Staff.dat" FOR INPUT AS #1


DO WHILE NOT EOF(1)
INPUT #1, EmpID, Name$, Address$, Post$, Salary
IF Address$ = "Nepal" AND Salary < 40000 THEN
PRINT EmpID, Name$, Address$, Post$, Salary
END IF
LOOP
CLOSE #1
END

10. Write a program in C language that asks any integer value and checks whether it is odd or even

#include <stdio.h>

int main() {
int num;
printf("Enter an integer: ");
scanf("%d", &num);

if(num % 2 == 0) {
printf("%d is even.\n", num);
} else {
printf("%d is odd.\n", num);
}

return 0;
}
OR

Write a program in C language to display the first 10 odd numbers.

#include <stdio.h>

int main() {
5|P a g e CS SEE PABSON SOS 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
int i, count = 0;
for(i = 1; count < 10; i += 2) {
printf("%d\n", i);
count++;
}
return 0;
}

6|P a g e CS SEE PABSON SOS 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
National PABSAN, Bagmati Province
SEE Pre-Board Examination - 2080
Time: 2 hours
Subject: Opt. Computer Science
Candidates are required to give their answers in their own words as far as practicable, The figures in
the margin indicate full marks for the question.

GROUP A [10 X1=10]

1. Answer the following questions in one sentence:

a) What is a web browser?


Web browser is a computer program that access web pages and displays them on the user’s computer.

b) List any two commandments of computer ethics.


Any two commandments of computer ethics.
Do not use a computer to publish fake information.
Do not search the file or record of other people.

e) Which data type is used in MS-Access to store address of a person?


Memo data type is used in MS-Access to store address of a person.

d) What is a RDBMS?
RDBMS is a type of DBMS that uses a relational model to organize and manage data, allowing users to
easily retrieve and manipulate it.

c) What is a global variable?


A variable in main module which can be accessed from any module or procedure of a program is known as a
global variable.

f) Which mode is used to add data items into the already existed data file in QBASIC?
APPEND mode is used to add data items into the already existed data file in QBASIC

2. Write appropriate technical terms for the following:

a) The amount of data transmitted per second through the communication channel. Bandwidth

b) The process of making copies of data or data files to use in the event the original data or data files are lost
or destroyed. Backup

3. Write the full forms for the following:

a) CCTV : Closed Circuit Television

b) SIM : Subscriber Identity Module

GROUP B (12 X 2=241

4. Answer the following questions:

a) What is computer security? Write any two software security measures.

1|P a g e CS SEE NPABSON 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
Computer security refers to protecting computer and its content from damage, theft or misuse and action to
prevent such incidents.
Any two software security measures are: Password and Backup

b) List four ways to stay safe on social networks.


Any four ways to stay safe on social networks
• Pick strong passwords and update them frequently.
• Report harassment or inappropriate content.
• Pause before you post.
• Look before you click.

e) What is m-commerce? Give two examples of digital wallets used in Nepal.


M-Commerce refers to the process of buying and selling of goods and services through wireless handheld
devices such as smartphones, tablets or personal digital assistants (PDAs).
Any two examples of digital wallets used in Nepal are e-sewa and Khalti.

d) What is cloud computing? Write any two examples of Al.


Cloud computing is a technology that allows users to access and use of computing resources, like servers
and software, over the internet.
Any two examples of Al are: speech recognition (like Siri, Microsoft Cortana, Amazon Echo, Google Home
etc.),
And self-driving cars.

e) Define ring topology. Write its two advantages.


The type of topology in which each computer is connected to another computer with the last one connected
to the first is called ring topology.
Any two advantages of ring topology are:
 In this topology all computers, in close loop, act as a client or server to transfer the information.
 Transmitting network is not affected by high traffic or by adding more nodes.

f) What is a foreign key? Write two properties of primary key.


A foreign key in MS Access is a field that establishes a relationship between two tables by referencing the
primary key of another table.
Any two properties of primary key are:
It sets the relationship between tables.
It reduces and controls duplication of record in a table

g) Write any two differences between data sorting and data filtering.

Sorting Filtering
The process of arranging all the records in a table Filtering is the process of viewing required record
either ascending or descending order based on field of a table that matches the specifies criteria.
or fields is known as sorting.
Sorting affects the entire dataset. Filtering only affects the data that is displayed.
Sorting is often used to make data easier to read. Filtering is used to find specific information.
Sorting can be done in ascending or descending Filtering has various criteria that can be applied.
order.

h) Write a difference between database and DBMS. Give one example of manual database.
2|P a g e CS SEE NPABSON 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
Database DBMS
A collection of systematically organized inter- Database management system (DBMS) is a
related data is called a database. computerized system that stores data, processes
them and provides information in an organized
form
Besides computers, databases can even be In a database management system (DBMS), all the
maintained in physical ledgers, books, or papers. records are maintained only on a computer.
In the case of the databases, very less information In the database management system (DBMS), a lot
can be modified at a time. of information can be changed at one time (as it can
have many users using it at the same time).
Eg. Dictionary, Marks Ledger, Telephone E.g. MS-Access, Oracle, MS-SQL Server, MySQL,
Directory, Attendance Register etc. PostgreSQL etc
Telephone Directory is an example of manual database.

i) What is a Form? Write two uses of a form.


Form is one of the MS-Access database objects which provides graphical interface to view, modify and add
data in a table or multiple linked tables.
Any two uses of a form are:
• Forms provide an easy-to-use interface for data entry and manipulation, improving data accuracy and completeness.
• Forms can include validation rules to ensure data quality and prevent errors.

5. Write down the output of the given programs. Show with dry run in a table.
DECLARE SUB Display(S$)
CLS
S$=”TOEPOHSDRA"
CALL Display (S$)
END
SUB Display(S$)
LET I=48
FOR C=1 TO 4
P=I MOD 7
R$=R$+ MID$(S$, P, 1)
I=I-1
NEXT C
PRINT R$
END SUB
Dry Run
S$ I C=1 TO 4 P=I MOD 7 R$=R$+ I=I-1 PRINT R$
MID$(S$, P,
1)
TOEPOHSDRA 48 1 TO 4 yes 48 MOD 7= H 48-1=47 HOPE
6
2 TO 4 yes 47 MOD 7 = HO 47-1=45
5
3 TO 4 yes 46 MOD 7= HOP 45-1=44
4
4 TO 4 yes 45 MOD 7 = HOPE 44-1=43
3
5 TO 4 no
Loop exits
The output of a program is:
HOPE
3|P a g e CS SEE NPABSON 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA

6. Re-write the given program after correcting the bugs.

REM Program to add records to an existing file "Student.dat"


OPEN "Student.dat" FOR APPEND AS #1
DO
CLS
INPUT "Enter name: "; N$
INPUT "Enter Address: "; Ad$
INPUT "Enter Total Marks: "; TM$
COPY #1, N$, Ad$, TM
INPUT "Do you want to add more records? Press Y or N: "; CH$
LOOP WHILE UCASE$(CH$) < > “Y”
CLOSE "Student.dat"
END

Debugged Program
REM Program to add records to an existing file "Student.dat"
OPEN "Student.dat" FOR APPEND AS #1
DO
CLS
INPUT "Enter name: "; N$
INPUT "Enter Address: "; Ad$
INPUT "Enter Total Marks: "; TM
WRITE #1, N$, Ad$, TM
INPUT "Do you want to add more records? Press Y or N: "; CH$
LOOP WHILE UCASE$(CH$) = “Y”
CLOSE #1
END

7. Study the given program and answer the questions it follows.


DECLARE FUNCTION Calculate (X,Y)
CLS
INPUT "Enter a multi-digit number"; N
LET S = Calculate (N,T)
PRINT "The sum =”; S
END

FUNCTION Calculate (X,Y)


WHILE X < > 0
R=X MOD 10
Y=Y+R
X=X\10
WEND
Calculate = Y
END FUNCTION
a) List formal parameters and real parameters of procedure Calculate'.
The formal parameters are X and Y and real parameters are N and T.
b) What is the purpose of the above program?
The purpose of the above program is to display the sum of digit of an input number.

8. Perform the following as indicated:

4|P a g e CS SEE NPABSON 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
a) (11101011)2=(?)8
b) (65)10=(?)2
c) (11101)2+(11011)2-(11110)2
d) (111011)2(11)2

GROUP C
9. (a) Write a program in QBASIC to find out sum of three numbers using SUB procedure and average of
three numbers using FUNCTION procedure.
DECLARE SUB SUM(A, B, C)
DECLARE FUNCTION AVG(A, B, C)
CLS
INPUT “Enter first number”; A
INPUT “Enter second number”; B
INPUT “Enter third number”; C
CALL SUM(A, B, C)
PRINT Average of three numbers=”; AVG(A, B, C)
END

SUB SUM(A, B, C)
S=A+B+C
PRINT “Sum of three numbers=”; S
END SUB

FUNCTION AVG(A, B, C)
AVG=(A+B+C)/3
END FUNCTION
(b) A sequential data file, "record.dat." contains several records with data items name, address, age, and
phone number. Write a program to display the records of students whose age is greater than or equal to 18.

OPEN “record.dat” FOR INPUT AS #1


5|P a g e CS SEE NPABSON 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
CLS
PRINT “NAME”, “ADDRESS”, “AGE”, “PHONE NUMBER”
WHILE NOT EOF(1)
INPUT #1, N$, A$, AG, PN
IF AG>=18 THEN PRINT N$, A$, AG, PN
WEND
CLOSE #1
END

10. Write a program in C language to input length of three rods and display whether the triangle can be
formed by those rods or not. [4]

#include <stdio.h>
int main() {
float a, b, c;
printf("Enter the length of rod for side 1: ");
scanf("%f", &a);
printf("Enter the length of rod for side 2: ");
scanf("%f", &b);
printf("Enter the length of rod for side 3: ");
scanf("%f", &c);
if (a + b > c && a + c > b && b + c > a)
{
printf("The triangle can be formed by rods.\n");
}
else
{
printf("The triangle cannot be formed by rods.\n");
}
return 0;
}
OR
Write a program in C language to declare whether the given number is 'Positive', 'Negative' or 'Zero'.
#include<stdio.h>
#include<conio.h>
int main()
{
int n;
printf("Enter any number: ");
scanf("%d", &n);
if(n>0)
printf("%d is positive number",n);
else if(n<0)
printf("%d is negative number",n);
else
printf("%d is zero number",n);
return 0;
}

6|P a g e CS SEE NPABSON 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
SET 18 – DAY 18 – SEE SEDIPS 2080 – COMPUTER SCIENCE 2080
SET 18

SEE Efficiency Test: 2024

Candidates are required to give their answers in their own words as far as practicable.
Subject: Computer Science

1. Answer the following questions:

a) List any two services of Internet.


Ans: Any two services of internet are E-Mail and Search Engine

b) Define Cryptography.
Ans: Cryptography is the study of secure communications techniques that allow only the sender and
intended recipient of a message to view its contents

c) List the services of Cloud Computing.


Ans: The services of cloud computing are :
Infrastructure as a Service (IaaS):
Software as a Service (SaaS):
Platform as a Service (PaaS):

d) What is Online Payment?


Ans: Online payment refers to the payment for buying goods or services through the Internet using different
online payment gateway.

e) Which query is used to modify and calculate data in DBMS?


Ans: Update query is used to modify and calculate data in DBMS.

f) List any two examples of format specifier (Conversion Character) used in C Language.
Ans: Any two examples of format specifier (Conversion Character) used in C Language are %d (int) and %f
(float)

2. Give the appropriate technical terms of the following:


a) The mode of data communication in which data/information/signals are transmitted in both side
simultaneously. Full Duplex Mode
b) The network security systems that monitor and control the traffic flow (data packets). Firewall

3. Write the full form for the following:


a) POP : Post Office Protocol
b) GCE : Google Compute Engine

4. Answer the following questions:

a) What is Transmission Media? Mention its types with at least any two examples of each.

Ans: A channel or path through which data and information are transmitted between connected devices in a
network environment is called communication media. Its types are :
1. Guided (Wired/bounded) communication media - Twisted pair Wire , Co-Axial Cable
2. Unguided (Wireless/unbounded) communication media - Radio Wave , Micro Wave

1|P a g e CS SEE NPABSON 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
b) What do you mean by Computer Security? Write any four security measures (mechanisms) of
Hardware Security.
Ans: Computer security refers to protecting computer and its content from damage, theft or misuse and
action to prevent such incidents.

Any four security measures (mechanisms) of Hardware Security are:


a) Regular Maintenance
b) Insurance
c) Dust free environment
d) Power Protection device (Volt guard, Spike guard, UPS)

c) Define Virtual Reality. Write its application area.

Ans: Virtual Reality (VR) is the use of computer technology to create a simulated environment that doesn’t
actually exist, that can give a feel of near real world with all or some of senses experiencing the virtually
simulated environment.
Its application areas are:
• Gaming- VR Gaming allows players to immerse (dip) themselves in virtual world and interact with
environment and characters
• Education - VR can help students learn by making the content more engaging and memorable.

d) What is Digital Citizenship? List any four elements (themes) of Digital Citizenship.

Ans: Digital citizenship refers to the responsible and ethical use of technology and the internet which
involves understanding, practicing, and promoting appropriate behavior when using digital tools and
resources.

Any four elements (themes) of Digital Citizenship are:


Digital Access: The state of full electronic participation in society
Digital Commerce: The act of promoting the purchase of goods through electronic means
Digital Communication: Electronic exchange of information
Digital literacy: Teaching and learning about teaching and technology

e) List the types of E-Commerce. Describe any one of them.


Ans: The types of Ecommerce Models are:

Business to Consumer (B2C):


Business to Business (B2B):
Consumer to Consumer (C2C):
Consumer to Business (C2B):

Business to Consumer (B2C):

The most common type of E-Commerce is Business-to-Consumer. B2C establishes the electronic
business relationships between a business organization (merchant) and final consumers. (e.g. You
buy a pair of shoes from an online retailer)

Amazon. com is a good example of B2C e-commerce.

f) What is MS-Access ? List any two features of MS-Access

2|P a g e CS SEE NPABSON 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
Ans: MS-Access is a relational database management system developed by Microsoft Corporation which is
used to store and manipulates large volume of data in multiple tables. Any two features of Ms-Access are:

a) It provides the flexible ways to add, edit, delete and display the related data.
b) Queries help to view, change and analyse the data indifferent ways.

g) Define Field Name. Write any two rules for creating the Field Name

Ans: A field name refers to the name given to a specific data element within a database table.
Any two rules for creating the Field Names are:
Field names should clearly describe the data they represent.
Field names should consist of alphanumeric characters and underscores (_) only.

h) Differentiate between Form and Report.


The difference between form and report are:
Form Report
Form is primarily used for entering data Report is used for presenting the data.
Form is also used for displaying records but one record at a Report is used for displaying whole
time. records.
Data can be modified through the form. Data can not be modified through report.
Form is designed to be used on screen. Report are designed to be printed.

1) What do you mean by Indexing? Write its importance.


Indexing is a field property which speeds up searching and sorting of records based on a field.
Its importance is it helps databases quickly find and retrieve data, making queries run faster.

5. Write the output of the following program showing necessary rough: (1\times2=2)

DECLARE SUB SERIES ( )


CLS
CALL SERIES
END

SUB SERIES
A$="NEPAL"
B=1
FOR I=LEN(A$) TO 1 STEP-2
IF B< >3 THEN
PRINT MID$(A$, B, I)
ELSE
PRINT MID$(A$, 1, I)
END IF
B=B+1
NEXT I
END SUB

Dry Run Table

3|P a g e CS SEE NPABSON 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
A$ B I=LEN(A$) IS B< Yes No B=B+1
TO >3
1 STEP-2 ? PRINT MID$(A$, PRINT MID$(A$,
B, 1,
I) I)
NEPA 1 5 TO 1 STEP- 1<>3 MID$(NEPAL,1,5) 1+1=2
L 2
Yes Yes NEPAL
2 3 TO 1 STEP- 2<>3 MID$(NEPAL,2,3) 2+1=3
2
Yes Yes EPA
3 1 TO 1 STEP- 3<>3 MID$(NEPAL,1,1) 3+1=4
2
4 -1 TO 1 STEP-2 No N
LOOP EXITS

The output of the program is:

NEPAL
EPA
N

6. Rewrite the program after correcting the bugs:


REM to calculate the sum of even numbers existing in the set of given numbers.
DECLARE FUNCTION evenpro(A)
FOR C=1 TO 5
Debugged Program
READ N
S=S+evenpro(A) REM to calculate the sum of even numbers
NEXT C existing in the set of given numbers.
PRINT Ssum of even numbers:"; S DECLARE FUNCTION evenpro(A)
DATA 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 FOR C=1 TO 10
END READ N
S=S+evenpro(N)
FUNCTION evenpro(A) NEXT C
R=A MOD 2 PRINT “Sum of even numbers:"; S
IF R< >0 THEN DATA 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
A=evenpro END
ENDIF
END FUNCTION FUNCTION evenpro(A)
R=A MOD 2
IF R=0 THEN
evenpro = A
ENDIF
END FUNCTION

7. Read the following program and answer the following questions:

4|P a g e CS SEE NPABSON 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
OPEN "BUSRIDER.TXT" FOR INPUT AS #1
OPEN "TEMP.TXT" FOR OUTPUT AS #2
CLS
WHILE NOT EOF (1)
INPUT #1, STUDENTNAME$, CLASS, BUSCODE, BUSSTOP$
IF UCASE$(BUSSTOP$) < > UCASE$("KATHMANDU") THEN
WRITE #2, STUDENTNAME$, CLASS, BUSCODE, BUSSTOP$
PRINT STUDENTNAME$, CLASS, BUSCODE, BUSSTOP$

END IF

WEND
CLOSE #1 #2
KILL BUSRIDER.TXT"
NAME "TEMP.TXT" AS "BUSRIDER TXT”
END

a) What is the main objective of the program given above?


Ans: The main objective of the program given above is to delete all those records whose bus stop is
KATHMANDU.

b) Do you get any problem in above program if "Kill" statement is removed? Give reason.
Ans: Yes, We get problem in above program if "Kill" statement is removed because if the kill statement is not
used then busrider.txt file won’t be deleted and NAME statement cannot rename TEMP.TXT to
BUSRIDER.TXT because file name is already exists. So, it can’t be renamed.

5|P a g e CS SEE NPABSON 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
9. a) Write a QBASIC program that asks radius and calculate Area of Sphere and Volume of Sphere.
Create a USER DEFINED FUNCTION to calculate Volume of Sphere and SUB-PROGRAM to
calculate Area of Sphere. [Hint: AOS-4pir2 and VOS-4/3pir3

DECLARE SUB AREA (R) SUB AREA(R)


DECLARE FUNCTION VOL(R) A=4*3.14*R^2
CLS PRINT “Area of sphere=”; A
INPUT “Enter Radius”; R END SUB
CALL AREA(R)
PRINT “Volume of sphere=”; FUNCTION VOL(R)
VOL(R) VOL=4/3*3.14*R^3
END END FUNCTION

b) Write a QBASIC program that asks for Employee name and stores its reverse form into a
sequential data file "Reverse Txt". Make a provision so that user can input 10 records at each
program execution.

OPEN "REVERSE.TXT" FOR OUTPUT AS #1


CLS
FOR J=1 TO 10
INPUT "ENTER EMPLOYEE'S NAME"; N$
B$=" "
FOR I = LEN(N$) TO 1 STEP -1
B$ = B$ + MID$(N$, I, 1)
NEXT I
WRITE #1, B$
NEXT J
CLOSE #1
END

10. Write a program in C language that asks the value of 3 sides of a triangle then check whether triangle
is Equilateral, Isosceles or Scalene.
#include <stdio.h>
int main()
{ Write a program in C language to
int side1, side2, side3; display the series with their sum: 2, 8,
printf("Enter three sidesoftriangle:"); 18, 32. upto 10th term.
scanf("%d%d%d", &side1,&side2,&side3);
if(side1= =side2&&side2==side3) #include <stdio.h>
{ int main() {
printf("Equilateral triangle."); int i;
} for(i=1;i<=10;i++)
else if(side1= =side2 || side1= =side3 || side2= =side3) {
{ printf("%d ", i*i*2);
printf("Isosceles triangle.");
} }
else return 0;
{ }
printf("Scalene triangle.");
}
return 0;
}

6|P a g e CS SEE NPABSON 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA

7|P a g e CS SEE NPABSON 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA

SET 24
Subject: Opt. II Computer Science
Time: 1:30 hrs. Full Marks: 50

Candidates are required to give answers according to the instructions given.


Group ‘A’
1. Answer the following questions in one sentence: [6x1=6]

a) Define bandwidth.
Ans: The amount of data that can be carried from one point to another in a given time period is called
bandwidth.

b) What is cyber-crime?
Ans: Cybercrime refers to criminal activities or illegal actions that are conducted or facilitated through the
use of digital technology or the internet.

c) Define AI.
Ans: Artificial intelligence refers to the simulation of human intelligence in machines that are programmed
to think and act like humans.

d) What is the storage size of text and currency data type?


Ans: The storage size of text data type is 255 and currency data type is 8 bytes.

e) Define modular programming.


Ans: Modular programming is a technique used to divide program into many small, manageable, logical and
functional modules or blocks.

f) Write any two features of C language.


Any two features of C language are:
It is a high level language with some features of low level language.
It is mostly used to prepare system software.

2. Write appropriate technical terms for the following: [2x1=2]


a) Physical layout of computers in a network. Network Topology

b) A secret group of characters used to protect information systems from unauthorized users. Password

3. Write the full form of the following: [2x1=2]


a. STP - Shielded Twisted Pair

b. NIC – Network Interface Card

Group ‘B’
4. Answer the following questions: [9x2=18]
1|P a g e CS SEE NPABSON 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
a) Differentiate between client server architecture and peer to peer architecture.
Ans: The difference between client server architecture and peer to peer architecture are:

Client-Server Network Peer to Peer Network


A network model where one or more powerful computers A network model where all nodes on the
(servers) provide the different network services and all other network have an equal relationship with
users of computer network (clients) access those services to each other is known as peer to peer
perform user's tasks is known as client-server network. network.
Client-Server Network are costlier than Peer-to-Peer Network. Peer-to-Peer Network are less costlier
than Client-Server Network
Client-Server Network focuses on information sharing. Peer-to-Peer Network focuses on
connectivity.
Client-Server Network is used for both small and large networks. Peer-to-Peer Network is generally
suited for small networks

b) Write any four commandments of computer ethics.


Ans; Any four commandments of computer ethics are :
· Do not use a computer to harm other people.
· Do not use a computer to publish fake information.
· Do not search the file or record of other people.
· Do not destroy or delete the records of other people

c) Define hardware security. Give any two measures of software security.


Ans: Hardware security is the protection given to the various hardware tools and equipment used in
computer system from the accidental or intentional harm.
Any two measures of software security are:
Password and Backup

d) What is VR? Mention its application areas.


Ans: Virtual reality is an artificial environment created with computer hardware and software and presented
to the user in such a way that it appears and feels like a real environment.
Any two areas where it is used are:
Gaming- VR Gaming allows players to immerse (dip) themselves in virtual world and interact with
environment and characters
Education - VR can help students learn by making the content more engaging and memorable.

e) What is mobile computing? Write any four importance of it.


Ans: Mobile computing refers to the use of portable computing devices, such as smartphones, tablets,
laptops, and wearables, that allow users to access and transmit data, information, and applications without
being tied to a fixed physical location.
Any four importance of it are:
It allows people to work and communicate from anywhere at any time.
It keeps connected to the Internet, allowing to access information all the times.
It increases the productivity of users reducing time and cost.
It is one of the major handheld sources of entertainment for users at present.

f) Define DBMS with examples.


Ans: Ans: DBMS is a software that manages databases, allowing users to store, access, and
manipulate data in an organized and secure way.

2|P a g e CS SEE NPABSON 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
Examples of DBMS software are : MS-Access, Oracle, Fox pro, dBase etc.

g) Define data redundancy. How can it be reduced?


Ans: Data redundancy refers to the repetition or duplication of data within a database.
It can be reduced by normalizing the database, eliminating duplicate data and storing it in separate tables,
and using foreign keys to establish relationships between the tables.

h) What is data sorting? Write its two advantages.


Ans: Sorting refers to the process of organizing data in a specific order (ascending or descending) based on
one or more fields in a table, query, or report.
Any two advantages of using it are:
Sorting helps to organize data and make it easier to find and retrieve specific information.
Sorting can save time and improve efficiency by allowing users to quickly access the data they need.

i) Mention any four data types used in MS-Access.


Any four data types used in MS-Access are text, memo, Yes/No and Currency.

5. Write down the output of the given program. [2] TEXT$(A$)


FUNCTION
DECLARE FUNCTION TEXT$(A$)
B= LEN(A$)
CLS
A$= “TECHNOLOGY” FOR I = 1 TO B
Y$= TEXT$(A$)
PRINT Y$ IF I MOD 2 = 1 THEN
END
B$= B$+MID$(A$,I,1)

END IF
Dry Run
A$ B I=1 to B IF I MOD 2 B$=B$+MID$(A$,I,1) Y$ PRINT Y$
=1
TECHNOLOGY 10 1 to 10 1 MOD 2=1 T TCNLG TCNLG
1=1 yes
2 to 10 2 MOD 2=1
0=1 no
3 to 10 3 MOD 2=1 T+C = TC
1=1 yes
4 to 10 4 MOD 2=1
0=1 no
5 to 10 5 MOD 2=1 TC+N=TCN
1=1 yes
6 to 10 6 MOD 2=1
0=1 no
7 to 10 7 MOD 2=1 TCN+L=TCNL
1=1 yes
8 to 10 8 MOD 2=1
0=1 no
9 to 10 9 MOD 2=1 TCNL+G
1=1 yes
10 to 10 10 MOD 2=1 TCNLG
0=1 no
11 to 10
Loop
Exit
3|P a g e CS SEE NPABSON 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
The output of the program is
TCNLG
6. Rewrite the following program after correcting the bugs. [2]
DECLARE FUNCTION SUM(N)
CLS
INPUT “ENTER A NUMBER”; N
SU= SUM(N)
PRINT “SUM =”; SUM(N)
END

FUNCTION SUM(N)
WHILE N< > 0
R = R MOD 10
S= S + R
N = N \ 10
WEND
S= SUM
END SUB
Debugged Program

DECLARE FUNCTION SUM(N)


CLS
INPUT “ENTER A NUMBER”; N
SU= SUM(N)
PRINT “SUM =”; SU
END

FUNCTION SUM(N)
WHILE N< > 0
R = N MOD 10
S= S + R
N = N \ 10
WEND
SUM=S
END FUNCTION
7. Study the following program and answer the given questions. [2]
DECLARE SUB TEST(A$)
CLS
A$= “COMPUTER”
END

SUB TEST (A$)


L= LEN(A$)
FOR I = L TO 1 STEP -2
PRINT MID$(A$, I, 1)
NEXT I
END SUB

a) What statement should be added in the main module to execute the program?
Ans: CALL TEST(A$) statement should be added in the main module to execute the program.
b) List out the variables used in the above program with types.
Ans: the variables used in the above program are:
A$ - String Variable
4|P a g e CS SEE NPABSON 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
L, I – Numeric Variable

Group ‘C’
8. Convert/ calculate as per the instruction. [4]

a) (670)8 = (?)10

670
= (6 × 8²) + (7 × 8¹) + (0 × 8⁰)
=6 × 64 + 7 × 8 + 0 × 1
= 440
(670)8 = (440)10

b) (FACE)16 = (?)2
Convert each hex digit to 4 binary digits (see conversion table below):
FACE
=FACE
or, F = 1111
A = 1010
C = 1100
E = 1110
= 1111101011001110

(FACE)16 = (1111101011001110)2

c) 1100 x 110
1 1 0 0
× 1 1 0
0 0 0 0
1 1 0 0 ×
1 1 0 0 × ×
10 0 1 0 0 0
1100 x 110 = 1001000

d) 111011 ÷ 100

100) 1 1 1 0 1 1 (1110
- 1 0 0
1 1 0
- 1 0 0
1 0 1
- 1 0 0
0 0 1 1
- 0 0
1 1

Q=1110

R=11

5|P a g e CS SEE NPABSON 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
9. a) Write a program in QBASIC that asks for the length, breadth and height of a box. Create a user defined
function to find the volume of the box and sub procedure to find the total surface area of the box. [Hint:
Vol=l x b x h ; Area=2(lb+bh+lh) [4]

DECLARE SUB TSAREA (L, B, H)


DECLARE FUNCTION VOLUME (L, B, H)
CLS
INPUT “ENTER LENGTH”; L
INPUT “ENTER BREADTH”; B
INPUT “ENTER HEIGHT”; H
CALL TSAREA(L, B, H)
PRINT “VOLUME OF CUBOID ”; VOLUME(L, B, H)
END

SUB TSAREA (L, B, H)


T = 2 * (L * B + B * H + H * L)
PRINT “TOTAL SURFACE AREA OF CUBOID ”; T
END SUB

FUNCTION VOLUME (L, B, H)


VOLUME = L * B * H
END FUNCTION

b. Write a program to open a data file “Record.dat” which contains student’s name, class and address and
print only those students’ records whose name starts from an alphabet “A”. [4]

OPEN "Record.dat" FOR INPUT AS #1


CLS
WHILE NOT EOF (1)
INPUT #1, N$, C, A$
A$ = UCASE$(LEFT$(N$,1))
IF A$ = “A” THEN PRINT N$, C, A$
WEND
CLOSE #1 Write a program in C language to display the
END series:

10. Write a program in C language to enter a number and 2, 4, 6, 8, 10, 12……………10th term.
check if it is odd or even. [4]

#include<stdio.h> #include <stdio.h>


#include<conio.h>
int main()
{ int main()
int n;
printf("Enter any number: "); {
scanf("%d", &n);
if(n % 2= = 0) int a=2,i;
printf("%d is even number", n); for(i=1;i<=10;i++)
else
printf("%d is odd number", n); {
return 0;
} printf("%d ", a);

6|P a g e CS SEE NPABSON 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
SET 22
PABSON, Lalitpur
SEE PRE-QUALIFYING EXAMINATION-2080
Subject-Opt. II. Computer Science
Full Marks: 50
Time: 2 hrs
Candidates are required to write their answers according to the instructions given.
Attempt all questions

Group A [10 Marks]

1. Answer the following questions in one sentence:

a) What is mail server?


Ans: A mail server is a computer system that is dedicated to handling and managing the sending, receiving,
and storage of emails.

b) Why do you connect your PC to the UPS?


Ans: We connect PC to the UPS to control fluctuation of electric voltage and provides enough backup
electric power to the computer system when there is power failure.

c) What is AI?
Ans: Artificial intelligence refers to the simulation of human intelligence in machines that are programmed
to think and act like humans.

d) Which object of DBMS is used to print information?


Ans: The object of DBMS which is used to print information is report.

c) List the types of procedures.


Ans: The types of procedure are SUB Procedure and FUNCTION Procedure.

f) Write a feature of C language.


Ans: A feature is C language is it is mostly used to prepare system software.

2. Write the technical term for the following statements:


a) Device to convert analog signal into digital signal and, vice versa. MODEM
b) Making data and information unreadable by unauthorized person. Encryption

3. Write the full forms of the following:


a) UPS - Uninterruptible Power Supply
b) SMTP - Simple Mail Transfer Protocol

Group B
4. Answer the following questions:

a) What is communication channel? Mention its types with at least one example, each
Ans: A channel or path through which data and information are transmitted between connected devices in a
network environment are called communication channel.
Its types are:
Guided (Wired/bounded) communication media - Twisted Pair Cable, Co-Axial Cable and Fiber Optic
Cable
Unguided (Wireless/unbounded) communication media - radio wave, microwave, satellite, infrared
b) What is cyber-crime? List any two objectives of formulating cyber law in Nepal.
1|P a g e CS SEE NPABSON 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
Ans: Cybercrime refers to criminal activities or illegal actions that are conducted or facilitated through the
use of digital technology or the internet.
Any two objectives of formulating cyber law in Nepal are :
- To legalize the transaction through electronic media to control various types of electronic frauds
- To punish a person who does criminal activities through electronic means especially on computers.

c) Mention any four hardware security measures.


Ans: Any four hardware security measures are :
a) Regular Maintenance
b) Insurance
c) Air condition system
d) Power Protection device (Volt guard, Spike guard, UPS)

d) What is e-commerce? Write its two limitations.


Ans: E-commerce refers to the buying and selling of goods or services using the internet.
Any two limitations of e-commerce are:
Need to be careful about the quality of product and service delivery.
We cannot do any transaction without Internet access device.

e) List the types of E-governance. Describe any one of them.


Ans: The types of E-governance are:
· Government-to-Citizen(G2C)
· Government-to-business (G2B)
· Government-to-Government (G2G)
· Government-to-Employee (G2E)
Government-to-Citizen(G2C)
G2C-is transaction between the government to citizens. It includes online registration of birth/ death/marriage
certificates, filling of income taxes, electricity bills, license renewals etc.

f) What is DBMS? Write its two advantages.


Ans: DBMS is a software that manages databases, allowing users to store, access, and manipulate data in an
organized and secure way.
Any two advantages are:
It controls data redundancy which means duplication of data.
It provides high security of data as well as maintains accurate database

g) Write a similarity and a difference between Number field type and Currency filed type.
Ans: similarity and a difference between Number field type and Currency field type
Similarity:
Both store numerical values: Both field types are designed to store numerical data.
Difference:
Currency field type is specialized for handling monetary values by including specific currency
formats and precision, whereas the Number field type is more generic and can store any numerical data
without currency-specific formatting.

h) What is primary key? Write two examples of primary key fields.


Ans: A primary key is a field or combination of fields in a table that uniquely identifies each record, and is
used to establish relationships between tables and enforce data integrity.
Any two examples of primary key fields are SEE Registration number, Username

i) Why is query object used in MS-Access? Give two reasons.


Ans: Any two reasons to use query object in MS-Access are:
2|P a g e CS SEE NPABSON 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
Queries enable users to retrieve specific data from tables or other data sources, based on specified criteria.
Queries allow users to filter, sort, and group data in meaningful ways.

5. Write the output of the given program showing the dry run table. (2)
DECLARE FUNCTION PRO(N)
CLS
A=2
FOR J=1 TO 5
X= PRO(A)
PRINT X
NEXT J
END

FUNCTION PRO(N)
N=N+2
PRO=N
END FUNCTION

Dry Run
A J=1 to 5 X N N=N+2 PRINT X
2 1 to 5 YES 4 2 2+2=4 4
2 to 5 YES 6 4 4+2=6 6
3 to 5 YES 8 6 6+2=8 8
4 to 5 YES 10 8 8+2=10 10
5 to 5 YES 121 10 10+2=12 12
6 to 5 NO
loop exits

Output of the program is


4
6
8
10
12

6. Debug the following program

Rem to add 5 records in data file HOSPITAL.TXT


OPEN "HOSPITAL.TXT" FOR INPUT AS #5
FOR REP = 1 TO 5
INPUT "ENTER PATIENT NAME":PN$
INPUT "ENTER PATIENT ADDRESS":AD$
INPUT "ENTER PATIENT AGE": A%
INPUT "ENTER PATIENT GENDER":G$

STORE #5, PN$,AD$,A, G$


NEXT REP
CLOSE #1
END
Debugged Program

Rem to add 5 records in data file HOSPITAL.TXT


3|P a g e CS SEE NPABSON 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
OPEN "HOSPITAL.TXT" FOR APPEND AS #5
FOR REP = 1 TO 5
INPUT "ENTER PATIENT NAME":PN$
INPUT "ENTER PATIENT ADDRESS":AD$
INPUT "ENTER PATIENT AGE": A%
INPUT "ENTER PATIENT GENDER":G$
WRITE #5, PN$,AD$,A%, G$
NEXT REP
CLOSE #1
END

7. Read the following program and answer the given questions.

DECLARE SUB AA (N$)


W$=CYBERCRIME"
CALL AA(W$)
END

SUB AA (N$)
R=LEN(N$) \ 2
E$=RIGHT$(N$,R) + LEFT$(N$,R)
PRINT E$
END SUB
Questions:

a) List the parameter(s) and argument(s) of the program.


Ans: The parameter used in above program is N$ and argument used in above program is W$.
b) List all the string library functions from the program.
Ans: The string library functions used from the program are LEN ( ), RIGHT$( ), LEFT$( ).

8. Convert/Calculate as per the instruction:


a) (11100001)2 = (?)8
Convert every 3 binary digits (from bit0) to octal digit (see conversion table below):
11100001
= 11 100 001
3 = 11
4 = 100
1 = 001
= 341
(11100001)2 = (341)8

b) (A2B)16 = (?)2
Convert each hex digit to 4 binary digits (see conversion table below):
A2B
=A 2 B
= 1010 0010 1011
= 101000101011
=(DA3)16 =(101000101011)2

c) (101) X (111)
110) 1 1 0 1 1 0 (1001
d) (110110)¸/ (110) - 1 1 0
0 0 0 1 1 0
4|P a g e C 1S S 0E E 1N P A B S O N 2 0 8 0 h t t p s : / -/ s e 1
eqb1
a s i c0o m p u t e r . b l o g s p o t . c o m /
× 1 1 1
0 0 0
1 0 1
1 0 1 ×
Q=1001
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA

(101) X (111) = (100011)

Group C

9. a. Write a program in QBASIC to define a function procedure to display the area of sphere and sub
procedure to display the volume of sphere where user need to input radius in main module.
[Hint: Area = 4*3.14*R^2, Volume = 4/3*3.14*R^3]

DECLARE SUB AREA (R)


DECLARE FUNCTION VOL(R)
CLS
INPUT “Enter Radius”; R
CALL AREA(R)
PRINT “Volume of sphere=”; VOL(R)
END

SUB AREA(R)
A=4*3.14*R^2
PRINT “Area of sphere=”; A
END SUB

FUNCTION VOL(R)
VOL=4/3*3.14*R^3
END FUNCTION

b. A sequential data file 'PRODUCT.DAT contains the information regarding product Id, Product name,
Date of manufacturing and Price of some products. Write a program to display all the records deducting the
price by 20%, where price is greater than or equal to Rs.1000. [4]

OPEN “PRODUCT.DAT” FOR INPUT AS #1


CLS
WHILE NOT EOF(1)
INPUT #1, I, N$, D$, P
IF P>=1000 THEN P=P-20/100*P
PRINT I, N$, D$, P
WEND
CLOSE #1
END

10. Write a program using C language to input an integer then check whether the integer is even or
odd.

5|P a g e CS SEE NPABSON 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
#include<stdio.h>
#include<conio.h>
int main()
{
int n;
printf("Enter any number: ");
scanf("%d", &n);
if(n%2==0)
printf("%d is even number", n);
else
printf("%d is odd number", n);
return 0;
}

Write a program using C language to generate the first 25 even numbers between 100 and 200.

#include <stdio.h>

int main() {
int i, count = 0;

printf("The first 25 even numbers between 100 and 200 are:\n");

for (i = 100; count < 25; i += 2) {


printf("%d ", i);
count++;
}

printf("\n");
return 0;
}

6|P a g e CS SEE NPABSON 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
JEC BHAKTAPUR BOARD EXAMINATION 2080
Subject-Opt. II. Computer Science
Full Marks: 50
Time: 2 hrs
Candidates are required to write their answers according to the instructions given.
Attempt all questions

Group A [10 Marks]

1. Answer the following questions in one sentence:

a) What is bandwidth?
Ans: Bandwidth is the maximum amount of data that can be transmitted over a network connection in a
given amount of time.

b) What is digital footprint?


Ans: A digital footprint is the trail of data left behind by a person's online activities.

c) Which data type is used to store numeric characters or special symbols in Ms-Access?
Ans: The "Text" data type in MS-Access is used to store numeric characters or special symbols.

d) Write any two objects of MS-Access?


Ans: Two objects of MS-Access are Tables and Forms.

c) What is modular programming in Q-Basic programming?.


Ans: Modular programming in QBasic is a programming approach that breaks down a program into
separate, smaller, reusable modules or subroutines.

f) Write any two data types used in C language.


Ans: Two data types used in C language are int (for integers) and char (for characters).

2. Write the technical term for the following statements:


a) The technology o encode file or message. Encryption
b) A type of network in which each computer act as server as well as client. Peer to Peer Network.

3. Write the full forms of the following:


a) TCP/IP - Transmission Control Protocol/Internet Protocol
b) AMC - Annual Maintenance Contract

Group B
4. Answer the following questions:

a) What is computer network? Write any two disadvantages of it.


A computer network is a group of interconnected computers that share resources and information.
Two disadvantages are:
• Security risks, as unauthorized users can access sensitive data.
• Network failure, which can disrupt communication and access to resources.

b) What is computer virus? List any two preventive ways to protect computer system from computer
virus.
1|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
A computer virus is a malicious software program designed to damage or disrupt a computer system.
Two preventive ways are:
• Installing and regularly updating antivirus software.
• Avoiding the download of files or attachments from unknown or untrusted sources.

c) What is a power protection device? Write its role in computer security.


A power protection device safeguards electronic devices from power surges, voltage spikes, and
power outages.
Its role in computer security is to prevent damage to the computer's hardware and data loss due to
sudden power fluctuations.
d) Mention the benefits and limitations of E-commerce.
Benefits of E-commerce:
• Convenience of shopping anytime and from anywhere.
• A wider range of products and services available online.
Limitations of E-commerce:
• Lack of physical inspection of products before purchase.
• Concerns about online security and privacy.

e) How does IoT help in our daily life explain?


The Internet of Things (IoT) helps in daily life by connecting smart devices to the internet, allowing for
automation and remote control, such as managing home appliances, monitoring health through wearables,
and enhancing security with smart cameras.
f) What is DBMS? Give any two examples.
A Database Management System (DBMS) is software that manages and organizes data in a database,
allowing users to create, retrieve, update, and delete data.
Two examples are:
• MySQL
• Oracle

g) List any four data types of Ms-Access. Also mention its function.
Text: Stores alphanumeric characters, including text and numbers, up to 255 characters.
Number: Stores numerical data that can be used in mathematical calculations.
Date/Time: Stores dates and times in various formats.
Currency: Stores monetary values and automatically formats them with a currency symbol.
h) What is primary key? List any two advantages of it.
A primary key is a unique identifier for a record in a database table, ensuring that each record is distinct.
Two advantages are:
• It prevents duplicate records in the table.
• It helps establish relationships between tables in a database.

i) Define form. Write any two uses of it.


A form in a database is a user-friendly interface that allows users to enter, modify, and view data in a
structured format.
Two uses are:
• Data entry: Simplifies the process of entering data into a database.
• Data retrieval: Allows users to search and retrieve specific information from the database.

5. Write the output of the given program.

2|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA

DECLARE SUB Result ()


CLS
CALL Result
END

SUB Result
A=1
FOR I=1 TO 5
PRINT I*A
A = A + (10 ^ I)
NEXT I
END SUB

A I=1 TO 5 PRINT I*A A=A+(10^I)


1 1 TO 5 YES 1X1=1 1+(10^1)
=1+10=11
11 2 TO 5 YES 2*11=22 11+(10^2)
=11+100=111
111 3 TO 5 YES 3*111=333 111+(10^3)
=111+1000=1111
1111 4 TO 5 YES 4*1111=4444 =1111+(10^4)
=1111+10000=11111
11111 5 TO 5 YES 5*11111=55555 11111+(10^5)
=11111+100000=111111
111111 6 TO 5 NO
LOOP
EXITS

The output of the program is:


1
22
333
4444
55555

6. Re-write the given program after correcting bugs: REM to check whether the supplied no is even or
odd

DECLARE SUB TEST(N)


CLS
INPUT "ENTER THE NUMBER;"; N$
CALL TEST(N)
END
SUB TEST(N)
Y=2
R = Y MOD N
IF R=1 THEN
PRINT “EVEN”
OR
PRINT “ODD”
END

3|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
END SUB

Debugged Program:

DECLARE SUB TEST(N)


CLS
INPUT "ENTER THE NUMBER: ", N
CALL TEST(N)
END

SUB TEST(N)
Y=2
R = N MOD Y
IF R = 0 THEN
PRINT "EVEN"
ELSE
PRINT "ODD"
END IF
END SUB

7. Study the following program and answer the given questions: [2]

Declare function count(N$)


Input "Enter a word ", R$
C=count(R$)
PRINT C
END

Function count(N$)
For K = 1 to LEN(N$)
X$=MID$(N$,K,1)
IF UCASES(X$) = "A" then
X=X+1
End if
Next K
Count=X
End Function

(a) List any two library functions used in above program.


Ans: MID$( ) and UCASE$( ) are the two library functions used in above program.

(b) Write the use of variable "C" in line 3 [i.e. C=count(R$)] given in the above program.
Ans: The variable C stores the value returned by the function count (i.e. the number of occurrences of the
letter 'A' )
Group 'C'

8. Convert/calculate as per the instruction:

(a) (2090) 10 =( )2

4|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
Divide by the base 2 to get the digits from the remainders:
Division Quotient Remainder
by 2 (Digit)
(2090)/2 1045 0
(1045)/2 522 1
(522)/2 261 0
(261)/2 130 1
(130)/2 65 0
(65)/2 32 1
(32)/2 16 0
(16)/2 8 0
(8)/2 4 0
(4)/2 2 0
(2)/2 1 0
(1)/2 0 1
= (100000101010)2

(2090) 10 =(100000101010 )2

(c) (1001 + 110) 2 - (1000) 2

1 0 0 1
+ 1 1 0
1 1 1 1
- 1 0 0 0
0 1 1 1

(1001 + 110) 2 - (1000) 2 = (111)2

(b) (734)8 =( )16

Convert every octal digit to 3 binary digits, then convert every 4 binary digits to1 hex digit (see conversion
tables):
734
=734
7= 111
3 = 011
4 = 100

= 1 1101 1100

1= 1
1101 = D
1100 = C

= 1DC
(734)8 =(1DC )16

5|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
(d) (1110011) 2 / (1010) 2

1010) 1 1 1 0 0 1 1 (1011
1 0 1 0
1 0 0 0 1
1 0 1 0
0 0 1 1 1 1
1 0 1 0
0 1 0 1

Q=1011
R=101

9. Answer the following Questions:

(a) Write a program in QBASIC that allows user to enter radius of a circle. Create a user define
function to find the area of circle procedure to find volume of cylinder.
Hint: [A = * r ^ 2 * V =  * r ^ 2 * h]

DECLARE FUNCTION Area(R)


DECLARE SUB Volume(R, H)
CONST PI = 3.14159
CLS
INPUT "Enter the radius of the circle: ", R
PRINT "Area of the circle is: "; Area(R)
INPUT "Enter the height of the cylinder: ", H
CALL Volume(R, H)
END

FUNCTION Area(R)
Area = PI * R ^ 2
END FUNCTION

SUB Volume(R, H)
V = PI * R ^ 2 * H
PRINT "Volume of the cylinder is: "; V
END SUB

(b) A sequential data file "employee.dat" contains address, age and salary of employee. WAP to
display all information whose address is 'Kathmandu' and salary is greater than 40000.

OPEN "employee.dat" FOR INPUT AS #1


PRINT "Address", "Age", "Salary"
DO WHILE NOT EOF(1)
INPUT #1, Address$, Age, Salary
IF UCASE$(Address$) = "KATHMANDU" AND Salary > 40000 THEN
PRINT "ddress$, Age, Salary
END IF
LOOP
6|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
CLOSE #1
END

10. Write a program in C that asks a number and check whether it is positive, negative or zero.

#include <stdio.h>

int main() {
int num;
printf("Enter a number: ");
scanf("%d", &num);

if (num > 0) {
printf("The number is positive.\n");
} else if (num < 0) {
printf("The number is negative.\n");
} else {
printf("The number is zero.\n");
}

return 0;
}

Or,
Write a program in 'C' language that asks user to enter any number and check whether the number is
odd or even.

#include <stdio.h>

int main() {
int num;
printf("Enter a number: ");
scanf("%d", &num);

if (num % 2 == 0) {
printf("The number is even.\n");
} else {
printf("The number is odd.\n");
}

return 0;
}

7|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
NPABSON BOARD EXAMINATION 2080
Subject-Opt. II. Computer Science
Full Marks: 50
Time: 2 hrs
Candidates are required to write their answers according to the instructions given.
Attempt all questions

Group A [10 Marks]

1. Answer the following questions in one sentence:

a) “Internet is called network of networks”. Justify in your own words.


The Internet is called a "network of networks" because it connects millions of smaller networks (like those
of businesses, schools, and government agencies) worldwide into one large global network.

b) What is digital footprint?


A digital footprint is the trail of data that is left behind while using the internet which includes online
activities, posts, and information shared.

c) Which view is used to insert the data in table of MS-Access?


The Datasheet View is used to insert data into a table in MS-Access.

d) Write down the backslash character (Escape sequence) for horizontal tab and new line in C
program
The backslash escape sequences for horizontal tab is \t and fir new line is \n in C program.

e) How do you define modular programming in Q-Basic?


Modular programming in Q-Basic refers to breaking down a program into smaller, manageable subroutines
or functions that perform specific tasks.

f) What is query in MS-Access?


A query in MS-Access is a way to retrieve specific data from one or more tables based on certain criteria.

2. Write appropriate technical term

(a) Network connecting device that boost the data signal. Repeater
(b) A code of behavtor for using Intermet Netiquette

3. Write the full form

a. SMTP - Simple Mail Transfer Protocol


b. PSTN - Public Switched Telephone Network

4. Answer the following questions:

Group (Short Questions-24 Marks)

(a) Define Network topology. Explain star topology with suitable diagram.

1|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
Network Topology refers to the layout or arrangement of different elements (links, nodes, etc.) in a
computer network.
Star Topology is a network topology where all nodes (computers or devices) are connected to a central hub
or switch. The hub acts as a repeater for data flow, and each node communicates with the hub directly.

(b) What is computer ethics? Write any two examples


Computer Ethics refers to the moral guidelines that govern the use of computers and information systems.
Examples:
1. Not using someone else's intellectual property without permission (e.g., software piracy).
2. Respecting others' privacy by not accessing unauthorized data.

(c) What is back up? Why it is important in security system.


Backup is the process of creating copies of data to restore it in case the original data is lost, corrupted, or
damaged.
Importance in Security System:
1. It ensures data availability in case of hardware failure or cyber-attacks.
2. It allows recovery of essential information after accidental deletion or natural disasters.

(d) What is online payment? Write the different forms of e-payment in Nepal?
Online Payment refers to the transfer of money or funds over the internet to purchase goods or services.
Forms of E-Payment in Nepal:
1. eSewa - A popular digital wallet for various transactions.
2. Khalti - A digital wallet for online payments and utility bill payments.
3. ConnectIPS - A payment gateway for transferring funds and making payments directly from bank
accounts.
4. IME Pay - A mobile payment system for transferring money and paying bills.

(e) What is lot? Write any two importance of if?


IoT (Internet of Things) is a network of interconnected devices that can communicate and exchange data
with each other over the internet.
Importance:
1. Automation and Control: IoT enables automation of routine tasks, improving efficiency and
reducing human intervention.
2. Data Collection and Analysis: IoT devices collect vast amounts of data, which can be analyzed to
make informed decisions and improve services.

(1) What is DBMS? Give some examples of DBMS software.


DBMS (Database Management System) is a software system that manages and organizes data in
databases, allowing users to store, retrieve, and manipulate data efficiently.
Examples:
1. Oracle
2. MySQL
3. Microsoft SQL Server
4. PostgreSQL

(9) What does date type used for? List out any four data types in MS-Access
Data Types are used in databases to define the kind of data that can be stored in a particular field, ensuring
data consistency and integrity.
Four Data Types in MS-Access:
1. Text - Used for storing alphanumeric data.
2. Number - Used for storing numerical data.
3. Date/Time - Used for storing date and time values.
2|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
4. Currency - Used for storing financial data with currency symbols.

(h) Differentiate between select query and action query?


Select Query: A query that retrieves and displays data from one or more tables based on specified
criteria. It does not alter the data.
Action Query: A query that performs an action on the data, such as inserting, updating, deleting records,
or creating new tables.
(1) What is report? Write down its important.
Report in database systems is a formatted and organized presentation of data extracted from a database,
often used for analysis, decision-making, or record-keeping.
Importance:
1. Data Presentation: Reports present complex data in an easily understandable format, often
including summaries and visual elements.
2. Decision-Making: Reports help in making informed decisions by providing clear and organized
information.
5. Write down the output of given program with dry run.

DECLARE SUB display(E$)


CLS
E$=”National”
CALL display(E$)
END

SUB display(E$)
FOR I= 1 to LEN(E$) step 2
B$=MID$(A$,I,1)
PRINT B$;
NEXT I
END SUB

E$ I= 1 to LEN(E$) step 2 B$=MID$(A$,I,1) PRINT B$;


National 1 to 8 yes National,1,1=N N
3 to 8 yes National, 3, 1 = t Nt
5 to 8 yes National, 5, 1 = 0 Nto
7 to 8 yes National, 7, 1 = a Ntoa
9 to 8 no loop exits
The output of the program is:
Ntoa

6. Rewrite the program after correcting the bag

DECLARE SUB great(p,q)


CLS
INPUT "Any two numbers”; a, b
DISPLAY great (p, q)
END

SUB great (p, q)


IF a < b THEN
PRINT p;
ELSE
PRINT q;

3|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
END
END SUB

Debugged Program
DECLARE SUB great(p,q)
CLS
INPUT "Any two numbers”; a, b
CALL great (a, b)
END

SUB great (p, q)


IF p > q THEN
PRINT p;
ELSE
PRINT q;
END IF
END SUB

7. Study the following program and answer the given question.

OPEN "data.txt" FOR OUTPUT AS #1


Top:
INPUT "STUDENT'S NAME”; N$
INPUT “CLASS”; C
INPUT "ROLL”; R
WRITE #1, N$, C, R
INPUT "MORE records?"; y$
IF y$=”Y” THEN GOTO top
CLOSE #1
END

(a) Write down the mode used in above program.


The mode used in the above program is OUTPUT.

(b) Write the name of String variable exist in file based on above program.
N$ and y$ are the string variable used in the above program.

8. Convert/Calculate as per instrustion.

(a) (2080)10 into binary

Divide by the base 2 to get the digits from the remainders:


Division Quotient Remainder
by 2 (Digit)
(2080)/2 1040 0
(1040)/2 520 0
(520)/2 260 0
(260)/2 130 0
(130)/2 65 0
(65)/2 32 1
(32)/2 16 0

4|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
(16)/2 8 0
(8)/2 4 0
(4)/2 2 0
(2)/2 1 0
(1)/2 0 1
= (100000100000)2
(2080)10 = (100000100000)2

(b) (BAD)16 into Octal

Convert each hex digit to 4 binary digits and then convert each 3 binary digits to octal digits (see conversion
tables below):
BAD
=BAD
B= 1011
A =1010
D=1101
= 101 110 101 101

5= 101
6=110
5=101
5=101

= 5655
(BAD)16 into = (5655)8

(c) (110010) x (1100)+(11010)

1 1 0 0 1 0
1 1 0 0
0 0 0 0 0 0
0 0 0 0 0 0 x
1 1 0 0 1 0 x x
1 1 0 0 1 0 x x x
1 0 0 1 0 1 1 0 0 0
+ 1 1 0 1 0
1 0 0 1 1 1 0 0 1 0

(110010) x (1100)+(11010) = 01001110010

(d) (1010001) / (101)

101) 1 0 1 0 0 0 1 (10000
1 0 1
0 0 0 0 0 0 1
0
1
Q=10000
R=1

5|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA

Group 'C' (Long Questions-16 Marka)

9. (a) WAP to Find area of Four walls using FUNCTION END FUNCTION and area of rectangle
using SUB END SUB

DECLARE FUNCTION AOFW(l, b, h)


DECLARE SUB AOR(l, b)
CLS
INPUT "Enter the length: ", l
INPUT "Enter the breadth: ", b
INPUT "Enter the height: ", h
PRINT "Area of the four walls: "; AOFW(l, b, h)
CALL AOR(l, b)
END

FUNCTION AOFW(l, b, h)
AOFW = 2 * h * (l + b)
END FUNCTION

SUB AOR(l, b)
A=l*b
PRINT "Area of the rectangle: "; A
END SUB

(ti) WAP to ask student's name, class and marks secured in three subjects. Store the data in a
sequential data file “result.dat” along with total marks. Make provision to ask user to enter another
record.
OPEN "result.dat" FOR OUTPUT AS #1

DO
INPUT "Enter student's name: ", N$
INPUT "Enter class: ", C$
INPUT "Enter marks in subject 1: ", M1
INPUT "Enter marks in subject 2: ", M2
INPUT "Enter marks in subject 3: ", M3
Total = M1 + M2 + M3
WRITE #1, N$, C$, M1, M2, M3, Total
INPUT "Do you want to enter another record? (Y/N): ", ans$
LOOP WHILE UCASE$(ans$) = "Y"
CLOSE #1
END

10. WAP to read two numbers and display the smaller one using C-Program
#include <stdio.h>
int main() {
int num1, num2;
printf("Enter the first number: ");
scanf("%d", &num1);
printf("Enter the second number: ");
scanf("%d", &num2);

// Find and display the smaller number


6|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
if (num1 < num2) {
printf("The smaller number is: %d\n", num1);
} else {
printf("The smaller number is: %d\n", num2);
}
return 0;
}

Or,
WAP to display the sum of first 10 natural numbers using C-Program.
#include <stdio.h>

int main() {
int sum = 0;
for (int i = 1; i <= 10; i++) {
sum += i;
}
printf("The sum of the first 10 natural numbers is: %d\n", sum);
return 0;
}

7|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
SOLVED NPABSON SEE PRE BOARD EXAM - 2078
Subject: Computer F.M. : 50
1. Answer the following questions in very short: 1×10=10

i. What is computer network?


Computer network is a group of two or more computers and devices connected to each other through wired or wireless
media to exchange data and information and share hardware, software and other resources.

ii. What is e-mail?


E-mail is the most widely used service on the Internet which sends and receives messages electronically through the
Internet.
iii. What is full form of ISDN?
The full form of ISDN is Integrated Services Digital Network

iv. What is the full form of WAN?


The full form of WAN is Wide Area Network

v. Write the technical term: The arrangement of connection patterns of computers or nodes and
others resources. Network Topology

vi. Write the technical term: Commerce done by mobile. M-Commerce

vii. What is primary key?


A primary key is a field or combination of fields in a table that uniquely identifies each record, and is used to establish
relationships between tables and enforce data integrity.

viii. What is DBMS?


DBMS is a computerized system that stores data, processes them and provides information in an organized form.

ix. What is modular programming?


Modular programming is a technique used to divide our program into many small logical, manageable and functional
modules or blocks.

x. Write down two data type of C language.


The two data types used in C language are char and int

3. Answer the following questions in short: 2×9=18

i. What is transmission medium? Write down with examples.


A channel or path through which data and information are transmitted between connected devices in a network environment
is called communication media. Examples are: twisted pair cable, co-axial cable, radio wave, microwave etc

ii. What is Internet? Write down its services.


The worldwide connection of computer networks that use TCP/IP protocols to communicate with one another using wire or
wireless media as well as network devices is called the Internet. The services of internet are: WWW (World Wide
Web), E-mail (Electronic mail), FTP (File Transfer Protocol), IRC (internet Relay Chat) etc.

iii. What is computer security? Give some examples.


Computer security refers to protecting computer and its content from damage, theft or misuse and action to prevent such
incidents. Examples are: Password, Biometric, Firewall, Cryptography etc.

iv. What is cyber law? Give some examples.

1|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
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. Examples of cyber law are Electronic and Digital Signature Law, Cyber Crime
Law, Intellectual property Law, Data Protection and Privacy Law etc.

v. What is computer virus? Give some examples.


A computer virus is a destructive program that copies itself and infects a PC, spreading from one file to another, and then
from one PC to another when the files are copied or shared. E.g. C-Brain, Frodo, Disk Killer, I Love You etc

vi. What is data type? What happens while we enter text in number data type?
Data type is an attribute for a field that determines the type of data that can be stored in that field. If we enter text in a
numeric field then it display an error message indicating that the data type is incorrect.

vii. What is sort?


The process of arranging all the records in a table either ascending or descending order based on field or fields is known as
sorting.

viii. What is table? Is table a database?


Tables are the primary building block of database which stores and manages large volume of data into rows and column.
No, Table is not a database. A table is an object inside a database.

ix. What is report?


Report is one of the MS-Access database objects used to present information in an effective and organized format that is
ready for printing.

x. Debug the following program.


DECLARE FUNCTION PAL$ (W$)
CLS
INPUT "Enter a word"; W$
SHOW PAL$ (W$)
END
FUNCTION PAL$ (W$)
FOR I= LEN (W$) TO 1 STEP1
R$=R$+MID$ (W$, I, 1)
NECT I
IF R$-W$ THEM
P$="Palindrome"
ELSE
P$="Not palindrome"
ENDIF
P$=PAL$
END FUNCTION

Debugged Program
DECLARE FUNCTION PAL$ (W$)
CLS
INPUT "Enter a word"; W$
PRINT PAL$ (W$)
END

FUNCTION PAL$ (W$)


FOR I= LEN (W$) TO 1 STEP-1
R$=R$+MID$ (W$, I, 1)
NEXT I
2|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
IF R$=W$ THEM
P$="Palindrome"
ELSE
P$="Not palindrome"
ENDIF
PAL$ =P$
END FUNCTION

xi. What will be output?


DECLARE FUNCTION FACT (N)
CLS
N=5
PRINT FACT (N)
END
FUNCTION FACT (N)
F=1
FOR I=1 TO N
F=F*I
NEXT I
FACT=F
END FUNCTION

Dry Run
N F FOR I=1 to 5 F=F*I FACT=F PRINT FACT
(N)

5 1 1 to 5 Yes 1x1=1 FACT=120 120


1 2 to 5 Yes 1x2=2
2 3 to 5 Yes 2x3=6
6 4 to 5 Yes 6x4=24
24 5 to 5 Yes 24x5=120
120 6 to 5 No
LoopExits
The output of the program is
120

xii. Study the following program and answer the given questions:
DECLARE SUB PC$ (N)
CLS
INPUT "Enter a number"; N
CALL PC$ (N)
END
SUB PC$ (N)
FOR I=2 TO N-1
R=N MOD I
IF C=0 THEN
PRINT "Prime number"
ELSE
PRINT "Composite number"
ENDIF
END SUB
a. What is the name of sub procedure?

3|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
The name of the sub procedure is PC$( )
b. List the local variable.
The local variable are N, I, R, C

1. Write a program in QBASIC to ask a number and display sum of digits by using FUNCTION..END
FUNCTION. [4]
DECLARE FUNCTION SUM (N)
CLS
INPUT "ENTER ANY NUMBER"; N
PRINT "SUM OF DIGITS="; SUM(N)
END

FUNCTION SUM (N)


S=0
WHILE N < > 0
R = N MOD 10
S=S+R
N = N \ 10
WEND
SUM = S
END FUNCTION
2. Write a program in QBASIC to create a file "EMP.DAT" and store employees Name, Address,
Salary and Telephone number on the basis of user choice. [4]
OPEN “EMP.DAT” FOR OUPUT AS #1
DO
CLS
INPUT “ENTER NAME”; N$
INPUT “ENTER ADDRESS”; A$
INPUT “ENTER SALARY”; S
INPUT “ENTER TELEPHONE NUMBER”; T
WRITE #1, N$, A$, S, T
INPUT “DO YOU WANT TO CONTINUE”; CH$
LOOP WHILE UCASE$(CH$) = “Y”
CLOSE #1
END
3. Write a program in C language to ask length, breadth and height and display volume of box. [4]
#include<stdio.h>
#include<conio.h>
int main()
{
int l,b,h,v;
printf("Enter length: ");
scanf("%d", &l);
printf("Enter breadth: ");
scanf("%d", &b);
printf("Enter height: ");
scanf("%d", &h);
v=l*b*h;
printf("Volume of box= %d", v);
return 0;
}

2. Solve the problem as indicated: 1×4=4


4|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
i. (209)10 into Octal number

ii. (A0F)16 into Binary number.


Convert each hex digit to 4 binary digits (from conversion table below):
A0F
=A0F
A = 1010
0 =0000
F = 1111
= 101000001111
(A0F)16 = (101000001111)2

i. (1011011)2 × (110)2

ii. (1110001)2 ÷ (101)2

5|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
SEE PRE-BOARD EXAM -2078
Subject: Opt II Computer Science Full Marks: 50
Time : 1.5 hrs
Attempt all the questions.
Group ’A’ 10 x 1 = 10
Very short questions.

1) Give answer in one sentence for the following question. 6 x1 =6


a) Define bandwidth.
Bandwidth can be defined as the maximum volume of data that can be transmitted through a communication
system.
b) What is cyber bulling?
Cyber bullying is a kind of harassment using mobiles or computers.
c) What is AI?
Artificial intelligence (AI) is an area of computer science that emphasizes the creation of intelligent
machines that work and reacts like humans.
d) What is the storage size of memo and text data type in MS- Access?
Text can store up to 255 characters and Memo can store up to 65,535 characters
e) What is local variable?
Variables which are declared inside a module and which cannot be accessed by other module are called local
variables.
f) What is an operator in C language?
Operator is a symbol that is used to perform mathematical operations.

2) Write appropriate technical terms for the following. 2 x1=2


a) Secret group of characters which helps to protect file from unauthorized person. Password
b) A type of network in which every computer works as both client and server. Peer to Peer Network

3) Write the full forms of the following. 2x1=2


i) ADSL – Asymmetric Digital Subscriber Line
ii) TCP/IP – Transmission Control Protocol / Internet Protocol

Group ’B’ 12 x 2 = 24
4) Answer the following questions. 9 x2 =18
a) Differentiate between LAN and WAN.

Local Area Network is a network limited within a small area like a room, a building, school, college,
etc. generally connected through wire media.
LAN WAN
Local Area Network is a network limited Wide Area Network is a network that is extended to
within a small area like a room, a building, a large area i.e. whoke world in which computers
school, college, etc. generally connected are connected through wireless technology or
through wire media. media as satellite communication
The speed of LAN is high(more than The speed of WAN is slower than LAN.
WAN).
LAN is owned, managed, and used by an WAN can be either private or public. The Internet is
individual or an organization. Therefore, it the best example of public WAN.
is a private network.
The maintenance cost of LAN is easy. The maintenance cost of WAN is difficult.

1|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA

b) Write any four commandments of computer ethics.


Any four commandments of computer ethics are:
· You should not use a computer to harm other people.
· You should not search the file or record of other people.
· You should not spread false and illegal information.
· You should not destroy, erase or edit personal or group records.

c) What is E- commerce? List any two E- commerce companies in Nepal.


Ecommerce, also known as electronic commerce or internet commerce, refers to the buying and
selling of goods or services using the internet.
Any two E- commerce companies in Nepal are sastodeal and daraz.

d) What are the advantages of cloud computing?


The advantages of cloud computing are:
· Cloud allows us to quickly and easily access, store information anywhere, anytime in the whole
world, using an internet connection.
· Cloud computing reduces both hardware and software maintenance costs for organizations.

e) What is VR? Mention its application areas.


An artificial environment created with computer hardware and software and presented to the user in such
a way that it appears and feels like a real environment is called Virtual Reality.
Its application areas are:
• It can be used in medical studies to enable students to know the human body structure.
• It can be used in driving schools as it give a real look of roads and traffic.

f) What is DBMS? Give any two examples.


Database management system (DBMS) is a computerized system that stores data process them and provide
information in an organized form.
Any two examples are MS-Access and Oracle.

g) What is primary key? List any two advantages.


A key that uniquely identifies each record in a database is primary key.
Any two advantages of primary key are:
· To reduce and control duplication of record in a table.
· To set the relationship between tables.

h) What is query?
Query is an object of Ms-Access which extracts and arranges information from a table in a manner that is
specified.

i) What is data sorting? Write its two advantages.


Sorting is the process of arranging the record in ascending or descending order according to a given field or
fields.
Any two advantages of sorting are:
· It helps to find specific information quickly.
· It helps to arrange data in alphabetical order.
5) Write down the output of the given programs. [2]
DECLARE SUB DISPLAY (A)
CLS
A= 3
CALL DISPLAY (A)
END
2|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
SUB DISPLAY (A)
FOR X = 1 TO 6
PRINT A;
IF A MOD 2 = 0 THEN
A=A/2
ELSE
A= (A*3)+1
END IF
NEXT X
END SUB

Dry Run
Var. Var. O/P CONDITION
A X 3 10 5 16 8 4 A MOD 2=0

3 1 3 MOD 2=0
1=0 NO
10 2 10 MOD 2=0
0=0 YES
5 3 5 MOD 2=0
1=0 NO
16 4 16 MOD 2=0
0=0 YES
8 5 8 MOD 2=0
0=0 YES
4 6 4 MOD 2=0
0=0 YES
2 7 Loop terminates
The output of the program is
3 10 5 16 8 4

6) Re-write the given program after correcting the bugs. [2]


REM to add more data in a sequential file.
OPEN “EMP.DAT” FOR INPUT AS #2
DO
INPUT “ENTER NAME”; N$
INPUT “ENTER ADDRESS”; A$
INPUT “ENTER SALARY”; S$
WRITE #1, N$, A$, S
INPUT” Do you want to add more records.”; M$
LOOP WHILE UCASE(M$) = “Y”

END
Debugged Program
REM to add more data in a sequential file.
OPEN “EMP.DAT” FOR APPEND AS #2
DO
INPUT “ENTER NAME”; N$
INPUT “ENTER ADDRESS”; A$
INPUT “ENTER SALARY”; S
WRITE #2, N$, A$, S
INPUT” Do you want to add more records.”; M$
3|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
LOOP WHILE UCASE$(M$) = “Y”
CLOSE #2
END
7) Study the given program and answer the given questions. [2]
DECLARE FUNCTION test$ (A$)
CLS
INPUT “ENTER ANY WORD”; T$
PRINT test$(t$)
END
FUNCTION test$ (A$)
FOR M = LEN(A$) TO 1 STEP -1
C$= C$+ MID$(A$, M,1)
NEXT M
Test$ = C$
END FUNCTION
a) List the formal and actual parameters used in the program given above.
Formal parameter= A$
Actual parameter = t$
b) List the library function used in the above program.
The library function used in the above program is LEN( ) and MID$( ).

Group ‘C’ [4 x4= 16]


8) Convert/Calculate as per the instruction: 4 x1 =4
a) (CCA)16into binary
(CCA)16 = (110011001010)2
b) (654)10 into octal
(654)10 = (1216)8
c) (111011 / 100)2
Q=1110 R=11
d) (10101 - 1110)2 x (10) 2

(10101 - 1110)2 x (10) 2 = 1010

4|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
9) Write a program in QBASIC that allows user to enter radius of a circle. Create a user define function to
find the area of circle and sub procedure to find volume of a cylinder. Hint: [A= r2 v= r2h]
DECLARE FUNCTION AREA (R)
DECLARE SUB VOL(R, H)
CLS
INPUT “Enter Radius”; R
INPUT “Height”; H
PRINT “Area of Circle=”; AREA(R)
CALL VOL(R, H)
END

FUNCTION AREA(R)
AREA = 3.14 * R ^ 2
END FUNCTION

SUB VOL (R, H)


V = 3.14 * R ^ 2 * H
PRINT “Volume of Cylinder=”; V
END SUB

10) A sequential data file “emp.dat” contains employee’s name, address, gender and salary. WAP to display
all the information of employees whose salary is more than Rs. 20,000
OPEN “emp.dat” FOR INPUT AS #1
CLS
WHILE NOT EOF(1)
INPUT #1, N$, A$, G$, S
IF S>20000 then PRINT N$, A$, G$, S
WEND
CLOSE #1
END

11) Write a program in C language to input any two numbers and find greater number.
#include<stdio.h>
#include<conio.h> Write a program in C language that asks user
int main() to enter any number and check whether the
{ number is odd or even.
int a,b; #include<stdio.h>
printf("Enter any two numbers:\n "); #include<conio.h>
scanf("%d %d", &a, &b); int main()
if(a > b) {
printf("The greater number is %d", a); int n;
else printf("Enter any number: ");
printf("The greater number is %d", b); scanf("%d", &n);
return 0; if(n % 2 = = 0)
} printf("%d is even number", n);
else
printf("%d is odd number", n);
OR return 0;
}

5|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
SEE PRE BOARD EXAM - 2078
SUBJECT: COMPUTER SCIENCE
1. Answer the following question in one sentence.

a) What is an email?
Ans: E-mail is the most widely used service on the Internet which sends and receives messages
electronically through the Internet.

b) What is cyber law?


Ans: 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.

c) What is the field size of yes/no field?


Ans: The field size of YES/NO field is 1 bit.

d) Write any two objects of ms access.


Ans: Any two objects of ms access are i) tables ii) queries.

e) What is module?
Ans: Module is a block of statement that solves a particular problem.

f) Write any two data types of C language.


Ans: any two data types of C language are int and char.

2. write appropriate technical term for the following.


a) business through internet. E- Commerce
b) A types of network in which each computer can act as a server as well as client. Peer to peer
netwrok
c) a collective online communications channels dedicated to community based input, interaction,
content sharing and collaboration. Social media
d) the smallest unit to represent information on quantum computer. Qubit (quantum bit)

3. write the full form of the following.


B2B = Business to Business
FTP = File Transfer Protocol
ICT = Information and Communication Technology
LAN = Local Area Network

Group - B
4. Answer the following questions.
a) Write any two advantages and disadvantages of computer network.
Ans: any two advantages of computer network are:
1. A network connected computers can share hardware devices such as scanner, printer, hard disk,
etc.
2. Networking also provides the facility of data and software backup system.
Any two disadvantages of computer network are:
1. Computer network can be route for computer virus and malware transmission.
2. Skilled manpower is required to manage and operate computer network.

b) What is digital footprint? Write any two tips to maintain digital reputation.
Ans: a digital footprint is a trail of data you create while using the internet.
1|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
Any two tips to maintain digital reputation are:
i. Be transparent
ii. Respond to every review

c) What is password policy? Write any two important criteria for creating strong password.
Ans: A password policy defines the password strength rules that are used to determine whether a new
password is valid.

Any two important criteria for creating strong password are:


i. Do not keep a password which can be easily guessed such as date of birth, nickname etc.
ii. Keep changing you password regularly.

d) What is e-commerce? Write any two disadvantages of e-commerce.


Ans: E- Commerce refers to the buying and selling of goods or services using the internet.
Any two disadvantages of e-commerce are:
• Lack of personal touch. We cannot touch the goods physically.
• We cannot do any transaction without Internet access device. So, it is heavily dependent on
Internet technologies

e) What is IoT? Write any two advantages of it.


Ans: A technology that connects all electronic devices together and prompts them to exchange
information without any human intervention is called IoT.
Any two advantages of IoT are:
• It reduces the human effort, so it saves a lot of time.
• Information is easily accessible from any place at any time on any device.

f) What is DBMS? Write any two examples.


Ans: DBMS is a software which helps to extract , view and manipulate data in an organized way.
Any two examples of DBMS are: i) Oracle ii) MS - Access

g) What is MS Access? Write any two advantages of it.


Ans: MS Access is a relational database management system which is used to store and manipulate
large volumes of data in the form of table.
Any two advantages of MS Access are:
a) It provides the flexible ways to add, edit, delete and display the related data.
b) Queries help to view, change and analyse the data indifferent ways.

h)What is query? Write its type.


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.
Types of queries are: i) Select queries ii) Action queries

i)What is data type? Write some data types of ms access.


Ans: Data type is an attribute for a field that determines the type of data that can be stored in that
field. Some data types of ms access are: i) Number ii) date/time iii) currency iv)
autonumber

5. Write down the output of the given program. Show with the dry run in table.
DECLARE SUB SERI ( )
CLS
2|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
CALL SERI
END
SUB SERI
A$ = "SCIENCE"
B = LEN (A$)
FOR I = 1 TO 4
PRINT TAB(I); MID$(A$, I, B)
B =B-2
NEXT I
END SUB
DRY RUN TABLE:
A$ B = LEN (A$) I=1 TO 4 PRINT TAB(I); MID$(A$, I, B)
SCIENCE 7 1 TO 4 yes SCIENCE
5 2 TO 4 yes CIENC
3 3 TO 4 yes IEN
1 4 TO 4 yes E
-1 5 TO 4 No LOOP EXITS

OUTPUT:
SCIENCE
CIENC
IEN
E
CORRECT PROGRAM
6. Rewrite the given program after correcting the bugs. DECLARE FUNCTION REV (A)
Rem to convert the given number in reverse order CLS
DECLARE FUNCTION REV (A) INPUT "ENTER A NUMBER"; A
CLS RE=REV(A)
INPUT "ENTER A NUMBER"; A PRINT "REVERSE ="; RE
CALL REV (A) END
PRINT "REVERSE ="; RE FUNCTION REV (A)
END WHILE A<> 0
FUNCTION REV$ (A) R= A MOD 10
WHILE A<> 0 S = S * 10 + R
R= A MOD2 A = A \ 10
S = S * 10 + R WEND
A = A - 10 REV = S
WEND END FUNCTION
REV = S
END SUB

7. Study the following program and answer the given questions.

3|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
CLS
OPEN "INFO.DAT" FOR INPUT AS #5
TOP:
INPUT "ENTER NAME"; N$
INPUT "ENTER ADDRESS";A$
INPUT "ENTER PHONE NUMBER";P
WRITE #5, N$, A$, P
INPUT "DO YOU WANT TO CONTINUE (Y/N)?"; AN$
IF UCASE$ (AN$) = "Y" THEN GOTO TOP
CLOSE #5
END
Questions:
a) List the variables used in above program.
Ans: variables used in above programs are: A$, P, N$, AN$.

b) What is the name of data file used in above program?


Ans: INFO.DAT is the name of data file used in above program.
Group - C
8. Convert / calculate as per the instruction:
a) (110111)2 into (decimal)
= 1 * 25 + 1 * 24 + 0 * 23 + 1 * 22 + 1 * 21 + 1 * 20
= 32 + 16 + 0+ 4 + 2 + 1
= 55
b)(25AF)16 into (Binary)
Hexadecimal value 25 A F
Binary value 0010 0101 1010 1111
(25AF)16 = (10010110101111)2

c)11110 + 10011 = 110001

d) 1110 ÷ 110 = 10

Remainder: 10

4|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
9. Write a program in QBASIC that ask the radius of circle. Write a program to calculate the
area and circumference of a circle. Create a user defined function first (r) to calculate area and
sub procedure second (r) to calculate circumference of a circle.
Ans:
DECLARE FUNCTION FIRST (R) FUNCTION FIRST (R)
DECLARE SUB SECOND (R) FIRST = 3.14 * R ^ 2
CLS END FUNCTION
INPUT "ENTER RADIUS"; R
PRINT " AREA OF A CIRCLE="; FIRST (R) SUB SECOND (R)
CALL SECOND (R) C = 2 * 3.14 * R
END PRINT " CIRCUMFERENCE
OF CIRCLE =" ; C
END SUB

10. Write a program to update the rate by increasing 10% from a sequential data file
"Data.dat" that store item name, rate and quantity.
OPEN "DATA.DAT" FOR INPUT AS#1
OPEN "TEMP.DAT" FOR OUTPUT AS #2
CLS
PRINT "DATA UPDATED BY INCREASING 10%"
PRINT "ITEM NAME", "RATE", "QUANTITY"
WHILE NOT EOF (1)
INPUT #1, N$, R, Q
R1 = R + 10/100 * R
WRITE #2, N$, R1, Q
WEND
CLOSE #1, #2
KILL "DATA.DAT"
NAME "TEMP.DAT" AS "DATA.DAT"
END
10. Write a program in c language to calculate simple interest.
#include <stdio.h>
#include <conio.h> Write a C program to find the sum
int main() of first 10 natural numbers.
{ #include <stdio.h>
float p, t, r, i; int main( )
printf("Enter the principal amount : "); {
scanf("%f", &p); int i, sum = 0;
printf("Enter the number of years : "); i = 1;
scanf("%f", &t); while (i <= 10) {
printf("Enter the rate of interest : "); sum += i;
scanf("%f", &r); ++i;
i = (p * t * r) / 100; }
printf("Simple Interest = %f", i); printf("Sum = %d", sum);
return 0; return 0;
} }
or
Solved BY: Saugat Basnet

5|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/


SOLVED TRITON SEE MODEL QUESTIONS | OPT.II Computer Science
OPT.II COMPUTER SCIENCE (3031)
Computer Science - SEE Model Question (Set-I)

Time: 2 Hours F.M.: 50

Group A (10 Marks)

1. Answer the following questions in One sentence 6 × 1 =6

a. What is web server?


Ans: Web server is a computer on the Internet that delivers web pages.

b. List out any two applications of internet.


Ans: Any two applications of internet are email and chat.

c. What is the extension of MS- Access 2007?


Ans: The extension of MS- Access 2007 is .accdb.

d. What is report in MS- Access?


Ans: Report is one of the MS-Access database objects used to present information in an effective and
organized format that is ready for printing.

e. What is Modular programming?


Ans: Modular programming is a technique which divides program into many small logical, manageable
and functional modules or blocks.

f. Write down any two data type used in C-programming?


ge
lle
Co
&
SS
n
ito
Tr

Ans: char and int are any two data type used in C-programming.

2. Write appropriate technical term for the following 2 × 1=2


a. Private networks that allow organizations to share information and resources among the internal users.
– Intranet

b. The process of arranging the fragmented file in computer.


- Defragmentation

3. Write the full form of the following 2 × 1=2


a. FTP – File Transfer Protocol

b. IoT – Internet of Things

Group B (24 Marks)

4. Answer the following questions: 9 × 2=18

a. What is network topology? Write down the advantages of BUS topology.


Ans: Network topology is the inter-connected pattern of network components.
The advantages of BUS topology are:
• It is cost effective and cable required is least compared to other network topology.
• It is used in small networks and easy to expand network.

SOLVED BY: DEEPAK SHRESTHA


SOLVED TRITON SEE MODEL QUESTIONS | OPT.II Computer Science
b. What is cyber-crime? Explain with example.
Ans: Cyber-crime refers to illegal activities committed through the use of computers and Internet.
Example of cyber-crime is cyber bullying. Cyberbullying is bullying that takes place over digital
devices like cell phones, computers, and tablets.
Cyber bullying includes sending rude emails, texts or instant messages online or on the phone, posting
hurtful things about someone on social media etc.

c. How password policy protects computer software and data? Explain.


Ans: A password policy keeps computer software and data safe by ensuring users to create strong and
unique passwords. It helps stop unauthorized access, reduces security risks, and keeps the system
working properly.

d. Write down the advantages and disadvantages of e-commerce.


Ans: The advantages of e-commerce are:
• Faster buying/selling procedure, as well as easy to find products.
• Buying/selling anytime and anywhere.
The disadvantages of e-commerce are:
• Lack of personal touch. We cannot touch the goods physically.
• We cannot do any transaction without internet access device.

e. Define e-governance. List out the advantages of e-governance.


Ans: E-governance is a set of services provided by the government to public via electronic media
especially using Internet.
The advantages of e-governance are:
• Citizens can access government services and information conveniently from anywhere.
• Corruption will be reduced as there will be direct interaction with the system and public without
any intermediaries.
ge
lle
Co
&
SS
n
ito
Tr

f. What is DBMS? Give Example.


Ans: Database management system (DBMS) is a computerized system that stores data, processes them
and provides information in an organized form. Example of DBMS are: MS-Access, Oracle, MySQL,
Fox Pro.

g. What is data sorting? List any two advantages of using it.


Ans: The process of arranging all the records in a table either ascending or descending order based on
field or fields is known as sorting.
Any two advantages of using it are:
• Sorting helps to organize data and make it easier to find and retrieve specific information.
• Sorting can save time and improve efficiency by allowing users to quickly access the data they
need.

h. What is form? Explain.


Form is one of the MS-Access database objects that is primarily used to create an interface for entering
data in a table or multiple linked tables.
Forms are basically GUI (Graphical Users Interface) using which users interact with MS-Access
database. Form also displays complete record one at a time, so we can view and modify records using
the form.

i. List out the data type used for the following data in MS-Access
Student’ Name, Students’ Roll Number, Address, Fee paid
Ans: The data type used for the following data in MS-Access are:
Student’ Name – Text , Students’ Roll Number- Number , Address- Memo , Fee paid - Currency

SOLVED BY: DEEPAK SHRESTHA


SOLVED TRITON SEE MODEL QUESTIONS | OPT.II Computer Science
5. Write down the output of the following along with dry run table. 2
DECLARE SUB SENDUP(S$)
E$=” NPABSON”
CALL SENDUP(E$)
END
SUB SENDUP(S$)
FOR i=1 to LEN(S$) STEP 1
IF i MOD 2<> 0 THEN
EE$=EE$+LCASE$(MID$(S$,i,1))
ELSE
EE$=EE$+UCASE$(MID$(S$,i,1))
END IF
PRINT EE$
END SUB
Dry Run
E$ S$ i=1 to i MOD 2 <>0 Yes No
LEN(S$) EE$=EE$+ EE$=EE$+
LCASE$(MID UCASE$(MIDS(S$,I,1))
S(S$,I,1))
NPABSON NPABSON 1 to 7 1 MOD 2 <>0 n n+P=nP
yes 1<>0 Yes

2 to 7 2 MOD 2 <>0
yes 0<>0 No
3 to 7 3 MOD 2 <>0 nP+a
yes 1<>0 Yes nPa
ge
lle
Co
&
SS
n
ito
Tr

4 to 7 4 MOD 2 <>0 nPa+B


yes 0<>0 No nPaB
5 to 7 5 MOD 2 <>0 nPaB+s
yes 1<>0 Yes nPaBs
6 to 7 6 MOD 2 <>0 nPaBs+O
yes 0<>0 No nPaBsO
7 to 7 7 MOD 2 <>0 nPaBsO+n
yes 1<>0 Yes nPaBsOn
8 to 7
loop
exits

The output of the program is :


nPaBsOn

6. Re-Write the given program after correcting the bug: 2


REM display records of students from Data file
OPEN “Stdinfo.dat” FOR OUTPUT AS #1
PRINT “ROLL”, “NAME”, “ADDRESS”, “CLASS”, “SECTION”
DO WHILE NOT EOF
INPUT #1, RN, N$, AD$, CL, S$
PRINT RN, N$, AD$, CL, S$
NEXT
STOP #1
END
SOLVED BY: DEEPAK SHRESTHA
SOLVED TRITON SEE MODEL QUESTIONS | OPT.II Computer Science

Debugged Program
REM display records of students from Data file
OPEN "Stdinfo.dat" FOR INPUT AS #1
PRINT "ROLL", NAME", "ADDRESS", "CLASS" , "SECTION"
DO WHILE NOT EOF (1)
INPUT #1, RN. N$, AD$, CL, S$
PRINT RN, NS, ADS, CL, S$
WEND
CLOSE #1
END

7. Study the following program and answer the given questions: 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

a. Write the names of two built in functions used in the above program.
Ans: LEN( ) and RIGHT$( ) are the two built in functions used in the above program.
ge
lle
Co
&

b. List the real parameters of the above program.


SS
n
ito
Tr

W$ is the real parameters of the above program.

GROUP C (16 Marks)

8. Convert/Calculate as per the instruction: 4 × 1 =4

i) (315)10 → (?)2
Divide by the base 2 to get the digits from the remainders:
Division Quotient Remainder
by 2 (Digit)
(315)/2 157 1
(157)/2 78 1
(78)/2 39 0
(39)/2 19 1
(19)/2 9 1
(9)/2 4 1
(4)/2 2 0
(2)/2 1 0
(1)/2 0 1
= (100111011)2
(315)10 = (100111011)2

SOLVED BY: DEEPAK SHRESTHA


SOLVED TRITON SEE MODEL QUESTIONS | OPT.II Computer Science
ii) (A4B)16 → (?)8
Convert each hex digit to 4 binary digits
A = 1010
4 = 0100
B = 1011
Now,
convert each 3 binary digits to octal digits
A4B
101 = 5
001= 1
001 = 1
011 = 3
= 5113
(A4B)16 = (5113)8

iii) (1011)2 × (101)2 + (1001)2


1 0 1 1
× 1 0 1
1 0 1 1
0 0 0 0 ×
+1 0 1 1 × ×
1 1 0 1 1 1
+ 1 0 0 1
10 0 0 0 0 0

(1011)2 × (101)2 + (1001)2 = (1000000)2


ge
lle
Co
&
SS
n
ito
Tr

iv) (10111)2  (101)2


101) 1 0 1 1 1 (100
-1 0 1
0 0 0
1 1
- 0
1 1

Q = 100
R = 11

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.

DECLARE SUB AREA (L, B)


DECLARE FUNCTION ARE (R)
CLS
INPUT “ENTER LENGTH”; L
INPUT “ENTER BREADTH”; B
INPUT “ENTER RADIUS”; R
CALL AREA (L, B)
PRINT “AREA OF CIRCLE ”; ARE(R)
END

SOLVED BY: DEEPAK SHRESTHA


SOLVED TRITON SEE MODEL QUESTIONS | OPT.II Computer Science
SUB AREA (L, B)
A=L*B
PRINT “AREA OF RECTANGLE=”; A
END SUB

FUNCTION ARE (L, B)


ARE = 3.14 * R ^ 2
END FUNCTION

b. Write a program to create a file “info.dat” and Store the name, address and mobile number of 5
peoples.

OPEN "info.dat" FOR OUTPUT AS #1


FOR I = 1 TO 5
INPUT "Enter Name"; N$
INPUT "Enter Address"; A$
INPUT "Enter Mobile Number"; M#
WRITE #1, N$, A$, M#
NEXT I
CLOSE #1
END

10. Write a program in C language to input a number and test whether it is odd or even. 4

#include<stdio.h>
#include<conio.h>
ge
lle
Co

int main()
&
SS
n
ito
Tr

{
int n;
printf("Enter any number: ");
scanf("%d", &n);
if(n % 2= =0)
printf("%d is even number", n);
else
printf("%d is odd number", n);
return 0;
}
OR,
Write a program in "C" language to display the series with their sum. 1,2,3,4….., up to 10th terms.

#include <stdio.h>
int main( )
{
int i, sum=0;
for(i = 1; i <= 10; i++)
{
printf("%d ", i);
sum += i;
}
printf("\nSum: %d", sum);
return 0;
}

SOLVED BY: DEEPAK SHRESTHA
SOLVED TRITON SEE MODEL QUESTIONS | OPT.II Computer Science

COMPUTER - SEE Model Question (Set-II)


Time: 2 Hours F.M.: 50

Group A ' 10 marks'

1. Answer the following questions in one sentence. (6 × 1 = 6)’

a. Define WIFI.
Wi-Fi is a technology that enables electronic devices to connect to the internet or communicate
wirelessly within a local area network (LAN).

b. What is digital citizenship?


Digital citizenship refers to the responsible and ethical use of technology and the internet by
individuals.

c. Name any two e-commerce sites in Nepal.’


Any two e-commerce sites in Nepal are daraz and hamrobazar.

d. Define relationship in MS-Access.


A relationship refers to the association or connection between two tables based on a common field or fields.

e. What do you mean by modular programming?


Modular programming is a technique which divides program into many small logical, manageable and
functional modules or blocks

f. Write any two looping statements used in C language.


ge
lle
Co
&
SS
n
ito
Tr

Any two looping statements used in C language are for loop and while loop.

2. Give the appropriate technical terms of the following: (2 × 1 = 2)


a. Hacking done with permission from the client. Ethical Hacking

b. The process of identifying an individual usually based on username and password. Authentication

3. Write the full forms for the following: (2 × 1 = 2)


a. SMTP – Simple Mail Transfer Protocol

b. AC/DC - Alternating Current/Direct Current

Group B ' 24 Marks'

4. Answer the following questions. (9 × 2 = 18)

a. "Computer network reduces the operation cost." Justify the statement.


Computer network reduces the operation cost as it allows to share software and hardware in the network, so extra
hardware or software copies is not needed to install for each and every computer in the network.

b. What is computer security? Write two software security measures to protect it.
Computer security refers to protecting computer and its content from damage, theft or misuse and action
to prevent such incidents.
Any two software security measures to protect it are password and backup.

SOLVED BY: DEEPAK SHRESTHA


SOLVED TRITON SEE MODEL QUESTIONS | OPT.II Computer Science

c. What is e-governance? Write any two advantages of e-governance.


Ans: E-governance is a set of services provided by the government to public via electronic media
especially using Internet.
The advantages of e-governance are:
• Citizens can access government services and information conveniently from anywhere.
• Corruption will be reduced as there will be direct interaction with the system and public without
any intermediaries.

d. What is e-commerce? Write any two advantages of it.


E-commerce refers to buying and selling of goods, products, or services through Internet.
Any two advantages of it are:
• Faster buying/selling procedure, as well as easy to find products.
• Buying/selling anytime and anywhere.

e. What is IoT? Write the characteristics of IoT.


The Internet of Things (IoT) is a network of physical devices that can transfer data to one another
without human intervention.
The characteristics of IoT are:
• IoT devices can connect and communicate with each other and the internet.
• Tasks can be performed automatically without human intervention.

f. List any four data types of MS-Access. Also, mention its function.
Any four data types of MS-Access and its function are:
Date/Time Used for dates and time data
Currency Used for currency values.
Auto Used for unique sequential (incrementing by 1).
ge
lle
Co
&
SS
n
ito
Tr

Number
Yes/No Used for data that can be only one of two
possible values, such as Yes/No (Boolean values)

g. Define record and field in database.


A record is a row in a table which contains information about single items in a database. Record is complete set
of information.
A field is a column in a table which contains information about a certain type for all records. Field is a smallest
unit of information.

h. What is primary key? Write its importance.


Primary Key is a special field or group of fields in the table that uniquely identifies each record from
the database.
The importance of primary key are:
• To identify each record of a table uniquely.
• To reduce and control duplication of the record in a table.

i. What is query in MS-Access? List the different types of query in MS-Access.


Query is an object of database that is used to view, retrieve, change and analyse records from a table or
multiple linked tables based on specified condition.
There are two main types of Query used in Access.
Select Query and Action Query : Update Query, Delete Query and Append Query.

SOLVED BY: DEEPAK SHRESTHA


SOLVED TRITON SEE MODEL QUESTIONS | OPT.II Computer Science
5. Write the output of the given program showing the dry run table. (2)
DECLARE SUB SERIES ()
CLS
CALL SERIES
END
SUB SERIES ()
A=77777
C=5
WHILE C>=1
PRINT A;
A=A\10
C=C-1
WEND
END SUB

Dry Run
Variable Condition PRINT A; A=A\10 C=C-1
Check
A C>=5
77777 5>=1 Yes 77777 77777 \10=7777 5-1=4
7777 4>=1 Yes 7777 7777\10=777 4-1=3
777 3>=1 Yes 777 777\10=77 3-1=2
77 2>=1 Yes 77 77\10=7 2-1=1
7 1>=1 Yes 7 7\10=0 1-1=0
0 0>=1 No
Loop Exits
The output of the program is:
77777 7777 777 77 7
ge
lle
Co
&
SS
n
ito
Tr

6. Debug the following program. (2)


Rem to store name, address in the file ' Shop.dat"
CLS
OPEN " Shop.dat" FOR INPUT AS #1
DO
INPUT" Enter name"; name$
INPUT " Enter address"; address
WRITE name$, address$
INPUT " do you want to continue"; ans$
LOOP WHILE UCASE$(ans$) = "Y"
CLOSE#2
END

Debugged Program
Rem to store name, address in the file ' Shop.dat"
CLS
OPEN " Shop.dat" FOR OUTPUT AS #1
DO
INPUT" Enter name"; name$
INPUT " Enter address"; address
WRITE #1, name$, address$
INPUT " do you want to continue"; ans$
LOOP WHILE UCASE$(ans$) = "Y"
CLOSE #1
END
SOLVED BY: DEEPAK SHRESTHA
SOLVED TRITON SEE MODEL QUESTIONS | OPT.II Computer Science
7. Read the following program and answer the following questions. (2)
DECLARE SUB string (x$)
CLS
x$="KATHMANDU"
CALL string(x$)
END
SUB string(x$)
L=LEN(x$)
FOR A = L to 1 step -2
PRINT MID$(x$, A, 1);
NEXT A
END SUB
Questions:
a. What is the value of L in the above program?
The value of L in the above program is 9

b. List the numeric and string variable in the above program.


Numeric variable = L, A String variable = x$

Group C '16 Marks'

8. Calculate/Convert as per instructions: (4 × 1 = 4)


a. (101010) × (101011) – (100101)2
1 0 1 0 1 0
× 1 0 1 0 1 1
1 0 1 0 1 0
1 0 1 0 1 0 ×
ge
lle
Co
&
SS
n
ito

0 0 0 0 0 0 × ×
Tr

1 0 1 0 1 0 × × ×
0 0 0 0 0 0 × × × ×
+ 1 0 1 0 1 0 × × × × ×
1 1 1 0 0 0 0 1 1 1 0
- 1 0 0 1 0 1
1 1 0 1 1 1 0 1 0 0 1
(101010) × (101011) – (100101)2 = (11011101001)2

b. 1001011 ÷ 10101
10101) 1 0 0 1 0 1 1 (11
- 1 0 1 0 1
1 0 0 0 0 1
- 1 0 1 0 1
0 0 1 1 0 0

Q = 11
R = 1100

c. (DEF42)16 = ( ? )8
Convert each hex digit to 4 binary digits
D = 1101
E = 1110
F = 1111
4 = 0100
2 = 0010
SOLVED BY: DEEPAK SHRESTHA
SOLVED TRITON SEE MODEL QUESTIONS | OPT.II Computer Science
Convert each 3 binary digits to octal digits.
= 11 011 110 111 101 000 010
011 = 3
011 = 3
110 = 6
111 = 7
101 = 5
000 = 0
010 = 2
= 3367502
(DEF42)16 = ( 3367502 )8

d. (489)10 = ( ? )2
Divide by the base 2 to get the digits from the remainders:
Division Quotient Remainder
by 2 (Digit)
(489)/2 244 1
(244)/2 122 0
(122)/2 61 0
(61)/2 30 1
(30)/2 15 0
(15)/2 7 1
(7)/2 3 1
(3)/2 1 1
(1)/2 0 1
= (111101001)2
(489)10 = ( 111101001 )2
ge
lle
Co
&
SS
n
ito
Tr

9. Answer the following questions. (4 × 2 = 8)


a. Write a QBASIC program that ask length, breadth and height, and calculate the volume of cuboid and
total surface area. Create a USER-DEFINED FUNCTION to calculate the volume of the cuboid and
SUB-PROGRAM to calculate the total surface area.

DECLARE FUNCTION VOL(L,B,H)


DECLARE SUB TSA(L,B,H)
CLS
INPUT”Enter length”;L
INPUT”Enter breadth”;B
INPUT”Enter height”;H
PRINT”Volume of cuboid= “;VOL(L,B,H)
CALL TSA(L,B,H)
END

FUNCTION VOL(L,B,H)
VOL=L*B*H
END FUNCTION

SUB TSA(L,B,H)
T=2*(L*B+B*H+L*H)
PRINT”Total surface area of cuboid=”;T
END SUB

SOLVED BY: DEEPAK SHRESTHA


SOLVED TRITON SEE MODEL QUESTIONS | OPT.II Computer Science
b. A sequential data file "records.dat" contains S_No., Name, Address, Telephone NO. and Email Address.
WAP to count and display those records whose email address ends in "yahoo.com" domain. Your display
should be in a tabular format having the fields Name, Address and Email address only.

OPEN "records.dat" FOR INPUT AS #1


CLS
C=0
WHILE NOT EOF(1)
INPUT #1, SN, N$, A$, T, E$
IF LCASE$(RIGHT$(E$,9))="yahoo.com"
THEN PRINT N$,A$,E$
C=C+1
WEND
PRINT "TOTAL NO. OF HAVING YAHOO EMAIL ADDRESS ARE"; C
CLOSE #1
END

10. Write a program in C language that asks a number and check whether the number is positive,
negative or zero. (4)

#include<stdio.h>
#include<conio.h>
int main()
{
int n;
printf("Enter any number: ");
scanf("%d", &n);
if(n>0)
ge
lle
Co
&
SS
n
ito
Tr

printf("%d is positive number",n);


else if(n<0)
printf("%d is negative number",n);
else
printf("%d is zero number",n);
return 0;
}

OR,
Write a program in C language to display the series with their sum 7, 10, 13, 16, …. up to 10th term.

#include<stdio.h>
int main()
{
int n=7, i, s=0;
for(i=1;i<=10;i++)
{
printf("%d ",n);
s=s+n;
n=n+3;
}
printf("\nsum= %d",s);
return 0;
}


SOLVED BY: DEEPAK SHRESTHA
SOLVED TRITON SEE MODEL QUESTIONS | OPT.II Computer Science

COMPUTER - SEE Model Question (Set-III)


Time: 2 Hours F.M.: 50
Group A ' 10 marks'
1. Answer the following questions in one sentence. (6 × 1 = 6)
a. Which connector is used with coaxial cable?
BNC connector is used with coaxial cable.

b. Why data decryption is necessary?


Data decryption is necessary to convert encrypted (coded) data into readable form.

c. Which data types are used to store graphics and numeric characters in MS-Access?
OLE object is used for graphic and Number data type is used for numeric character

d. List any two objects of MS-Access.


Any two objects of MS-Access are Query and Form.

e. What is the function of MOD in Qbasic?


The function of MOD in Qbasic is to find remainder.

f. Write the name of unary operators used in C-language.


The name of unary operators used in C-language are: Increment (++) and decrement (- -)

2. Write appropriate technical term. (2x1=2)


a. Network connecting device that boosts the data signal. Repeater

b. A code of behavior for using internet. Computer Ethics


ge
lle
Co
&
SS
n
ito
Tr

3. Write the full form for the following: (2x1=2)


a. POP – Post Office Protocol

b. GCE - Google Compute Engine

Group B '24 marks'


4. Answer the following questions: (9x2=18)
a. "The internet is called network of networks." Justify in your words.
Ans: The Internet is called a "network of networks" because it connects millions of private, public,
academic, business, and government networks globally, enabling them to communicate and share
resources.

b. What is hacking? What is the purpose of hacking?


Ans: Hacking is the unauthorized access to or manipulation of computer systems or networks, typically
to steal, alter, or destroy data, or disrupt services.
The purpose of hacking can be to steal or alter data, disrupt services, spy on communications, or
sometimes, to test and improve security measures (ethical hacking).

c. Define antivirus software with four examples.


Ans: Antivirus software is a program designed to detect, prevent, and remove malware from computer
systems. Examples include Norton, McAfee, Avast, and Bitdefender.

d. What is E-commerce? Write any four Nepali e-commerce web sites.


Ans: E-commerce is the buying and selling of goods and services over the internet. Four Nepali e-
commerce websites are Daraz, SastoDeal, HamroBazar, and Muncha.

SOLVED BY: DEEPAK SHRESTHA


SOLVED TRITON SEE MODEL QUESTIONS | OPT.II Computer Science

e. What is AI? List any four areas of AI.


Ans: Artificial intelligence (AI) is an area of computer science that emphasizes the creation of
intelligent machines that work and reacts like humans.
Four areas of AI are natural language processing, robotics, Machine Learning, and computer vision.

f. What is DBMS? Give some examples of DBMS software.


Ans: DBMS is a computerized system that stores data, processes them and provides information in an
organized form. E.g. MS-Access, Oracle, MySQL, Fox Pro etc

g. What does data type used for? List out any four data types in MS-Access.
Data type is used for determining the type of data that can be stored in that field.
Any four data types in MS-Access are: text, memo, number and currency.

h. Differentiate between select query and action query.

Select Query Action Query


Select query is simply used to select An action query is a query that makes
and display the relevant data from the changes to or removes many records in just
database. one operation.
It does not make change to database. It makes change to database.

i. What is report? Write down its important.


Ans: Report is one of the MS-Access database objects used to present information in an effective and
organized format that is ready for printing.
Any two importance of the report are:
• Reports provide a formatted presentation of data that is easy to read and understand.
• Reports enable users to summarize, analyze, and visualize data in meaningful ways.
ge
lle
Co
&
SS
n
ito
Tr

5. Write the output of following program with necessary rough: (1x2=2)


DECLARE SUB SERIES ( )
CLS
CALL SERIES
END
A$="NEPAL"
B=1
FOR I =LEN (A$) to 1 STEP-2
IF B < > 3 THEN
PRINT MID$(A$, B, I)
ELSE
PRINT MID$(A$, 1, I)
END IF
B=B+1
NEXT I
END SUB

DRY RUN
A$ B I =LEN (A$) to 1 B< > 3 PRINT MID$(A$,B,I) MID$(A$, 1, I) B=B+1
STEP-2 yes
no
NEPAL 1 5 to 1 YES 1 < > 3 YES NEPAL 1+1=2
2 3 to 1 YES 2 < > 3 YES EPA 2+1=3
3 1 to 1 YES 3 < > 3 NO N
4 7 TO 5 NO
LOOP EXITS
SOLVED BY: DEEPAK SHRESTHA
SOLVED TRITON SEE MODEL QUESTIONS | OPT.II Computer Science
OUTPUT
NEPAL
EPA
N

6. Re-write the given problem after correcting bugs: (2x1=2)


REM to check whether the supplied no is even or odd
DECLARE SUB TEST(N)
CLS
INPUT "ENTER THE NUMBER;";N$
CALL TEST(N)
Y=2
R=Y MOD N
IF R=1 THEN
PRINT"EVEN"
OR
PRINT"ODD"
END
END SUB

Debugged Program

REM to check whether the supplied no is even or odd


DECLARE SUB TEST(N)
CLS
INPUT "ENTER THE NUMBER:";N
CALL TEST(N)
END
ge
lle
Co
&
SS
n
ito
Tr

SUB TEST(N)
Y=2
R=N MOD Y
IF R=0 THEN
PRINT"EVEN"
ELSE
PRINT"ODD"
END IF
END SUB

7. Study the following program and answer the given questions: (2x1=2)
OPEN"Detail.dat"FOR INPUT AS #1
OPEN"Temp.dat"FOR OUTPUT AS#2
INPUT "Enter name of the students";Sn$
FOR I = 1 TO 10
INPUT # 1, Nm$, CI, A
IF Sn$ < > Nm$ THEN
WRITE # 2, Nm$, CI, A
END IF
NEXT I
CLOSE #1, #2
KILL "Detail.dat"
NAME "Temp.dat"AS"Detail.dat"
END

SOLVED BY: DEEPAK SHRESTHA


SOLVED TRITON SEE MODEL QUESTIONS | OPT.II Computer Science
a. What is the main objective of the program given above?
The main objective of the program is to delete the record of a specific student, identified by their name
from the data file Detail.dat.

b. Do you get any problem in the above program if "KILL" statement is removed? Give reason.
Yes, there would be a problem if the KILL statement is removed. Because without the KILL statement,
both Detail.dat and Temp.dat will exist, and the renaming (NAME "Temp.dat" AS "Detail.dat") will
fail because a file cannot be renamed to an existing file's name, causing an error and preventing the
update.

Group C "16 mark"


8. Calculate as per the instruction: (4x1=4)
(i) (ABC)16 = (?)8

Convert each hex digit to 4 binary digits


ABC
=ABC
A = 1010
B = 1011
C = 1100
= 101 010 111 100
convert each 3 binary digits to octal digits
= 101 010 111 100
101 = 5
010 = 2
111 = 7
100 = 4
ge
lle
Co

(ABC)16 = (5274)8
&
SS
n
ito
Tr

(ii) (435)10 = (?)2

Divide by the base 2 to get the digits from the remainders:


Division Quotient Remainder
by 2 (Digit)
(435)/2 217 1
(217)/2 108 1
(108)/2 54 0
(54)/2 27 0
(27)/2 13 1
(13)/2 6 1
(6)/2 3 0
(3)/2 1 1
(1)/2 0 1
= (110110011)2
(435)10 = (110110011)2

SOLVED BY: DEEPAK SHRESTHA


SOLVED TRITON SEE MODEL QUESTIONS | OPT.II Computer Science
(iii) (101)2 × (101)2 = (?)2

1 0 1

1 0 1

1 0 1

0 0 0 ×

1 0 1 × ×

1 1 0 0 1

(101)2 × (101)2 = (11001)2

(iv) (101101)2 ÷ (101)2

101) 1 0 1 1 0 1 (1001

- 1 0 1

0 0 0 1 0 1

- 1 0 1

0 0 0

Q = 1001
ge
lle
Co
&
SS
n
ito
Tr

R=0

9. Answer the following questions: (4x2=8)


a. Write a program in QBASIC that asks radius of a circle to calculate its area and circumference.
Create a user-defined function to calculate area and sub-program to calculate circumference.

DECLARE FUNCTION AREA (R)


DECLARE SUB CIR (R)
CLS
INPUT "ENTER RADIUS"; R
PRINT " AREA OF A CIRCLE="; AREA (R)
CALL CIR (R)
END

FUNCTION AREA (R)


AREA = 3.14 * R ^ 2
END FUNCTION

SUB CIR (R)


C = 2 * 3.14 * R
PRINT " CIRCUMFERENCE OF CIRCLE =" ; C
END SUB

SOLVED BY: DEEPAK SHRESTHA


SOLVED TRITON SEE MODEL QUESTIONS | OPT.II Computer Science
b. A sequential data file called "Record.dat" has stored data under the field headings: Roll No.,
Name, Gender, English, Nepali, Maths and Computer. Write a program to display all the
information of those students whose marks in English is more than 40.

OPEN " Record.dat " FOR INPUT AS #1


CLS
WHILE NOT EOF (1)
INPUT #1, R, N$, G$, E, NE, M, C
IF E > 40 THEN
PRINT “Your Roll No. is”, R
PRINT “Your Name is”, N$
PRINT “Your Gender is”, G$
PRINT “Your Marks in English is”, E
PRINT “Your Marks in Nepali is”, NE
PRINT “Your Marks in Math is”, M
PRINT “Your Marks in Computer is”, C
END IF
WEND
CLOSE #1
END

10. Write a program in C language to input a number then check whether the number is fully divisible
by 5 or not.

#include<stdio.h>
#include<conio.h>
int main()
ge
lle
Co

{
&
SS
n
ito
Tr

int n;
printf("Enter any number: ");
scanf("%d", &n);
if(n%5= =0)
printf("%d is divisible by 5",n);
else
printf("%d is not divisible by 5",n);
return 0;
}

OR,
Write a program in "C" language to display the series 2, 4, 6, 8 up to the 10th term.

#include<stdio.h>
int main()
{
int n=2, i;
for(i=1;i<=10;i++)
{
printf("%d ",n);
n=n+2;
}
return 0;
}

SOLVED BY: DEEPAK SHRESTHA
SOLVED TRITON SEE MODEL QUESTIONS | OPT.II Computer Science

COMPUTER - SEE Model Question (Set-IV)


Time: 2 Hours F.M.: 50
Group A ' 10 marks'
1. Answer the following questions in one sentence. (6 × 1 = 6)
a. Define the internet.
The Internet is a global network of interconnected computers and servers that allows the exchange of
information and communication between devices.

b. What is the business done through the internet?


The business done through the internet is e-commerce.

c. What is IoT?
The Internet of Things (IoT) is a network of physical devices to exchange information over a network
without human intervention.

d. Define foreign key.


A foreign key is a field (or a set of fields) in a database table that establishes a link between two
tables.

e. Which view is used to modify a table in MS-Access?


Design view is used to modify a table in MS-Access.
ge
lle
Co
&
SS
n
ito
Tr

f. Write any two features of C Programming.


Any two features of C Programming
Portability: C code can be compiled and executed on different systems with minimal modifications.
C is a case-sensitive programming language. It understands the capital alphabets and small alphabets
as different values.

2. Write the appropriate technical term for the following. (2x1=2)

a. A device that is used to translate analog signals into digital and vice versa. MODEM
b. The smallest unit to represent information on a quantum computer. qubit (quantum bit)

3. Write the full form of the following. (2x1=2)


a. VSAT- Very Small Aperture Terminal
b. UHF- Ultra High Frequency

4. Answer the following questions: (9x2=18)


a. What is a computer network? List any two importance of it.
Computer network is a group of two or more computers and devices connected to each other through
wired or wireless media to exchange data and information and share hardware, software and other
resources.
Any two importance of computer network:
• A network connected computers can share hardware devices such as scanner, printer, hard
disk, etc.
• Networking also provides the facility of data and software backup system.
SOLVED BY: DEEPAK SHRESTHA
SOLVED TRITON SEE MODEL QUESTIONS | OPT.II Computer Science
b. What is meant by computer ethics? Write down any two ethics 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 ethics of it are:
• Do not use a computer to harm other people.
• Do not use a computer to publish fake information.

c. What is computer security? Write any two hardware security measures.


Computer security means protecting computer and its content from damage, theft or misuse and
action to prevent such incidents.
Any two hardware security measures are: insurance and power protection device.

d. Write any two differences between e-commerce and traditional commerce.


Traditional Commerce E-commerce
Traditional commerce is the buying Ecommerce refers to the buying and
and selling of goods and services selling of goods or services using the
through physical stores and in-person internet.
transactions, without using digital
technology.
Delivery of goods is instant. Delivery of goods takes time.

e. Define online payment and list any two applications used for online payment.
Online payment refers to the payment for buying goods or services through the Internet using
different online payment gateway.Any two applications used for online payment are esewa and khalti.
ge
lle
Co
&
SS
n
ito
Tr

f. Define DBMS with any two examples.


Database management system (DBMS) is a computerized system that stores data, processes them and
provides information in an organized form.
Example of DBMS are: MS-Access, Oracle, MySQL, Fox Pro.

g. What is a report in MS-Access? Mention the importance of it in the database.


Report is an object of Ms-Access which is used to present information in an effective and organized
format that is ready for printing.
The importance of report are:
Reports enable users to summarize, analyze, and visualize data in meaningful ways.
Reports provide a formatted presentation of data that is easy to read and understand.

h. Define the primary key and write its features.


Primary Key is a special field or group of fields in the table that uniquely identifies each record from
the database.
Its features are:
• It sets the relationship between tables.
• It reduces and controls duplication of record in a table

i. What is meant by data redundancy? How can we minimize it?


Data redundancy is the duplication of data within a database.
Data redundancy can be controlled by normalizing the database, eliminating duplicate data and
storing it in separate tables.
SOLVED BY: DEEPAK SHRESTHA
SOLVED TRITON SEE MODEL QUESTIONS | OPT.II Computer Science
5. Write down the output of the given program and show them in the dry run table.2
DECLARE SUB CITY (K$)
CLS
CALL CITY ("KATHMANDU")
END
SUB CITY (K$)
FOR K=1 TO LEN (K$)
C$=MID$ (K$, K, 1)
IF K MOD 2 = 1 THEN
C$=UCASE$ (C$)
ELSE
C$=LCASE$(C$)
END IF
X$=X$+C$
NEXT K
PRINT X$
END SUB

Dry Run
K$ K=1 TO C$=MI IS K MOD 2 YES NO X$=X$+C PRINT X$
LEN D$ = 1? C$=UCASE C$=LCA $
(K$) (K$, K, $ (C$) SE$
1) (C$)
KATHMAND 1 TO 9 K 1 MOD 2=1 k K
U YES NO
ge
lle
Co
&
SS
n
ito

2 TO 9 A 2 MOD 2=0 A kA
Tr

YES YES
3 TO 9 T t kAt
YES
4 TO 9 H H kAtH
YES
5 TO 9 M m kAtHm
YES
6 TO 9 A A kAtHmA
YES
7 TO 9 N n kAtHmAn
YES
8 TO 9 D D kAtHmAn
YES D
9 TO 9 U u kAtHmAn
YES Du
10 TO 9 kAtHmAn
NO Du
LOOP
EXITS
The output of the program is
kAtHmAnDu

SOLVED BY: DEEPAK SHRESTHA


SOLVED TRITON SEE MODEL QUESTIONS | OPT.II Computer Science
6. Rewrite the given program after correcting the bugs. (2)
DECLARE FUNCTION vowel (S$)
w$=we love our country
v=vowel (w$)
PRINT "The total no. of vowel..";v
END
FUNCTION vowel$(S$)
c=0
FOR K=1 TO length (S$)
B$=MID$(S$, K, 1)
B$=LCASE$(B$)
SELECT CASE B$
CASE "a", "e", "i", "o", "u"
c=c+1
END SELECT
NEXT K
C=vowel
END FUNCTION

Debugged Program

DECLARE FUNCTION vowel (S$)


w$=we love our country”
v=vowel (w$)
PRINT "The total no. of vowel..";v
ge
lle
Co
&
SS
n

END
ito
Tr

FUNCTION vowel(S$)
c=0
FOR K=1 TO LEN (S$)
B$=MID$(S$, K, 1)
B$=LCASE$(B$)
SELECT CASE B$
CASE "a", "e", "i", "o", "u"
c=c+1
END SELECT
NEXT K
vowel = c
END FUNCTION

7. Study the following program and answer the given questions. (2)
DECLARE FUNCTION TEST (A)
X=10
Z=TEST (X)
PRINT Z
END

FUNCTION TEST (B)


FOR I=1 TO B
S=S+I*I
SOLVED BY: DEEPAK SHRESTHA
SOLVED TRITON SEE MODEL QUESTIONS | OPT.II Computer Science
NEXT I
TEST=S
END FUNCTION
a) How many times the program loops?
Program loops 10 times.
b) Write the name of the function procedure.
The name of the function procedure is TEST( ).

8. Calculate as per the instruction: (4x1=4)


(i) (110111)2 = (?)8

Convert every 3 binary digits to octal digit


110111
110 = 6
111 = 7
=67
(110111)2 = (67)8

(ii) (25AF)16 = (?)10


(25AF)₁₆ =
(2 × 16³) + (5 × 16²) + (10 × 16¹) + (15 × 16⁰)
= (2 × 4096) + (5 × 256) + (10 × 16) + (15 × 1)

= (2 × 4096) + (5 × 256) + (10 × 16) + (15 × 1)


=8192 + 1280 + 160 + 15
ge
lle

= (9647)₁₀
Co
&
SS
n
ito
Tr

(25AF)16 = (9647)10

(iii) 110110+100011

1 1 0 1 1 0
+ 1 0 0 0 1 1
1 0 1 1 0 0 1

110110+100011 = 1011001

(iv) (1110001) ÷ (101)


101) 1 1 1 0 0 0 1 (10110
-1 0 1
1 0 0 0
- 1 0 1
0 0 1 1 0
- 1 0 1
0 0 1 1
- 0
1 1

Q = 10110
R = 11

SOLVED BY: DEEPAK SHRESTHA


SOLVED TRITON SEE MODEL QUESTIONS | OPT.II Computer Science

9. (a) Write a program in QBASIC that asks length, breadth and height of a room and calculate its area and
volume. Create a User Defined Function to calculate Area and Sub Program to calculate the volume.

DECLARE FUNCTION AREA (L, B)


DECLARE SUB VOLUME (L, B, H)
CLS
INPUT “ENTER LENGTH”; L
INPUT “ENTER BREADTH”; B
INPUT “ENTER HEIGHT”; H
PRINT “AREA OF ROOM ”; AREA(L, B)
CALL VOLUME(L, B, H)
END

FUNCTION AREA (L, B)


AREA = L * B
END FUNCTION

SUB VOLUME (L, B, H)


V=L*B*H
PRINT “VOLUME OF ROOM =”; V
END SUB

(b) Employee's name, address, gender and salary are stored in the "EMP.DAT" sequential data
file. Write a QBASIC program that displays all information about personnel whose salaries exceed
60,000.
ge
lle
Co
&
SS
n
ito
Tr

OPEN "EMP.DAT" FOR INPUT AS #1


CLS
WHILE NOT EOF (1)
INPUT #1, N$, A$, G$, S
IF S > 60000 THEN PRINT N$, A$, G$, S
WEND
CLOSE #1
END

10. Write a program in 'C' language to find simple interest where user need input Principle, Rate and Time.

#include<stdio.h>
#include<conio.h>
int main()
{
float p, t, r, i;
printf("Enter principal: ");
scanf("%f", &p);
printf("Enter time: ");
scanf("%f", &t);
printf("Enter rate: ");
scanf("%f", &r);
i = (p*t*r)/100;
printf("Simple Interest = %.2f", i);
return 0;

SOLVED BY: DEEPAK SHRESTHA


SOLVED TRITON SEE MODEL QUESTIONS | OPT.II Computer Science
}
OR,

Write a program in 'C' language to display the series with their sum. 1,2,3,4, … up to 10th term.

#include<stdio.h>
int main()
{
int i, s=0;
for(i=1;i<=10;i++)
{
printf("%d ",i);
s=s+i;
}
printf("\nsum= %d",s);
return 0;
}


ge
lle
Co
&
SS
n
ito
Tr

SOLVED BY: DEEPAK SHRESTHA


SOLVED TRITON SEE MODEL QUESTIONS | OPT.II Computer Science

COMPUTER - SEE Model Question (Set-V)


Time: 2 Hours F.M.: 50
Group A ' 10 marks'
1. Answer the following questions in one sentence. (6 × 1 = 6)
a. What does bandwidth mean?
Bandwidth is the maximum amount of data that can be transmitted over a network or communication
channel in a given amount of time.

b. What is web browser?


A web browser is a software application that allows to access and view websites on the Internet.

c. What is the maximum length of a field name in MS-Access?


The maximum length of a field name in MS-Access is 64 characters.

d. Which is the logical data type of MS-Access?


The logical data type of MS-Access is Yes/No.

e. Write any one advantage of Modular Programming.


Any one advantage of Modular Programming is coding the program and testing is very easy.

f. Write any two features of C-language.


Any two features of C-language are:
Portability: C code can be compiled and executed on different systems with minimal modifications.
C is a case-sensitive programming language. It understands the capital alphabets and small alphabets
ge
lle
Co
&
SS
n
ito
Tr

as different values.

2. Write the appropriate technical term for the following. (2x1=2)


a. A Device used to connect a PC with a telephone line. MODEM
b. Unethical work done using a computer or the internet. Cyber Crime

3. Write the full form of the following. (2x1=2)


a. GPS – Global Positioning System
b. NIC – Network Interface Card

4. Answer the following questions: (9x2=18)


a. Which topology is mostly used in labs? Also, write its advantages and disadvantages.
Star topology is mostly used in labs.
Advantages of Star Topology
• Failure in one device does not affect the rest of the network due to independent connections.
• Adding or removing devices is simple and doesn’t affect the rest of the network.
Disadvantages of Star Topology
• If the central hub or switch fails, the entire network will stop functioning.
• It requires more cabling and a central hub, making it more expensive compared to bus or ring
topology.

b. What do you understand about digital citizens? Write its importance.


A digital citizen is an individual who responsibly uses the internet and digital technology for social,
educational, and personal activities while respecting privacy, security, and ethical standards.
SOLVED BY: DEEPAK SHRESTHA
SOLVED TRITON SEE MODEL QUESTIONS | OPT.II Computer Science

c. How does password policy protect computer software and data? Explain in brief.
A password policy keeps computer software and data safe by ensuring users to create strong and
unique passwords. It helps stop unauthorized access, reduces security risks, and keeps the system
working properly.

d. What is m-commerce? Write any two important services of it.


M-commerce refers to the buying and selling of goods and services through mobile devices like
smartphones and tablets.
Any two important services of it are:
❖ Mobile Shopping: M-commerce enables users to browse, select, and purchase products or services
directly from their mobile devices like daraz, hamrobazar, amazon etc.
❖ Mobile Payments: This service involves making payments using mobile device like e-sewa, khalti

e. Define e-banking and write one advantage and one disadvantage of e-banking.
E-banking is a digital banking system that allows customers to perform financial transactions and
manage their accounts online via the internet or mobile apps.
Any one advantage of e-banking is:
It saves the time of customers as they can easily access their account with the help of their device.
Any one disadvantage of e-banking is:
E-banking relies on internet connectivity and servers, so system failures or slow networks can disrupt
services.

f. Differentiate between data and information.


Data Information
ge
lle
Co
&
SS
n
ito
Tr

Raw form of any facts, figures or entities are The processed form of data is known as information.
known as data.
For example, Aaradhya, 1000, account, For example, Aaradhya has 1000 balance in her bank
balance etc. are raw data individually does not account. Here Aaradhya, 1000, account, balance all have
give any meaning. their significant meaning.

g. What is field properties? Name any four of them.


Field properties are settings or attributes that allow users to control various aspects of data entry,
validation, formatting, and behavior within the database.
Any four field properties are: field size, caption, validation rule and validation text.

h. What are validation text and validation rules?


Validation Rule is a field property which is used to limit the values that can be entered into a field.
Validation Text is a field property which displays an error message that appears if the data entered is
invalid according to the specified validation rule.

i. Write any two major differences between forms and reports.


Form Report
Form is primarily used for entering Report is used for presenting the data.
data
Form is designed to be used on Report are designed to be printed.
screen.

SOLVED BY: DEEPAK SHRESTHA


SOLVED TRITON SEE MODEL QUESTIONS | OPT.II Computer Science
5. Write down the output of the given program and show them in the dry run table.2
DECLARE SUB SENDUP (S$)
E$='NPABSON'
CALL SENDUP(E$)
END
SUB SENDUP(S$)
FOR i=1 to LEN(S$) STEP1
IF I MOD2< >0 THEN
EE$=EE$+LCASE$(MID$(S$,I,1)
ELSE
EE$=EE$+UCASE$(MID$(S$,I,1))
END IF
PRINT EE$
END SUB
Dry Run
E$ S$ i=1 to i MOD 2 <>0 Yes No
LEN(S$) EE$=EE$+ EE$=EE$+
LCASE$(MID UCASE$(MIDS(S$,I,1))
S(S$,I,1))
NPABSON NPABSON 1 to 7 1 MOD 2 <>0 n
yes 1<>0 Yes

2 to 7 2 MOD 2 <>0 n+P=nP


yes 0<>0 No
3 to 7 3 MOD 2 <>0 nP+a
yes 1<>0 Yes nPa
ge
lle
Co
&
SS
n
ito
Tr

4 to 7 4 MOD 2 <>0 nPa+B


yes 0<>0 No nPaB
5 to 7 5 MOD 2 <>0 nPaB+s
yes 1<>0 Yes nPaBs
6 to 7 6 MOD 2 <>0 nPaBs+O
yes 0<>0 No nPaBsO
7 to 7 7 MOD 2 <>0 nPaBsO+n
yes 1<>0 Yes nPaBsOn
8 to 7
loop
exits
The output of the program is :
nPaBsOn

6. Rewrite the given program after correcting the bugs. (2)


REM to store Name, post and salary
OPEN EMP.DOC FOR OUT AS#1
INPUT"Enter name";N
INPUT"Enter post";P$
INPUT"Enter salary";S
INPUT#2,N$,P$,S
CLOSE#1
STOP
SOLVED BY: DEEPAK SHRESTHA
SOLVED TRITON SEE MODEL QUESTIONS | OPT.II Computer Science
Debugged Program
REM to store Name, post and salary
OPEN “EMP.DOC” FOR OUTPUT AS#1
INPUT"Enter name";N$
INPUT"Enter post";P$
INPUT"Enter salary";S
WRITE#2,N$,P$,S
CLOSE#1
END

7. Study the following program and answer the given questions. (2)
DECLARE FUNCTION prod (A,B)
CLS
INPUT"Enter first number";A
INPUT "Enter second number";B
PRINT"The product of the two number=";prod (A,B)
END
FUNCTION prod (A,B)
P=A*B
prod=P
END FUNCTION
Questions:
a. List all the numerical variables used in the program above.
The numerical variables used in the program above are A, B and P.
ge
lle
Co
&
SS
n
ito
Tr

b. List the local variables used in the program above.


The local variable used in the program above is P.
8. Calculate as per the instruction: (4x1=4)
(i) (315)10 = (?)2

Divide by the base 2 to get the digits from the remainders:


Division Quotient Remainder
by 2 (Digit)
(315)/2 157 1
(157)/2 78 1
(78)/2 39 0
(39)/2 19 1
(19)/2 9 1
(9)/2 4 1
(4)/2 2 0
(2)/2 1 0
(1)/2 0 1
= (100111011)2
(315)10 = (100111011)2

SOLVED BY: DEEPAK SHRESTHA


SOLVED TRITON SEE MODEL QUESTIONS | OPT.II Computer Science
(ii) (A4B)16 = (?)8
Convert each hex digit to 4 binary digits
A4B
=A4B
A= 1010
4 = 0100
B = 1011
= 101 001 001 011

Convert each 3 binary digits to octal digits


101 = 5
001 = 1
001 = 1
011 = 3

(A4B)16 = (5113)8

(iii) (1011)2×(101)2+(1001)2

1 0 1 1
1 0 1
1 0 1 1
0 0 0 0 ×
1 0 1 1 × ×
1 1 0 1 1 1
ge
lle
Co
&
SS
n
ito
Tr

+ 1 0 0 1
1 0 0 0 0 0 0

(1011)2×(101)2+(1001)2 = (1000000)2

(iv) (10111)2  (101)2

101) 1 0 1 1 1 (100
- 1 0 1
0 0 0
1 1
- 0
1 1

Q = 100
R = 11

SOLVED BY: DEEPAK SHRESTHA


SOLVED TRITON SEE MODEL QUESTIONS | OPT.II Computer Science
9. (a) WAP to calculate the area of the rectangle using SUB…END SUB and area of circle using
FUNCTION…END Function.

DECLARE SUB AREA (L, B)


DECLARE FUNCTION ARE (R)
CLS
INPUT “ENTER LENGTH”; L
INPUT “ENTER BREADTH”; B
INPUT “ENTER RADIUS”; R
CALL AREA (L, B)
PRINT “AREA OF CIRCLE ”; ARE(R)
END

SUB AREA (L, B)


A=L*B
PRINT “AREA OF RECTANGLE=”; A
END SUB

FUNCTION ARE (L, B)


ARE = 3.14 * R ^ 2
END FUNCTION

(b) Write a program to create a file "info.dat" and Store the name, address and mobile number of
5 people.

OPEN "info.dat" FOR OUTPUT AS #1


ge
lle
Co
&
SS
n
ito
Tr

FOR I = 1 TO 5
INPUT "Enter Name"; N$
INPUT "Enter Address"; A$
INPUT "Enter Mobile Number"; M#
WRITE #1, N$, A$, M#
NEXT I
CLOSE #1
END

10. Write a program in 'C' language to display the first 10 odd numbers.

#include <stdio.h>
int main( )
{
int i, a=1;
for(i = 1; i <= 10; i++)
{
printf("%d ", a);
a=a+2;
}
return 0;
}

SOLVED BY: DEEPAK SHRESTHA


SOLVED TRITON SEE MODEL QUESTIONS | OPT.II Computer Science
OR,

Write a program in 'C' language to input two numbers and find the greatest among two numbers.
#include<stdio.h>
#include<conio.h>
int main()
{
int a,b;
printf("Enter any two numbers:\n ");
scanf("%d %d", &a, &b);
if(a>b)
printf("The greater number is %d", a);
else
printf("The greater number is %d", b);
return 0;
}

 Best of Luck 
ge
lle
Co
&
SS
n
ito
Tr

SOLVED BY: DEEPAK SHRESTHA


Symbol No: ……………………… 2081-03-27 7:00am 2081-03-27 7:00am
PABSON Kathmandu
FIRST TERMINAL EXAMINATION-2081 2. Write appropriate technical term for the following: (21=2)
a) Cabling structure of LAN.
Subject: Opt. II Computer Science Full Marks: 50 Topology
Class: 10 Time: 2 hrs.
Candidates are required to answer the questions in their own way words as far as b) Transferring illegal items through the internet that is
practicable. Figures in the margin indicate the full marks. banned in some locations.
Cyber Laundering
Attempt all questions.
3. Write the full form of the following: (21=2)
Group ‘A' a) G2G - Government-to-Government
b) HTTP - Hypertext Transfer Protocol
1. Answer the following questions in one sentence: (61=6)
Group ‘B'
a) What is downloading?
Download is the process of transferring files or data from a 4. Answer the following questions: (92=18)
remote server or another device to user’s computer or device. a) Write about bus topology with suitable diagram.
Bus topology is a network configuration where all devices are
b) What is intranet? connected to a single central cable known as a "bus". If the main
An intranet is a private network for an organization's members to cable breaks, the whole network stops working. It is used in small
share information, resources, and communicate internally. networks where not many devices are connected.

c) What is Wi-Fi?
Wi-Fi is a wireless technology that provides high-speed internet
and network access using radio waves.

d) Write any two commandments of cyber ethics.


❖ Do not use a computer to publish fake information.
❖ Do not destroy or delete the records of other people.

e) What is an actual parameter?


Actual parameter is argument which is used to pass real value or
data to the procedure.

f) What are the digits of hexadecimal number system?


The digits of the hexadecimal number system are:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.
Here, 0-9 represent values 0 to 9, and A-F represent values 10 to
15.
Symbol No: ……………………… 2081-03-27 7:00am 2081-03-27 7:00am
e) Write any two opportunities and threats in social media.
b) Classify computer network on the basis of geographical Opportunities of Social Media
location and explain it. Connectivity: Enables people to connect and communicate
On the basis of geographical location, computer is classified globally.
into: Marketing and Branding: Provides a platform for businesses to
LAN (Local Area Network) promote products and reach a broader audience.
MAN (Metropolitan Area Network) Threats of Social Media
WAN (Wide Area Network) Cyberbullying: Risk of harassment or bullying online.
A LAN (Local Area Network) is a network that connects Privacy Issues: Potential misuse of personal data and
computers and devices within a small area, like a home, information.
office, or school.
A MAN (Metropolitan Area Network) is a network that covers f) What do you mean by ICT?
a large area within a city allowing for data sharing and ICT refers to the use of computers, the internet, and other
communication. digital tools to manage, communicate, and share information.
WAN (Wide Area Network) is a network that covers a large
geographic area, such as different cities, countries, or even g) What is the main aim of formulating cyber law of Nepal?
globally, connecting multiple LANs and MANs. ❖ To legalize the transaction through electronic media to
control various types of electronic frauds
❖ To punish a person who does criminal activities through
c) Differentiate between bounded and unbounded media with electronic means especially on computers.
examples.
Guided Media Unguided Media h) What do you understand by modular programming? State
The media which uses cable Unguided communication is any two advantages of it.
or wire to transfer data and a communication channel in Modular programming is a technique which divides program
information among computers which data and information into many small logical, manageable and functional modules
are called guided are transferred through the or blocks.
communication media. air. Any two advantages are:
Examples of guided media are Examples of unguided media Coding the program and testing is very easy.
Twisted Pair Cable, Co-Axial are Radio Wave, Micro Wave Different programmers can write different modules separately.
Cable and Fiber Optic Cable and Satellite Communication
i) What is local and global variable in QBASIC?
A variable which is defined in a module and is not accessible
d) Write any four services of internet. to any other module is called local variable.
Any four services of internet are: Variables which are declared outside the procedure and whose
❖ E-Mail values can be accessed from any procedure or module are
❖ Chat called global variables.
❖ FTP
❖ E-Commerce
Symbol No: ……………………… 2081-03-27 7:00am 2081-03-27 7:00am
5. Write down the output of the given program. The output of the program is:
\Show with dry run in table. (2) PROGRAM
DECLARE SUB PATTERN(S$) OGRAM
CLS RAM
B$=”PROGRAM” M
CALL PATTERN(B$)
END 6. Re-write the given program after correcting the bugs: (2)
SUB PATTERN(S$) CREATE FUNCTION CUBE(A)
H=LEN(S$) REM to print cube of a number
I=10 CLS
FOR J=1 TO H STEP 2 Get "Enter a number"; A
PRINT TAB(I); MID$(S$,J,H) Call CUBE(A)
H=H-2 END
I=I+1 FUNCTION CUBE(A)
NEXT J ANS=A^3
END SUB ANS=CUBE
END FUNCTION
Dry Run Table
B$ = S$ H= I J=1 PRINT H=H-2 I=I+1 Debugged Program
LEN to 7 TAB(I); DECLARE FUNCTION CUBE(A)
(S$) step 2 MID$(S$,J,H) REM to print cube of a number
PROGRAM 7 10 1 to 7 MID$(S$,1,7) 7-2=5 10+1=11 CLS
step 2 PROGRAM INPUT "Enter a number"; A
Yes PRINT CUBE(A)
5 11 3 to 7 MID$(S$,3,5) 5-2=3 11+1=12 END
step 2 OGRAM
Yes FUNCTION CUBE(A)
3 12 5 to 7 MID$(S$,5,3) 3-2=1 12+1=13 ANS=A^3
step 2 RAM CUBE=ANS
Yes END FUNCTION
1 13 7 to 7 MID$(S$,7,1) 1-(2)=-1 13+1=14
step 2 M
Yes
-1 14 9 to 7
step 2
No
[Loop
Exits]
Symbol No: ……………………… 2081-03-27 7:00am 2081-03-27 7:00am
7. Study the following program and answer the given questions: ii) ( 11011 X 11 )  (110)
(21=2) 1 1 0 1 1
DECLARE SUB FACTORS(N) × 1 1
N=10 1 1 0 1 1
CALL FACTORS(N) 1 1 0 1 1 ×
END 1 0 1 0 0 0 1

SUB FACTORS(N) 110) 1 0 1 0 0 0 1 (1101


FOR J=1 TO N 1 1 0
R=N MOD J 1 0 0 0
IF R=0 THEN PRINT J; 1 1 0
NEXT J
1 0 0 1
END SUB
1 1 0
0 1 1
Questions:
Q=1101
a) Write down the use of MOD in the program.
R=011
The MOD operator is used to calculate the remainder.
iii) ( 235 )10 into octal
b) How many time the loop executes in the above program?
The loop executes 10 times in the above program.
Divide by the base 8 to get the digits from the remainders:
Group ‘C' Division Quotient Remainder
by 8 (Digit)
(235)/8 29 3
Long question Answers: (44=16)
8. Convert / calculate as per the instruction: (29)/8 3 5
i) (111011 + 1101 ) - ( 11011 ) (3)/8 0 3
1 1 1 0 1 1 = (353)8
+ 1 1 0 1 ( 235 )10 = (353)8
1 0 0 1 0 0 0
iv) ( 9A5 )16 into binary
- 1 1 0 1 1
1 0 1 1 0 1
Convert each hex digit to 4 binary digits
9A5
(111011 + 1101 ) - ( 11011 ) = (101101)
9 = 1001
A = 1010
5 = 0101
= 1001 1010 0101
( 9A5 )16 = (1001 1010 0101)2
Symbol No: ……………………… 2081-03-27 7:00am 2081-03-27 7:00am
9. a) Write a program in QBASIC that asks two numbers to 10. Write a program to find greatest number out of three
find remainder using SUB….END SUB program and numbers using FUNCTION…END FUNCTION.
product of two numbers using FUNCTION…END DECLARE FUNCTION GREAT (A, B, C)
FUNCTION. INPUT “ENTER ANY THREE NUMBERS”; A, B, C
DECLARE SUB DIV(A,B) PRINT “THE GREATEST NUMBER IS”; GREAT (A, B, C)
DECLARE FUNCTION PRO(A,B) END
CLS
INPUT “Enter First Number”; A FUNCTION GREAT (A, B, C)
INPUT “Enter Second Number”; B IF A > B AND A > C THEN
CALL DIV(A,B) G=A
PRINT “The product of two numbers=”; PRO(A, B) ELSEIF B > A AND B > C THEN
END G=B
ELSE
SUB DIV(A,B) G=C
R = A MOD B END IF
PRINT “Remainder of two numbers=”; R GREAT = G
END SUB END FUNCTION

FUNCTION PRO(A,B) or
PRO = A * B Write a program to count the occurrence of letter 'e' in the
END FUNCTION supplied string using SUB…END SUB.
DECLARE SUB COUNT (S$)
b) WAP to find sum of digits of a number using SUB….END CLS
SUB. [Hint: 456: 4+5+6=15] INPUT "ENTER ANY STRING"; S$
DECLARE SUB SUM (N) CALL COUNT(S$)
CLS END
INPUT "ENTER ANY NUMBER"; N
CALL SUM (N) SUB COUNT (S$)
END EC = 0
FOR I = 1 TO LEN(S$)
SUB SUM (N) B$ = MID$(S$, I, 1)
S=0 C$ = UCASE$(B$)
WHILE N < > 0 IF C$ = "E" THEN EC = EC + 1
R = N MOD 10 NEXT I
S=S+R PRINT "TOTAL NO. OF LETTER E = "; EC
N = N \ 10 END SUB
WEND
PRINT "SUM OF DIGITS="; S
END SUB 
Symbol No: ……………………… 2081-03-27 10:00am 2081-03-27 10:00am
PABSON Kathmandu 2. Write appropriate technical term for the following: (21=2)
FIRST TERMINAL EXAMINATION-2081 a) A group of computers that functions both as a client and server.
Peer to Peer Network
Subject: Opt. II Computer Science Full Marks: 50
Class: 10 Time: 2 hrs. b) The unauthorized duplication and use of computer software.
Candidates are required to answer the questions in their own way words as far as Software Piracy
practicable. Figures in the margin indicate the full marks.
3. Write the full form of the following: (21=2)
Attempt all questions. a) URL – Uniform Resource Locator
b) ICT - Information and Communication Technology
Group ‘A'
Group ‘B'
1. Answer the following questions in one sentence: (61=6)
4. Answer the following questions: (92=18)
a) What is an uploading?
Upload is the process of transferring files or data from user’s a) Write any two advantages and disadvantages of computer
computer or device to a remote server or another device. network.
Any two advantages of computer network are:
b) Write few popular ISP's of Nepal. ❖ Users can share resources like hardware (printers) and
Mercantile and Wlink, are few popular ISP’s of Nepal software (applications) across the network.
❖ Allows users to easily share and access files from different
c) List any two examples of cybercrimes. computers.
Ay two cybercrimes are phishing and hacking. Any two disadvantages of computer network are:

d) List any two services of internet. ❖ Networks can be hacked, leading to loss or theft of important
Any two services of internet are E-Mail and E-Commerce. data.
❖ Keeping a network running smoothly can be expensive and
e) What is local variable in QBASIC? requires regular updates.
A variable which is defined in a module and is not accessible
to any other module is called local variable. b) What is network connecting device? Write any two of them.
A network connecting device is hardware that connects
f) Which statement is used to call FUNCTION and SUB computers and devices to enable communication, data sharing,
procedure? and resource access. Any two network connecting devices are
A SUB procedure is called using the CALL statement. router and switch.
A FUNCTION procedure is called using its name in an
expression or an assignment statement.
Symbol No: ……………………… 2081-03-27 10:00am 2081-03-27 10:00am
c) What is data communication mode? List its type. It is necessary in E-commerce to provide legal framework to
Data transmission mode is the way of transmission of data from facilitate and safeguard electronic transaction in the electronic
one location to another. media.
Its types are:
Simplex mode is the transmission of data and information that h) Differentiate between SUB and FUNCTION procedure.
takes place in only one direction. Sub procedure Function procedure
Half-duplex is the transmission of data and information that flows Sub procedure name cannot have Function procedure name not
in both directions but only one direction at a time type declaration sign have type declaration sign
Full duplex mode is the transmission of data and information that Sub procedure does not return Function procedure returns value
flows in both direction simultaneously on the transmission path value to calling module to the calling module

d) What is internet? Write any one negative impact of


internet. i) Define 'formal parameter' and 'actual parameter'.
The Internet is a global network of connected devices enabling Formal parameter are variables which are used to specify or
communication, information sharing, and access to online declare types of data to be passed to the procedure either sub or
services. function.
Any one negative impact of internet is: Actual parameter is argument which is used to pass real value or
Personal information can be exposed to hackers or misused by data to the procedure.
online services.
5. Write down the output of the given program. \Show with dry
e) What is cyber law? Why is it important? run in table. (2)
The law which governs the legal issues in the cyber space DECLARE SUB SERU ( )
regarding the internet or WWW for digital data processing and CLS
transaction is called cyber law. CALL SERU
The importance of cyber law is that it controls cyber-crime and END
misuse of computer. SUB SERU ( )
X=2
f) What is hacking? What is the purpose of hacking? C=1
Hacking is the act of gaining unauthorized access to computer WHILE C<=10
systems, networks, or devices to manipulate, steal, or disrupt data. S=X^C
The purpose of hacking is to steal personal or sensitive PRINT S;
information, damage systems, or disrupt services. C=C+1
WEND
g) What is digital signature? Why is it necessary in E- END SUB
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.
Symbol No: ……………………… 2081-03-27 10:00am 2081-03-27 10:00am
Dry Run SQUA = ANS
X C C<=10 S=X^C PRINT S; C=C+1 END FUNCTION
2 1 1<=10 Yes 2^1=2 2 1+1=2
2 2<=10 Yes 2^2=4 4 2+1=3 7. Study the following program and answer the given questions:
3 3<=10 Yes 2^3=8 8 3+1=4 (21=2)
4 4<=10 Yes 2^4=16 16 4+1=5 DECLARE SUB RESULT(A$)
5 5<=10 Yes 2^5=32 32 5+1=6 A$="COMPUTER"
6 6<=10 Yes 2^6=64 64 6+1=7 CALL RESULT(A$)
7 7<=10 Yes 2^7=128 128 7+1=8 END
8 8<=10 Yes 2^8=256 256 8+1=9 SUB RESULT(A$)
9 9<=10 Yes 2^9=512 512 9+1=10 FOR I= 1 TO LEN(A$) STEP 2
10 10<=10 Yes 2^10=1024 1024 10+1=11 X$=MID$(A$,C, I )
11 11<=10 No PRINT X$;
Loop Exits NEXT I
The output of the program is END SUB
2 4 8 16 32 64 128 256 512 1024
Questions:
6. Re-write the given program after correcting the bugs: (2) a) List the library functions used in above program.
CREATE FUNCTION SQUA(A) The library functions used in above program are
REM to print square of a number LEN ( ) and MID$ ( )
CLS
Get "Enter a number"; A b) How many times loop executes in above program.
Call SQUA(A) The loop executes four times in above program.
END
FUNCTION SQUA(A) Group ‘C'
ANS=A^2
8ANS=SQUA Long question Answers: (44=16)
END FUNCTION 8. Convert / calculate as per the instruction:
i) (111101 - 1101) + (11011)
Debugged Program 1 1 1 1 0 1
DECLARE FUNCTION SQUA(A) - 1 1 0 1
REM to print square of a number 0 1 1 0 0 0 0
CLS + 1 1 0 1 1
INPUT "Enter a number"; A 1 0 0 1 0 1 1
PRINT SQUA(A) (111101 - 1101) + (11011) = (1001011)
END
FUNCTION SQUA(A)
ANS=A^2
Symbol No: ……………………… 2081-03-27 10:00am 2081-03-27 10:00am
ii) (110111  11) + (1101) iv) ( DA3 )16 into decimal
(DA3 )₁₆
11) 1 1 0 1 1 1 (10010 = (13 × 162) + (10 × 161) + (3 × 160)
1 1 =13 x 256 + 10 x 16 + 3 x 1
0 0 1 1 =3328 + 160 + 3
1 1 =3491
0 0
1 ( DA3 )16 =(3491)10
1

Q = 10010 9. a) Write a program in QBASIC that allow user to enter


R=1 radius of a circle. Create user define FUNCTION…END
FUNCTION to find area of circle and SUB…END SUB to
1 0 0 1 0 find volume of a cylinder.
+ 1 1 0 1 DECLARE FUNCTION AREA(R)
1 1 1 1 1 DECLARE SUB VOL(R)
CLS
(110111  11) + (1101) = 11111 INPUT “Enter Radius”; R
INPUT “Enter Height”; H
PRINT “Area of circle”; AREA(R)
iii) (129 )10 into binary CALL VOL(R, H)
Divide by the base 2 to get the digits from the remainders: END
Division Quotient Remainder
FUNCTION AREA(R)
by 2 (Digit)
A = 22/7 * R ^ 2
(129)/2 64 1
PRINT “Area if circle=”; A
(64)/2 32 0
END FUNCTION
(32)/2 16 0
(16)/2 8 0 SUB VOL(R)
(8)/2 4 0 V = 22/7 * R ^ 2 * H
(4)/2 2 0 PRINT “Volume of cylinder=”; V
(2)/2 1 0 END SUB
(1)/2 0 1
= (10000001)2

(129 )10 = (10000001)2


Symbol No: ……………………… 2081-03-27 10:00am 2081-03-27 10:00am
b) WAP to reverse a number using SUB…END SUB. Write a program to count the occurrence of letter 'a' in the
DECLARE SUB REV (N) supplied string using SUB…END SUB.
CLS DECLARE SUB COUNT (S$)
INPUT "ENTER ANY NUMBER"; N CLS
CALL REV (N) INPUT "ENTER ANY STRING"; S$
END CALL COUNT(S$)
END
SUB REV (N)
S=0 SUB COUNT (S$)
WHILE N < > 0 AC = 0
R = N MOD 10 FOR I = 1 TO LEN(S$)
S = S * 10 + R B$ = MID$(S$, I, 1)
N = N \ 10 C$ = UCASE$(B$)
WEND IF C$ = "A" THEN AC = AC + 1
PRINT "REVERSED DIGITS="; S NEXT I
END SUB PRINT "TOTAL NO. OF LETTER E = "; AC
10. Write FUNCTION program to check whether the supplied END SUB
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
SOLVED National PABSAN COMPUTER SCIENCE SEE Pre Board Examination-2081
Time: 2:00 Hours
Full Marks: 50
GROUP 'A'
1. Answer the following questions:

a. What is transmission signal?


A transmission signal is a type of signal (like electrical, light, or radio waves) that carries information from
one place to another.

b. What is logical threat in cyber field?


A logical threat in the cyber field refers to a type of threat that targets the software, data, or systems of a
computer or network.

c. Which data type is suitable to store of student name in MS-Access?


In MS-Access, the Text data type is suitable for storing a student's name.

d. What is report?
Report is one of the MS-Access database objects used to present information in an effective and organized
format that is ready for printing.

e. What is formal parameter?


Formal parameters are variables used in a function or procedure to receive values when the function is
called.

f. Write down two header files use in C language.


The two header files use in C language are stdio.h and conio.h.

2. Write appropriate technical term for the following:


a. The rule followed by computer in a network for communication. Protocol
b. Learning through internet. E-learning

3. Write the full form of the following:


a. MODEM - Modulator-Demodulator
b. W3C - World Wide Web Consortium

GROUP 'B'
4. Answer the following questions:

a. Write the difference between client/server and peer to peer network.


Client-Server Network Peer to Peer Network
In a client-server network, powerful computers In a peer-to-peer network, all computers have equal
called servers provide resources and services, while roles and can both provide and request resources
other computers, known as clients, access these without a centralized server.
resources and services.
Security and data management are handled by the Security is managed individually on each peer.
server. Network administrator manages and Each peer is responsible for its own security and
enforces security policies. data.

b. What is computer UPS?


UPS is a battery supported power protection device which controls the electric voltage and supplies clean
and continuous power to the computer system even during power failures.
c. What is cryptography?
Cryptography is the practice of using techniques to secure and protect information by converting it into a
coded format ensuring that only authorized users can access or understand it.

d. What is e-commerce? Write down advantages of it.


E-commerce, or electronic commerce, refers to the buying and selling of goods and services over the
internet.
Advantages of E-commerce
• Faster buying/selling procedure, as well as easy to find products.
• There are no geographical limitations, can deliver service globally.

e. What are the common models of e-commerce?


The common models of e-commerce are:
a) Business to Consumer (B2C):
The most common type of E-Commerce is Business-to-Consumer. B2C establishes the electronic
business relationships between a business organization (merchant) and final consumers.
(e.g. We buy a pair of shoes from an online retailer)
Amazon. com is a good example of B2C e-commerce.
b) Business to Business (B2B):
Business-to-Business (B2B) e-commerce is conducted between companies. Individual customer cannot
buy from this type of e-commerce. Producers and wholesalers typically operate with this type of
electronic commerce.
(e.g. A business sells software-as-a-service for other businesses to use)
Alibaba.com is a good example of B2B e-commerce.
c) Consumer to Consumer (C2C):
Consumer-to-Consumer (C2C) type of e-commerce is conducted between consumers.
These transactions are conducted through a third party, which provides the online platform where the
transactions are actually carried out.
(e.g. You sell your old furniture on hamrobazar to another consumer)
Hamrobazaar.com is a good example of C2C website in Nepal.
d) Consumer to Business (C2B):
When a consumer sells their own products or services to a business or organization
(e.g. An influencer offers exposure to their online audience in exchange for a fee, or a photographer licenses
their photo for a business to use).

f. Write the difference between update query and select query.

Select Query Update Query


- A select query is the most common category - Update query is a type of action query which
which is used to extract specific information makes global changes to a group of records in
from one or more tables in a database. one or more tables.
- The Select query is used to select data from a - The Update query is used to update existing
database. records in a table.

g. What is sorting? Write down two advantages of it.


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.
The advantages of sorting are:
• Sorting helps to organize data and make it easier to find and retrieve specific information.
• Sorting can save time and improve efficiency by allowing users to quickly access the data they need.

h. What is table? Which view use to create table?


Tables are the primary building block of database which stores and manages large volume of data into rows
and column.
Design view is used to create table.

i. What is data type? Give examples.


Data type is an attribute for a field that determines the type of data that can be stored in that field.
Examples of data type are: text, memo, Date/Time, Yes/No etc.

5. Write down the output of the given program:


DECLARE SUB SERIES ( )
CALL SERIES
END
SUB SERIES
N$ = “*”
FOR 1 TO 5
FOR J=1 TO I
PRINT N$;
NEXT J
PRINT
NEXT I
END SUB
Dry Run Table
N$ FOR 1 TO 5 J=1 TO I PRINT N$
* 1 TO 5 Yes 1 TO 1 Yes *
2 TO 1 No
2 TO 5 Yes 1 TO 2 Yes *
2 TO 2 Yes **
3 TO 2 No
3 TO 5 Yes 1 TO 3 Yes *
2 TO 3 Yes **
3 TO 3 Yes ***
4 TO 3 No
4 TO 5 Yes 1 TO 4 Yes *
2 TO 4 Yes **
3 TO 4 Yes ***
4 TO 4 Yes ****
5 TO 4 No
5 TO 5 Yes 1 TO 5 Yes *
2 TO 5 Yes **
3 TO 5 Yes ***
4 TO 5 Yes ****
5 TO 5 Yes *****
6 TO 5 No
6 TO 5 No
Loop Exits
The output of the Program is:
*
**
***
****
*****
6. Re-write the given program after correcting the bugs:
DECLARE FUNCTION SQ$ (N)
CLS
FOR I=1 TO 10
DISPLAY SQ (N)
NEXT N
END
FUNCTION SQ (N)
SQ=N^2
END FUNNCTION

Debugged Program
DECLARE FUNCTION SQ (N)
CLS
FOR N=1 TO 10
PRINT SQ (N)
NEXT N
END

FUNCTION SQ (N)
SQ=N^2
END FUNCTION

7. Study the following program and answer the given questions: 2x1=2
DIM N (10)
DECLARE SUB MIN (N ( ))
CLS
FOR I=1 TO 10
INPUT "ENTER A NUMBER"; N (I)
NEXT I
CALL MIN (N ( ))
END
SUB MIN (N ())
S=N (1)
FOR 1=2 TO 10
IF SN > N(I) THEN S=N (I)
NEXT I
PRINT "THE SMALLEST NUMBER=”;S
END SUB

a. Which is array variable in above program?


The array variable in above program is N.

b. Which is control statement in above program?


The control statement in the program are:
• FOR...NEXT loop
• IF...THEN statement

Convert/Calculate as per the instruction:


a. (165)10 = (?)2
Divide by the base 2 to get the digits from the remainders:
Division Quotient Remainder
by 2 (Digit)
(165)/2 82 1
(82)/2 41 0
(41)/2 20 1
(20)/2 10 0
(10)/2 5 0
(5)/2 2 1
(2)/2 1 0
(1)/2 0 1
= (10100101)2
(165)10 = (10100101)2

b. (101111)2=(?)8

Convert every 3 binary digits (from bit0) to octal digit:


101111
5= 101
7 =111
=57
(101111)2=(57)8

с. (101001) x (101)
1 0 1 0 0 1
x 1 0 1
1 0 1 0 0 1
0 0 0 0 0 0 x
1 0 1 0 0 1 x x
1 1 0 0 1 1 0 1
(101001) x (101) = (11001101)

d. (1101110) / (1101)
1101) 1 1 0 1 1 1 0 (1000
1 1 0 1
0 0 0 0 1 1 0
0
1 1 0

Q=1000
R=110

9. Answer the following questions:


a. Write a program in QBASIC that asks length in meter then display length in centimeter by using
FUNCTION. END FUNCTION and length in millimeter by using SUB.. END SUB.
[Hint 1 meter = 100 Centimeters 1 meter= 1000 Millimeters]

DECLARE FUNCTION MTC(M)


DECLARE SUB MTM(M)
CLS
INPUT "Enter Length in meter: "; M
PRINT "Length in centimeter: "; MTC(M)
CALL MTM(M)
END

FUNCTION MTC(M)
MTC = M * 100
END FUNCTION

SUB MTM(M)
MM = M * 1000
PRINT "Length in millimeter is: "; MM
END SUB

b. Write a program to read records from file name "Rec.dat" and display all the records those post is
manager. File contains field names are employees Name, Post, Date of birth, e-mail address and
Salary.
OPEN “Rec.dat” FOR INPUT AS #1
CLS
PRINT “Name”, “Post”, “Date of Birth”, “E-Mail”, “Salary”
WHILE NOT EOF(1)
INPUT #1, N$, P$, D$, E$, S
IF UCASE$(P$) = “MANAGER” THEN PRINT N$, P$, D$, E$, S
WEND
CLSOE #1
END

10. Write a program in C-language that ask length, breadth and height then display volume of box. 4
[Hint: volume=LxBxH]

#include <stdio.h>
int main( )
{
float length, breadth, height, volume;
printf("Enter the length of the box: ");
scanf("%f", &length);
printf("Enter the breadth of the box: ");
scanf("%f", &breadth);
printf("Enter the height of the box: ");
scanf("%f", &height);
volume = length * breadth * height;
printf("The volume of the box is: %.2f\n", volume);
return 0;
}

Or
Write a program in C-language to display the series 5, 10, 15, 20, 25 up to 10th term.

#include <stdio.h>
int main( )
{
int i, term;

for (i = 1; i <= 10; i++) {


term = 5 * i;
printf("%d ", term);
}
printf("\n");
return 0;
}

***ALL THE BEST***


PABSON KASKI SEE Computer Science Preparatory Examination 2081
Time: 2:00 Hours
Full Marks: 50
GROUP 'A'
1. Answer the following questions:

a. What is bandwidth?
Bandwidth is the maximum amount of data that can be transmitted over a network or communication
channel in a given amount of time.

b. What is online payment?


Online payment refers to the payment for buying goods or services through the Internet using different
online payment gateway.

c. Write any two methods of creating tables in MS-Access.


Any two methods of creating tables in MS-Access are: Design view and Datasheet view.

d. While designing table structure, which data types are suitable to store information about a
student’s name and class?
The suitable data type to store student’s name is text and class is number.

e. List the types of procedures used in QBasic Programming.


The types of procedures used in QBasic Programming are: SUB Procedure and FUNCTION procedure.

f. How many keywords are used in C language?


There are 32 keywords used in C language.

2. Write appropriate technical term for the following:


a. The network security systems that monitor and controls the traffic flow between the internet and private
network. Firewall
b. System of interrelated computing devices with unique identifiers that transfer data over a network without
human intervention. IoT (Internet of Things)

3. Write the full form of the following:


a. HTTP – Hypertext Transfer Protocol
b. CCTV – Closed-Circuit Television

GROUP 'B'
4. Answer the following questions:

a. Differentiate between Guided and Unguided Media.

Guided Media Unguided Media


The media which uses cable or wire to transfer data Unguided communication is a communication
and information among computers are called guided channel in which data and information are
communication media. transferred through the air.
Examples of guided media are Twisted Pair Cable, Examples of unguided media are Radio Wave,
Co-Axial Cable and Fiber Optic Cable Micro Wave and Satellite Communication

b. Mention any two threats and two opportunities of using social media.
Opportunities of using social media
Networking: Connect globally, build relationships, and join communities.
Marketing and Branding: Promote businesses and engage with customers.
Threats of using social media
Privacy Risks: Personal information can be exposed or misused.
Cyberbullying: Harassment or bullying through online interactions.
c. What is hardware security? List any two software security measures.
Hardware security refers to the protection of the physical components of a computer or electronic device
from unauthorized access, theft, or damage.
Any two software security measures are password and backup.

d. What is Cloud computing? Write any two advantages of cloud computing.


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 advantages cloud computing are:
❖ Access data and applications from anywhere with an internet connection
❖ Improved data backup and recovery capabilities

e. Define M-Commerce. List the different types of e-commerce?


M-commerce refers to the buying and selling of goods and services through mobile devices like
smartphones and tablets.
The different types of e-commerce are:
❖ Business to Consumer (B2C)
❖ Business to Business (B2B)
❖ Consumer to Consumer (C2C)
❖ Consumer to Business (C2B)

f. What is database? Write any two examples of database.


A collection of systematically organized inter-related data which store, organize and retrieve data is called a
database. Any two examples are: Dictionary and Telephone Directory.

g. What is query? Write down two importance 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.
Any two importance of query are:
❖ Queries can be used to create reports and forms that extract meaningful information from data.
❖ Queries allow users to filter, sort, and group data in meaningful ways.

h. What is primary key? Write its importance.


A primary key is a unique field in a database table that identifies each record uniquely.
The importance of primary key are:
❖ It sets the relationship between tables.
❖ It reduces and controls duplication of record in a table.

i. Define sorting and filtering.


Sorting Filtering
The process of arranging all the records in a table Filtering is the process of viewing required record of
either ascending or descending order based on field a table that matches the specifies criteria.
or fields is known as sorting.
Sorting can be done in ascending or descending Filtering has various criteria that can be applied.
order.

5. Write down the output of the given program and show them in dry run table:
DECLARE SUB SERIES ( )
CLS
CALL SERIES
END
SUB SERIES ( )
X=1
Y=1
FOR P = 1 TO 10
PRINT X;
X=X+Y
Y=Y+1
NEXT P
END SUB
Dry Run Table
X Y P = 1 TO 10 PRINT X; X=X+Y Y=Y+1
1 1 1 TO 10 Yes 1 1+1=2 1+1=2
2 2 2 TO 10 Yes 2 2+2=4 2+1=3
4 3 3 TO 10 Yes 4 4+3=7 3+1=4
7 4 4 TO 10 Yes 7 7+4=11 4+1=5
11 5 5 TO 10 Yes 11 11+5=16 5+1=6
16 6 6 TO 10 Yes 16 16+6=22 6+1=7
22 7 7 TO 10 Yes 22 22+7=29 7+1=8
29 8 8 TO 10 Yes 29 29+8=37 8+1=9
37 9 9 TO 10 Yes 37 37+9=46 9+1=10
46 10 10 TO 10 Yes 46 46+10=56 10+1=11
56 11 11 TO 10 No
Loop Exits
The output of the Program is:
1 2 4 7 11 16 22 29 37 46

6. Re-write the given program after correcting the bugs:


REM TO CHECK ODD OR EVEN NUMBERS.
DECLARE FUNCTION TEST$(N)
CLS
INPUT “ENTER ANY NUMBER”; N$
PRINT “THE NUMBER IS “; TEST$
END

FUNCTION TEST$(N)
R = R MOD 2
IF R = 0 THEN
A$= “EVEN”
ELSE
A$ = “ODD”
END IF
A$ = TEST$
END FUNCTION

Debugged Program
REM TO CHECK ODD OR EVEN NUMBERS.
DECLARE FUNCTION TEST$(N)
CLS
INPUT "ENTER ANY NUMBER"; N
PRINT "THE NUMBER IS "; TEST$(N)
END

FUNCTION TEST$(N)
R = N MOD 2
IF R = 0 THEN
A$ = "EVEN"
ELSE
A$ = "ODD"
END IF
TEST$ = A$
END FUNCTION

7. Study the following program and answer the given questions: 2x1=2
DECLARE FUNCTION SUM (N)
CLS
INPUT “ENTER MULTIDIGIT NUMBER”; A
SU = SUM(A)
PRINT “SUM OF DIGITS”; SU
END

FUNCTION SUM(N)
S=0
WHILE N < > 0
R = N MOD 10
S=S+R
N = N \ 10
WEND
SUM = S
END FUNCITON

a. What is the name of the function used in the above program?


The name of the function used in the above program is Sum ( ).

b. List the formal and real parameters used in the above program.
The formal parameter is N and real parameter is A.

Convert/Calculate as per the instruction:


a. (101101)2 into decimal

(101101)₂
= (1 × 2⁵) + (0 × 2⁴) + (1 × 2³) + (1 × 2²) + (0 × 2¹) + (1 × 2⁰)
=1×32 + 0×16 + 1×8 + 1×4 + 0×2 + 1×1
=32+0+8+4+0+1
(101101)10 = (45)₁₀

b. (BAD)16=(?)8

Convert each hex digit to 4 binary digits


BAD
=BAD
B = 1011
A = 1010
C = 1101
101110101101
Convert each 3 binary digits to octal digits
5= 101
6 = 110
5 = 101
5 = 101
= 5655
(BAD)16=(5655)8

с. (1101) x (101)
1 1 0 1
x 1 0 1
1 1 0 1
0 0 0 0 x
1 1 0 1 x x
1 0 0 0 0 0 1
(1101) x (101) = (11000001)

d. (10100) / (11)
11) 1 0 1 0 0 (110
1 1
1 0 0
1 1
1 0
0
1 0
Q=110
R=10

9. Answer the following questions:


a. Write a program in Qbasic to input three different numbers and display smallest
and greatest number. Create a user define function to display smallest and sub
program to display greatest number.

DECLARE FUNCTION SMALL(A,B,C)


DECLARE SUB GREAT(A,B,C)
CLS
INPUT"ENTER FIRST NUMBER";A
INPUT"ENTER SECOND NUMBER";B
INPUT"ENTER THIRD NUMBER";C
PRINT"THE SMALLEST NUMBER IS: ";SMALL(A,B,C)
CALL GREAT(A,B,C)
END

FUNCTION SMALL(A,B,C)
IF A<B AND A<C THEN
SMSLL=A
ELSEIF B<A AND B<C THEN
SMALL=B
ELSE
SMALL=C
END IF
END FUNCTION
SUB GREAT(A,B,C)
IF A>B AND A>C THEN
PRINT"THE GREATEST NUMBER IS ";A
ELSEIF B>A AND B>C THEN
PRINT"THE GREATEST NUMBER IS ";B
ELSE
PRINT"THE GREATEST NUMBER IS ";C
END IF
END SUB

b. A sequential data file "student.txt" has stored data under the field heading Roll
No ., Name, Gender, marks of English , Nepali and Computer . Write a program to
display all the information of those student whose gender is 'F' and obtained marks
in computer is more than 90 .
OPEN "student.txt" FOR INPUT AS #1
CLS
WHILE NOT EOF (1)
INPUT #1, RN, SN$, G$, E, N, C
IF UCASE$(G$) = “F” AND C >90 THEN PRINT RN, SN$, G$, E, N, C
WEND
CLOSE #1
END

10. Write a C language that asks a number and check whether it is odd or even.

#include<stdio.h>
#include<conio.h>
int main( )
{
int n;
printf("Enter any number: ");
scanf("%d", &n);
if(n % 2 = = 0)
{
printf("%d is even number", n);
}
else
{
printf("%d is odd number", n);
}
return 0;
}

Or
Write a C language to display the following series:
1, 3, 5, 7……….up to 10th terms.

#include <stdio.h>
int main( )
{
int i, a=1;

for (i = 1; i <= 10; i++)


{
printf("%d ", a);
a = a + 2;
}
return 0;
}

***ALL THE BEST***


PS3031 "A"
SEe PRE-BOARD EXAM 2081
Subject: Computer Science
FM: 50
Time: 2 hrs
Candidates are required to give their answer according to the given instructions.
Group "A"

1. Answer the following questions in one sentence:

a. What is web browser?


A web browser is a software application used to access and view websites on the internet.

b. What is the business conducted through wireless handheld device?


The business conducted through wireless handheld devices is called M-commerce.

c. Which data type is used to video file in MS-Access?


In MS-Access, the data type used to store a video file is the OLE Object data type.

d. What is Filtering?
Filtering is the process of viewing required record of a table that matches the specified criteria.

e. Write difference between function procedure and sub procedure.


A function procedure returns a value, while a sub procedure does not return any value.

f. Write any two header files of C language.


The two header files use in C language are stdio.h and conio.h .

2. Write appropriate technical term for the following: [2x1=2]


a. It is the act of copying someone else's work and publishing it as your own work. Plagiarism
b. The process of converting original representation of the information, known as plaintext, into an
alternative form known as ciphertext. Encryption

3. Write the full form of the following:


a. ASCII - American Standard Code for Information Interchange
b. MAC - Media Access Control

Group "B"
4. Answer the following questions:

a. Define computer network. List the types of computer network.


A computer network is a system of interconnected computers and devices that communicate with each other
to share resources, data, and information.
The types of computer network are:
1. LAN (Local Area Network)
2. MAN (Metropolitan Area Network)
3. WAN (Wide Area Network)

b. What is cyber ethics? List any two of them.


Cyber 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 cyber ethics are:
❖ Do not use a computer to harm other people.
❖ Do not use a computer to publish fake information.
c. What is computer security? Write any two measures of hardware security.
Computer security refers to the protection of computer systems and data from unauthorized access, theft or
misuse and damage and action to prevent such incidents.
Any two measures of hardware security are:
Regular Maintenance and Power Protection Device

d. What is m-computing? Write advantages of m-computing.


Mobile computing refers to the use of portable devices like smartphones, tablets, and laptops that let users
access and share data, information, and apps from anywhere, without needing to stay in one place.
Advantages of m-computing are:
• It allows people to work and communicate from anywhere at any time.
• It keeps connected to the Internet, allowing to access information all the times.

e. What is VR? Write two application areas of VR.


Virtual Reality (VR) is the use of computer technology to create a simulated environment that doesn’t
actually exist, that can give a feel of near real world with all or some of senses experiencing the virtually
simulated environment.
Two application areas of VR are:
• Gaming- VR Gaming allows players to immerse (dip) themselves in virtual world and interact with
environment and characters
• Education - VR can help students learn by making the content more engaging and memorable.

f. What is query? List its types.


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.
Its types are:
• Select Query
• Action Query (Append, Update, Delete and Make Table)

g. Define filtering. Write two examples of it.


Filtering is the process of viewing required record of a table that matches the specified criteria.
Any two examples of filtering are:
• Displaying only the students who scored above 90% in a database.
• Showing products in an online store that are within a specific price range.

h. Define primary key. Write any two advantages of it.


A primary key is a unique field in a database table that identifies each record uniquely.
Any two advantages of primary key are:
It sets the relationship between tables.
It reduces and controls duplication of record in a table

i. What is field and database.


A field is a column in a table which contains information about a certain type for all records.
A collection of systematically organized inter-related data which store, organize and retrieve data is called a
database.

5. Write down the output of the given program. Show with dry-run in table.
CLS
P=1: Q=1
CALL DISP(P,Q)
END
SUB DISP(M,N)
WHILE (N<=5)
PRINT M
M=M*10+N
N=N+1
WEND
END SUB

P Q M N N<=5 PRINT M M=M*10+N N=N+1


1 1 1 1 1<=5 Yes 1 1x10+1 1+1=2
11
11 2 2 <=5 Yes 11 11*10+2 2+1=3
112
3 3<=5 Yes 112 112*10+3 3+1=4
1123
4 4<=5 Yes 1123 1123*10+4 4+1=5
11234
5 5<=5 Yes 11234 11234*10+5 5+1=6
112345
6 6<=5 No
Loop Exits

The output of the program is:


1
11
112
1123
11234

6. Re-write program after correcting the bugs:


REM To display some records from data file "info.dat"
CLS
OPEN "MARKS.DAT FOR INPUT AS #1
PRINT "Roll , "Name", "English"."Nepali", "Maths"
DO WHILE EOF()
INPUT #1,RN,N$,E,N,M
PRINT R,N$.E,Ne,M
END WHILE
CLOSE #1
END

Debugged Program
REM To display some records from data file "info.dat"
CLS
OPEN "INFO.DAT” FOR INPUT AS #1
PRINT "Roll , "Name", "English"."Nepali", "Maths"
DO WHILE NOT EOF(1)
INPUT #1,RN,N$,E,N,M
PRINT RN,N$.E,Ne,M
LOOP
CLOSE #1
END

7. Study the following program and answer the given questions:


DECLARE SUB TEST (A, B, C)
LET X=4
LET Y=7
LETZ=12
CALL TEST (X, Y, Z)
PRINT X, Y, Z
END
SUB TEST (A, B, C)
A=A+3
B-B+2
SUM=A+B+C
PRINT SUM
END SUB

a. List the arguments and parameters used in the above program.


The arguments are: X, Y and Z
The parameters are: A, B, C

b. List local variables used in each module.


The local variables used in main module are X, Y and X
The local variables used in sub procedure are: A, B, C and SUM.

Group "C"
8. Convert/calculate as per the instruction:

a. (10101011)2 = (?)16
Convert every 4 binary digits (from bit0) to hex digit :
10101011
= 1010 1011
1010= A
1011 = B
= AB
(10101011)2 = (AB)16

b. (641)10 = (?)2
Divide by the base 2 to get the digits from the remainders:
Division Quotient Remainder
by 2 (Digit)
(641)/2 320 1
(320)/2 160 0
(160)/2 80 0
(80)/2 40 0
(40)/2 20 0
(20)/2 10 0
(10)/2 5 0
(5)/2 2 1
(2)/2 1 0
(1)/2 0 1
= (1010000001)2
(641)10 = (1010000001)2
c. (1010) x (11) - (101)

1 0 1 0
x 1 1
1 0 1 0
1 0 1 0 x
1 1 1 1 0

d. (101101) / (110)

110) 1 0 1 1 0 1 (111
1 1 0
1 0 1 0
1 1 0
1 0 0 1
1 1 0
1 1

Q = 111
R = 11

9. a. Write a program in QBASIC that asks for the radius and height of a cylinder and calculates its
surface area and volume. Create a user-defined function to calculate the surface area and a sub-
program to calculate the volume. Hint: Surface Area=2*pi*r* (r+h). Volume pi*r^2*h]
DECLARE FUNCTION TSA(R,H)
DECLARE SUB VOL(R,H)
CLS
INPUT “ENTER THE RADIUS”;R
INPUT “ENTER THE HEIGHT”;H
PRINT “THE TSA OF CYLINDER IS ”;TSA(R,H)
CALL VOL(R,H)
END

FUNCTION TSA(R,H)
TSA = 2*3.14*R*(R+H)
END FUNCTION

SUB VOL(R,H)
V = 3.14*R^2*H
PRINT “THE VOLUME OF CYLINDER IS ”; V
END SUB

b. A sequential data file called "Employee.txt" has stored data under the field headings Employee ID,
Name, Gender, Department, and Salary. Write a program to display all the information of those
employees whose salary is greater than 50,000 and the department is "IT".

OPEN " Employee.txt " FOR INPUT AS #1


CLS
WHILE NOT EOF (1)
INPUT #1, ID, N$, G$, D$, S
IF UCASE$(D$) = “TT” OR S>50000 THEN PRINT A ID, N$, G$, D$, S
WEND
CLOSE #1
END

10. Write a program in C language that asks three integer number and display smallest among three
numbers
OR

#include<stdio.h>
#include<conio.h>
int main()
{
int a,b,c;
printf("Enter any three numbers:\n ");
scanf("%d %d %d" , &a, &b, &c);
if(a<b && a<c)
printf("The smallest number is %d", a);
else if(b<a && b<c)
printf("The smallest number is %d", b);
else
printf("The smallest number is %d", c);
return 0;
}

Write a program in C language to display reverse of an multi digit integer input number.

#include<stdio.h>
#include<conio.h>
int main()
{
int n, s, r;
s=0;
printf("Enter any number: ");
scanf("%d", &n);
while(n>0)
{
r=n%10;
s=s*10+r;
n=n/10;
}
printf("Reverse digits= %d",s);
return 0;
}

***The End***
SEE Efficiency Test: 2025
Subject: Computer Science
Time: 2:00 hrs
Full Marks: 50
Candidates are required to give their answers in their own words as far as practicable.
GROUP A

(Very Short Questions-10 Marks)

1. Answer the following questions: (6×1=6)

a) List any two mode of Data Communication.


Ans: Any two mode of data communication are simplex mode and duplex mode (half duplex mode and full
duplex mode).

b) Define Firewall.
Ans: A firewall is a security system that monitors and controls incoming and outgoing network traffic to
protect systems from unauthorized access and cyber threats.

c) Write any two types of Cloud Computing.


Ans: Any two types of cloud computing are public cloud and private cloud.

d) What is M-Commerce ?
Ans: M-commerce refers to the buying and selling of goods and services through mobile devices like
smartphones and tablets.

c) What do you mean by Argument?


Ans: An argument refers to a value or variable that is passed to a procedure when it is called.

f) List any two keywords used in C Language.


Ans; Any two keywords used in C Language are int and return.

2. Give the appropriate technical terms of the following: (2×1=2)

a) The specific computer or specific internet location that delivers the web contents to the client devices via
internet. Web Server

b) The software intentionally designed to cause to a computer, server, client, or computer network, leak
private information, gain unauthorized access to information or system. Malware

3. Write the full form for the following: (2×1=2)

a) SaaS - Software as a Service


b) VRML - Virtual Reality Modeling Language

GROUP-B
(Short Questions-24 Marks)
Answer the following questions: (9×2=18)

a) Define Bus Topology? Write any two disadvantages of Ring Topology.


Ans: Bus topology is a network configuration where all devices are connected to a single central cable
known as a "bus".
Any two disadvantages of Ring Topology are:
• If one device or the connection between two devices fails, the whole network can stop working.
• Finding and fixing problems in the network can be harder compared to other topologies.
b) What is Digital Footprint? List any two consideration to be followed for managing Digital
Footprint.
Ans: 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.
Any two consideration to be followed for managing Digital Footprint are:
• Subscribed accounts and unused social media accounts which are no longer in use should be unsubscribed
or deleted.
• Ensure the content posted protect your privacy.

c) What is Password Policy? Write any two Password Policy.


Ans: A password policy is a set of rules or guidelines designed to ensure that passwords are secure.
Any two Password Policy are:
• Don't use a sequence like abcd or 1234 which are, again, easily guessable.
• Mix characters, numbers and symbols. Also, mix small and capital letters.

d) Differentiate between Traditional Commerce and E-commerce


Traditional Commerce E-commerce
Traditional commerce refers to the buying E-commerce refers to the buying and selling
and selling of goods and services from of goods and services over the internet
person to person without use of internet.
Customers can inspect products physically Customers can not inspect products
before purchase. physically before purchase.

e) What do you mean by lot? List its any two advantages.


Ans: Internet of Things (IoT) refers to a network of interconnected physical devices that can collect and
exchange data over the internet without requiring human intervention.
Any two advantages are:
❖ It reduces the human effort, so it saves a lot of time.
❖ Information is easily accessible from any place at any time on any device.

f) What is do you mean by DBMS? Write any two advantages of DBMS.


Ans: DBMS is a computerized system that stores data, processes them and provides information in an
organized form.
Any two advantages of DBMS are:
• It reduces data redundancy which means duplication of data.
• It allows multiple users to access the same data simultaneously.

g) While designing table structure which data types are suitable to store information about teacher's
name, address, salary and date of birth?
Ans: Teacher’s Name – Text
Addess – Memo
Salary – Currency
Date of bith – Date/Time

h) Differentiate between Query and Filter.


Filter Query
A filtering can be used to display all the data A querying can be used to display selected
of a single table based on a specified data from one or more tables based on a
condition specified condition or no condition at all.
Altering the data displayed changes the Manipulating the data of a saved query does
original data of the table. not affect the original data.
i) What is Data Redundancy? How it can be reduced in database?
Ans: Data redundancy refers to the repetition of data in a database, where the same data is stored in multiple
places.
Data redundancy can be reduced by normalizing the database, eliminating duplicate data and storing it in
separate tables, and using foreign keys to establish relationships between the tables.

5. Write the output of the following program showing necessary rough:

DECLARE SUB DISPLAY ( )


CLS
CALL DISPLAY
END

SUB DISPLAY
LET N = 100
DO UNTIL N < 50
R=N MOD 9+3
IF R MOD 4=0 THEN GOTO BOTTOM
PRINT R
BOTTOM:
N=N-10
LOOP
END SUB

Dry Run
N N < 50 R=N MOD 9+3 R MOD 4=0? NO YES
PRINT R N=N-10
100 100<50 No 100 MOD 9 + 3 4 MOD 4=0? 100-10=90
1+3=4 0=0 YES

90 90<50 No 90 MOD 9 +3 3 MOD 4=0? 3 90-10=80


0+3=3 3=0 No
80 80<50 No 80 MOD 9 +3 11 MOD 4 =0? 11 80-10=70
8+3=11 3=0?nO
70 70<50 No 70 MOD 9 +3 10 MOD 4=0? 10 70-10=60
7+3=10 2=0?No
60 60<50 No 60 MOD 9 + 3 9 MOD 4=0? 9 60-10=50
6+3=9 1=0 No
50 50<50 No 50 MOD 9 +3 8 MOD 4 =0? 50-10=40
5+3=8 0=0 YES
40 40<50 YES
LOOP
EXITS

The output of the program is:


3
11
10
9

6. Rewrite the program after correcting the bugs:

REM to count total number of values existing among a different number input by a user DIVISIBLE BY 3.
DECLARE FUNCTION DIVBY3 (a( ), n)
CLS
FOR CNT=0 TO n-1
INPUT "Enter the number"; a(n)
NEXT CNT
Totno=DIVBY3 (a, n)

PRINT "Total number of values divisible by 3 is"; totno


END

FUNCTION DIVBY3( )
count=0
FOR CNT=0 to n-1
IF a(CNT) MOD 3=0 THEN count=count+1
NEXT CNT
COUNT=DIVBY3
END FUNCTION

Debugged Program
REM To count the total number of values divisible by 3 among numbers input by the user.
DECLARE FUNCTION DIVBY3 (a( ), n)
CLS
INPUT "Enter the number of values: "; n
DIM a(n)

FOR CNT = 0 TO n-1


INPUT "Enter the number: "; a(CNT)
NEXT CNT

Totno = DIVBY3(a( ), n)

PRINT "Total number of values divisible by 3 is"; Totno


END

FUNCTION DIVBY3 (a(), n)


count = 0
FOR CNT = 0 TO n-1
IF a(CNT) MOD 3 = 0 THEN count = count + 1
NEXT CNT
DIVBY3 = count
END FUNCTION

7. Read the following program and answer the following questions:

OPEN "BUSRIDER.TXT" FOR INPUT AS #1


OPEN "TEMP.TXT" FOR OUTPUT AS #2
CLS
WHILE NOT EOF (1)
INPUT #1. STUDENTNAME$, CLASS, BUSCODE, BUSSTOP$
IF UCASE$(BUSSTOP$) < > UCASE$("KATHMANDU") THEN
WRITE #2, STUDENTNAME$, CLASS, BUSCODE, BUSSTOP$
PRINT STUDENTNAME$, CLASS, BUSCODE, BUSSTOP$
END IF
WEND
CLOSE #1, #2
KILL"BUSRIDER.TXT"
NAME "TEMP.TXT" AS "BUSRIDER.TXT"
END

a) What is the main objective of the program given above?


Ans: The main objective of the program given above is to delete the records whose address is
KATHMANDU.

b) Do you get any problem in above program if "Kill" statement is removed? Give reason.
Ans: Yes, the program will not work correctly because the original file "BUSRIDER.TXT" will not be deleted,
and renaming "TEMP.TXT" to "BUSRIDER.TXT" will fail due to the existence of the original file.

GROUP-C

(Long Questions-16 Marks)

8. Calculate/Convert as per the instruction:(4×1=4)

a) (101101) X (1110)2-(10101)

1 0 1 1 0 1
x 1 1 1 0
0 0 0 0 0 0
1 0 1 1 0 1 x
1 0 1 1 0 1 x x
1 0 1 1 0 1 x x x
1 0 0 1 1 1 0 1 1 0
- 1 0 1 0 1
1 0 0 1 1 0 0 0 0 1
(101101) X (1110)2-(10101) = (1001100001)

b) (11011010) / (10101)

10101) 1 1 0 1 1 0 1 0 (1010
1 0 1 0 1
0 0 1 1 0 0 1
1 0 1 0 1
0 0 0 0 1 0 0 0
0
1 0 0 0
Q=1010
R=1000

c) (DEF86)16= (?)8
Convert each hex digit to 4 binary digits
DEF86
=DEF86
D= 1101
E = 1110
F = 1111
8 = 1000
6 = 0110

convert each 3 binary digits to octal digits


= 11 011 110 111 110 000 110

3= 011
3 = 011
6 = 110
7 = 111
6 = 110
0 = 000
6 = 110

=3367606
(DEF86)16= (3367606)8

d) (872)10 = (?)2
Divide by the base 2 to get the digits from the remainders:
Division Quotient Remainder
by 2 (Digit)
(872)/2 436 0
(436)/2 218 0
(218)/2 109 0
(109)/2 54 1
(54)/2 27 0
(27)/2 13 1
(13)/2 6 1
(6)/2 3 0
(3)/2 1 1
(1)/2 0 1
= (1101101000)2
(872)10 = (1101101000)2

9.

a) Write a QBASIC program that asks radius and height then calculate Area of curved surface and Total
surface area. Create a USER DEFINED FUNCTION to calculate Total surface area and SUB-PROGRAM to
calculate Area of curved surface. [Hint: TSA=2pir(r + h) and AOCS=2pir²] (4)

DECLARE FUNCTION TSA (r, h)


DECLARE SUB AOCS (r, h)
CLS
INPUT "Enter radius: "; r
INPUT "Enter height: "; h
PRINT "Total Surface Area: "; TSA(r, h)
CALL AOCS(r, h)
END

FUNCTION TSA (r, h)


TSA = 2 * 3.14 * r * (r + h)
END FUNCTION

SUB AOCS (r, h)


AOCS = 2 * 3.14 * r * h
PRINT "Area of Curved Surface: "; AOCS
END SUB

b) A sequential data file "Reverse. Txt" contains name of the 20 teachers. Write a QBASIC program to
display name of the teachers in Reverse form. (4)

CLS
DIM teachers(20) AS STRING
OPEN "Reverse.Txt" FOR INPUT AS #1

FOR i = 1 TO 20
LINE INPUT #1, teachers(i) ' Read teacher names into an array
NEXT i
CLOSE #1

PRINT "Teachers' Names in Reverse Order:"


FOR i = 20 TO 1 STEP -1
PRINT teachers(i) ' Display names in reverse order
NEXT i

END

10. Write a program in C language that asks the value of 3 sides of a triangle then check whether triangle is
Scalene or not. (4)

#include <stdio.h>
int main()
{
int a, b, c;
printf("Enter three sides of a triangle: ");
scanf("%d %d %d", &a, &b, &c);
if (a != b && b != c && a != c) {
printf("The triangle is Scalene.\n");
} else {
printf("The triangle is not Scalene.\n");
}
return 0;
}

OR

Write a program in C language to display the odd numbers from 1000 to 500 with their sum.

#include <stdio.h>
int main()
{
int sum = 0;
for (int i = 1000; i >= 500; i--)
{
if (i % 2 != 0)
{
printf("%d\n", i);
sum += i;
}
}
printf("Sum of odd numbers: %d\n", sum);
return 0;
}

"Good Luck"
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
SEE Model Question Issued by CDC
Opt. II Computer Science
F.M. : 50
Group ‘A’ (10 Marks)

1. Answer the following questions in one sentence. [6×1=6]

a) What is search engine?


A search engine is an online tool that helps users find information on the internet using keywords or
phrases and provide relevant results.

b) What is the business done through internet?


The business done through internet is e-commerce.

c) Which data type is used to store alpha numeric characters or special symbols in MS-Access?
The text data type is used to store alpha numeric characters or special symbols in MS-Access.

d) Which view is used to modify a table in MS-Access?


Design view is used to modify a table in MS-Access

e) What is modular programming?


Modular programming is a technique used to divide program into many small, manageable, logical
and functional modules or blocks.

f) Write any two features of C language.


Any two features of C language are:
• Portability: C code can be compiled and executed on different systems with minimal
modifications.
• C is a case-sensitive programming language. It understands the capital alphabets and small
alphabets as different values

2. Write appropriate technical terms for the following: [2×1=2]


a) Law that governs the legal issues of cyberspace. Cyber Law
b) The smallest unit to represent information on a quantum computer Qubit (Quantum bit)

3. Write the full forms of the following: [2×1=2]


a) STP: Shielded Twisted Pair
b) WAP: Wireless Application Protocol

Group ‘B’ [24 Marks]

4. Answer the following questions. [9×2=18]

a. What is computer network? Enlist any two advantages of it.


Computer network is a group of two or more computers and devices connected to each other through
wired or wireless media to exchange data and information and share hardware, software and other
resources.
Any two advantages of computer network are:
• A network connected computers can share hardware devices such as scanner, printer, hard disk,
etc.
• It also provides the facility of data and software backup system.

1|P a g e SET SOLUTIONS https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
b. What is computer ethics? Write any two of them.
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 cyber ethics are:
• Do not use a computer to publish fake information.
• Do not search the file or record of other people.

c. What is software security? Write any two measures of hardware security.


Software security means protecting software from being hacked or misused which ensures the
software works properly and keeps data safe.
Any two measures of hardware security are: Insurance and Power Protection Device

d. What is M-Commerce? Write any two important services.


M-commerce (Mobile Commerce) refers to buying, selling, and conducting business transactions
through mobile devices like smartphones and tablets.
Any two important services are: mobile banking and mobile shopping.

e. What is IoT? Write any two importance of it.


IoT (Internet of Things) refers to a network of interconnected devices that communicate and share
data over the internet.
Any two importance of IoT are:
• Information is easily accessible from any place at any time on any device.
• Tasks can be performed automatically without human intervention.

f. What is database? Give any two examples.


A collection of systematically organized inter-related data which store, organize and retrieve data is
called a database. E.g. Dictionary and Telephone Directory.

g. What is primary key? List any two advantages of it.


A primary key is a unique field in a database table that identifies each record uniquely.
Any two advantages of primary key are:
• It sets the relationship between tables.
• It reduces and controls duplication of record in a table

h. What is data sorting? List any two advantages of using it.


The process of arranging all the records in a table either ascending or descending order based on field
or fields is known as sorting.
Any two advantages of sorting are:
• Sorting helps to organize data and make it easier to find and retrieve specific information.
• Sorting can save time and improve efficiency by allowing users to quickly access the data they
need.

i. What type of work is done in MS-Access using form and query object.
• Form provides graphical interface to view, modify and add data in a table or multiple linked tables.
• Query is used to view, retrieve, change and analyze records from a table or multiple linked tables
based on specified condition.

5. Write the output of the given program: Show with dry run in table. [2]
DECLARE SUB SHOW(A)
CLS
N=87
CALL SHOW(N)
2|P a g e SET SOLUTIONS https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
END
SUB SHOW(A)
DO
B=A MOD 6+3
IF B MOD 4=0 THEN GOTO AA
PRINT B;
AA:
A=A-10
LOOP WHILE A>=50
END SUB

Dry run table


N A B =A MOD 6+3 B MOD 4=0 PRINT B; A=A-10
87 87 87 MOD 6 + 3=6 6 MOD 4=0 6 87-10=77 77>=50 yes
3+3=6 2=0 NO
77 77 MOD 6 + 3 =8 8 MOD 4=0 77-10=67 67>=50 yes
5+3=8 0=0YES
67 67 MOD 6 + 3=4 4 MOD 4=0 67-10=57 57>=50 yes
1+3=4 0=0 YES
57 57 MOD 6 + 3=6 6 MOD 4=0 6 57-10=47 47>=50 no
3+3=6 2=0 NO
47
The output of a program is:
6 6

6. Re-write the given program after correcting the bugs: [2]


REM to add record in an existing file
CLS
OPEN “Record.Dat” FOR OUTPUT AS #1
AA:
INPUT “Enter Name, Class and Roll No.”; Nm$, Cl, Rn
INPUT #2, Nm$, Cl, Rn
INPUT “More records”; Y$
IF UCASE$(Y$)=”Y” THEN GOTO aa
CLOSE “Record.dat”
END
Debugged program:
REM to add record in an existing file
CLS
OPEN “Record.Dat” FOR APPEND AS #1
AA:
INPUT “Enter Name, Class and Roll No.”; Nm$, Cl, Rn
WRITE #1, Nm$, Cl, Rn
INPUT “More records”; Y$
IF UCASE$(Y$)=”Y” THEN GOTO AA
CLOSE #1
END
7. Study the following program and answer the given questions. [2×1=2]
OPEN “Detail.dat” FOR INPUT AS #1
OPEN “Temp.dat” FOR OUTPUT AS #2
INPUT “Enter name of the students”; S$
FOR I=1 TO 10

3|P a g e SET SOLUTIONS https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
INPUT #1, Nm$, Cl, A
IF S$< >Nm$ THEN
WRITE #2, Nm$, Cl, A
END IF
NEXT I
CLOSE #1, #2
KILL “Detail.dat”
NAME “Temp.dat” AS “Detail.dat”
END
a. What is the main objective of the program given above?
The main objective of the program is to delete the record of a specific student, identified by their
name from the data file Detail.dat.

b. Do you get any problem in the above program if “Kill” statement is removed? Give reason.
Yes, there would be a problem if the KILL statement is removed. Because without the KILL
statement, both Detail.dat and Temp.dat will exist, and the renaming (NAME "Temp.dat" AS
"Detail.dat") will fail because a file cannot be renamed to an existing file's name, causing an error and
preventing the update.
8. Convert / Calculate as per the instruction. [4×1=4]
a. (11001101)2 = (?)16
Soln:
Converting Binary to octal
Binary 1100 1101
value in
four bits
Octal C D
number
(11001101)2 = (CD)16

b. (524)10 = (?)2
Soln:
Remainder
2 524
2 262 0
2 131 0
2 65 1
2 32 1
2 16 0
2 8 0
2 4 0
2 2 0
2 1 0
2 0 1

(524)10 = (1000001100)2

c. (1010)2 × (110)2 – (1011)2 = (?)2

1 0 1 0
× 1 1 0
4|P a g e SET SOLUTIONS https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
0 0 0 0
1 0 1 0 ×
+ 0 1 0 × ×
1
1 1 1 1 0 0
- 1 0 1 1
1 1 0 0 0 1

(1010)2 × (110)2 – (1011)2 = (110001)2

d. (10110)2 ¸ (101)2
101) 1 0 1 1 0 (100
- 0 1
1
0 0 0 1 0
-
0
1 0

Quotient=100
Remainder=10

9. a. Write a program in QBASIC that asks length, breadth and height of room and calculate its
area and volume. Create a user defined function to calculate area and sub-program to calculate
volume. Hint: [A=L×B], [V=L×B×H]

DECLARE FUNCTION AREA(L,B)


DECLARE SUB VOL(L,B,H)
CLS
INPUT “Enter Length”; L
INPUT “Enter Breadth”; B
INPUT “Enter Height”; H
PRINT “Area of room=”; AREA(L,B)
CALL VOL(L,B,H)
END

FUNCTION AREA(L,B)
AREA = L * B
END FUNCTION

SUB VOL(L,B,H)
V=L*B*H
PRINT “Volume of Room=”; V
END SUB

b. A sequential data file called “Record.txt” has stored data under the field heading Roll No.,
Name, Gender, English, Nepali, Maths and Computer. Write a program to display all the
information of those students whose gender is “F” and obtained marks in computer is more
than 90.

5|P a g e SET SOLUTIONS https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA

OPEN “Record.txt” FOR INPUT AS #1


CLS
WHILE NOT EOF(1)
INPUT #1, R, N$, G$, E, N, M, C
IF UCASE$(G$)=”F” AND C>=90 THEN
PRINT R; N$; G$; E; N; M; C
END IF
WEND
CLOSE #1
END

10. Write a program in C language that asks a number and check whether it is odd or even.

#include<stdio.h>
#include<conio.h>
int main()
{
int n;
printf("Enter any number: ");
scanf("%d", &n);
if(n % 2 = = 0 )
printf("%d is even number", n);
else
printf("%d is odd number", n);
return 0;
}

OR

Write a program in C language to display the series with their sum.1, 2, 3, 4 upto 10th terms.
#include<stdio.h>
#include<conio.h>
int main()
{
int i, s=0;
i=1;
while(i<=5)
{
printf("%d \n", i);
s = s + i;
i++;
}
print("%d \n Sum=", s);
return 0;
}

6|P a g e SET SOLUTIONS https://seeqbasicomputer.blogspot.com/


SEE (Grade Increment) 2080 (2024) [SOLVED] – Solved By: Deepak Shrestha
SEE (Grade Increment) 2080 (2024) [SOLVED]
GI-3031
Opt. II Computer Science

Group 'A'
1. Answer the following questions in one sentence:

a. Give the name of any two unguided transmission media


Ans: Any two unguided transmission media are Microwave and Radio wave.

b. Write any two benefits of e-governance service.


Ans: Any two benefits of e-governance service are:
• Citizens can access government services and information conveniently from anywhere.
• E-governance systems promote transparency by making government actions and decisions visible to the
public.

c. Which type of query do you use to calculate the total marks of students from table in MS Access?
Ans: Select Query is used to calculate the total marks of students from table in MS Access

d. What is the maximum length of the field name in MS-Access?


Ans: The maximum length of the field name in MS-Access is 64 characters.

e. List the different types of procedures in Qbasic.


Ans: The different types of procedures are: Sub Procedure and Function Procedure

f. Which format specifier do you use in C language for 'int' data type ?
Ans: %d format specifier is used in C language for 'int' data type.

2. Write appropriate technical term for the following:


a. Digital trails created while using internet. Digital Footprint
b. Data transmission in only one direction. Simplex Mode

3. Write the full form of the following:


(1) NIC – Network Interface Card
ii) OTP – One Time Password

4. Answer the following questions:

a) Define Bus topology? Write any two advantages of Bus topology


Ans: The type of topology in which all nodes and network devices are connected to single cable is called bus
topology.
Any two advantages of Bus topology are:
 It is cost effective and cable required is least compared to other network topology.
 It is used in small networks and easy to expand networks.

b) What is cyber ethics? Write any two commandments for using computer.
Cyber 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 for using computer are:
❖ Do not use a computer to publish fake information.
❖ Do not search the file or record of other people.

https://seeqbasicomputer.blogspot.com/ https://deepak2081.com.np/
SEE (Grade Increment) 2080 (2024) [SOLVED] – Solved By: Deepak Shrestha

c) What is Backup? How it helps to secure data?


Backup is the system of copying data and programs into another location or creating a duplicate copy of it in
a secured place.
A backup secures data by creating a duplicate copy stored separately from the original, protecting against
data loss due to hardware failure, accidental deletion, cyber threats, and disasters. It ensures data can be
restored if the original is compromised, maintaining data integrity and availability for recovery.

d) Define e-commerce? Write any two names of Nepali e-commerce sites.


E-commerce refers to the buying and selling of goods and services over the internet.
Any two names of Nepali e-commerce sites are daraz and hamrobazar.

e) What is social media? Write any one reason why it is popular now days.
Social media are online platforms like Facebook, Twitter, and Instagram that let users create, share, and
interact with content while connecting with others.
It's popular now a days because it enables instant communication, allowing people to connect and share
information globally in real-time.

f) Define DBMS with any two examples of it.


DBMS is a computerized system that stores data, processes them and provides information in an organized
form.
Any two examples of DBMS are : MS-Access and Oracle

g) What is primary key? List any two advantages of it.


A key is a field or combination of fields that uniquely identifies each record in a table.
Any two advantages of it are:
It sets the relationship between tables.
It reduces and controls duplication of record in a table.

h) What is query? List two types of it.


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 types of query are: Select Query and Action Query (Update query, Delete query, Append query and
Make Table query)

i) Define report and mention any two uses of it.


Report is one of the MS-Access database objects used to present information in an effective and organized
format that is ready for printing.
Any two uses of report are:
• Reports provide a formatted presentation of data that is easy to read and understand.
• Reports enable users to summarize, analyze, and visualize data in meaningful ways.

5. Write down the output of the given program and show them in dry run table.
DECLARE FUNCTION Series (N)
CLS
A=2
PRINT "Sum of the series"; Series (A)
END

FUNCTION Series (N)


Sum=0
https://seeqbasicomputer.blogspot.com/ https://deepak2081.com.np/
SEE (Grade Increment) 2080 (2024) [SOLVED] – Solved By: Deepak Shrestha
FOR J = 1 TO 4
Sum=Sum + N
N=N+3
NEXT J
Series= Sum
END FUNCTION
Dry Run
A PRINT "Sum of N Sum FOR J = 1 TO 4 Sum=Sum + N-N+3 Series =
the series"; N Sum
Series (A)
2 Sum of the series 2 0 1 TO 4 Yes 0+2=2 2+3=5
26
5 2 2 TO 4 Yes 2+5=7 5+3=8
8 7 3 TO 4 Yes 7+8=15 8+3=11
11 15 4 To 4 Yes 15+11=26 11+3-=14
14 26 5 To 4 No 26
Loop Exits

The output of the program is:


Sum of the series 26

6. Re-Write the given program after correcting the bags:


REM to display name, post and salary of 10 employees
OPEN "EMP.TXT" FOR IN AS #1
FOR I=10 TO 1
INPUT #1, Name$, Post$, Salary
DISPLAY Name$, Post$, Salary
NEXT I
CLOSE “EMP.TXT”
END

Corrected Program:
REM to display name, post and salary of 10 employees
OPEN "EMP.TXT" FOR INPUT AS #1
FOR I=1 TO 1 0
INPUT #1, Name$, Post$, Salary
PRINT Name$, Post$, Salary
NEXT I
CLOSE #1
END

7. Study the following program and answer the given questions:


DECLARE SUB SEE (A$)
A$="COMPUTER SCIENCE”
END

SUB SEE (A$)


L=LEN(A$)
FOR I=L TO 1 STEP-2
PRINT MID$ (A$, I, 1)
NEXT I
END SUB
a) Which statement should be added in the main module to execute the program?
https://seeqbasicomputer.blogspot.com/ https://deepak2081.com.np/
SEE (Grade Increment) 2080 (2024) [SOLVED] – Solved By: Deepak Shrestha
Ans: CALL SEE(A$) should be added in the main module to execute the program
b) List out the variables used in the above program.
Ans: The variables used in the above program are: A$, L and I .
7. Convert/Calculate as per the instruction:
i) (10011011)2 = (?)8

Convert every 3 binary digits (from bit0) to octal digit (see conversion table below):
10011011
010 = 2
011 = 3
011 = 3
=233
= (10011011)2 = (233)8

ii) (99)10 = (?)16

Divide by the base 16 to get the digits from the remainders:


Division Quotient Remainder
by 16 (Digit)
(99)/16 6 3
(6)/16 0 6
= (63)16
(99)10 = (63)16

iii) (10110) 2 x (101)2 = (?)2

1 0 1 1 0
x 1 0 1
1 0 1 1 0
0 0 0 0 0 x
1 0 1 1 0 x x
1 1 0 1 1 1 0

10110 × 101 = 1101110

iv) (101101)2 / (11) 2

11) 1 0 1 1 0 1 (1111
- 1 1
1 0 1
1 1
1 0 0
1 1
1 1
1 1
0 0

Q = 1111
R=0

https://seeqbasicomputer.blogspot.com/ https://deepak2081.com.np/
SEE (Grade Increment) 2080 (2024) [SOLVED] – Solved By: Deepak Shrestha

9. a) Write a program in QBASIC that asks radius and height of a cylinder Create a User Defined
Function to calculate total surface area and a Sub Program to calculate the volume of a cylinder.
[Hint: TSA=2r (r+h) and Volume r2h]

DECLARE FUNCTION AREA(R, H)


DECLARE SUB VOL(R,H)
Cls
INPUT "Enter radius"; R
INPUT "Enter height"; H
PRINT AREA(R, H)
Call VOL(R, H)
END

FUNCTION AREA (R, H)


AREA = 2 * 3.14 * R * (R + H)
END FUNCTION
SUB VOL (R, H)
V = 3.14 * R ^ 2 * H
PRINT "Volume of cylinder"; V
END SUB

b) Write a program to create a sequential data file "student.dat" to store 10 students name and obtain
marks in four different subjects.

OPEN "student.dat" FOR OUTPUT AS #1


FOR I = 1 TO 10
INPUT "Enter Name"; N$
INPUT “Enter Marks in English”; E
INPUT “Enter Marks in Nepali”; NE
INPUT “Enter Marks in Maths”; M
INPUT “Enter Marks in Science”; S
WRITE #1, N$, E, NE, M, S
NEXT I
CLOSE #1
END

10. Write a program in C language that asks for an integer value and checks whether it is divisible by
7 or not.
#include<stdio.h>
#include<conio.h>
int main()
{
int n;
printf("Enter any number: ");
scanf("%d", &n);
if(n%7==0)
printf("%d is divisible by 7",n);
else
printf("%d is not divisible by 7",n);
return 0;
https://seeqbasicomputer.blogspot.com/ https://deepak2081.com.np/
SEE (Grade Increment) 2080 (2024) [SOLVED] – Solved By: Deepak Shrestha
}

OR

Write a program in C language to display the series with their sum 1, 4, 9, 16.... up to 10th term.
#include <stdio.h>
int main( )
{
int i, t, s = 0;
printf("Series: ");
for (i = 1; i <= 10; i++)
{
t = i * i;
printf("%d ", t);
s += t;
}
printf("\nSum of the series: %d\n", s);
return 0;
}

***

https://seeqbasicomputer.blogspot.com/ https://deepak2081.com.np/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA

COMPUTER SCIENCE SEE 2080 (2024)


RE-3031
Group 'A'
1. Answer the following questions in one sentence:

a) What is unguided media?


Unguided media is a communication channel in which data and information are transferred through the air
using electromagnetic waves, such as radio waves or microwaves without using wire or cable.

b) What is the business done through the mobile?


The business done through the mobile is M-Commerce

c) Which data type is used to store date of birth in MS-Access?


Date/Time is the data type is used to store date of birth in MS-Access

d) Write any two elements of database.


Field and Record are the two elements of database

e) What is modular programming?


Modular programming is a technique used to divide program into many small logical, manageable and
functional modules or blocks

f) Write any two features of C- language.


• Portability: C code can be compiled and executed on different systems with minimal modifications.
• C is a case-sensitive programming language. It understands the capital alphabets and small alphabets
as different values.

2. Write appropriate technical term for the following:

a) A secret group of characters used to protect computer system from unauthorized users. Password
b) An artificial environment created by a computer system that appears real. Virtual reality

3. Write the full form of the following


a) URL – Uniform Resource Locator
b) STP – Shielded Twisted Pair Cable

4. Answer the following questions:

a) Define network topology. Sketch a drawing of star topology.


Network topology refers to the layout or inter - connected pattern of computers and devices in a network.

1|P a g e CS SEE 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
b) Write any four commandments of computer ethics.
· Do not use a computer to publish fake information.
· Do not search the file or record of other people.
· Do not destroy or delete the records of other people.
· Do not use a computer to steal someone's privacy.

c) What are the computer security threats? Mention any two measures to protect from security
threats.
Computer security threat is a risk which can potentially harm computer systems and organization.
Any two measures to protect from security threats are: Firewall and Cryptography

d) What is E-commerce? List any two E-commerce companies in Nepal.


E-commerce refers to buying and selling of goods, products or services through Internet.
Any two E-commerce companies in Nepal are sastodeal and daraz

e) Define Artificial Intelligence with examples.


Artificial Intelligence (AI) refers to the simulation of human intelligence in machines that are programmed
to think and learn like humans.
Examples are self driving cars, speech recognition (Siri) , face recognition etc.

f) List any four features of MS-Access.


• It provides the flexible ways to add, edit, delete and display the related data.
• Queries help to view, change and analyse the data indifferent ways.
• Forms are used for viewing and editing the information.
• Reports are used for summarizing and printing the data.

g) What is Primary Key? Give any two benefits of it.


A primary key is a unique field in a database table that identifies each record uniquely.
Any two benefits of primary key are:
• It sets the relationship between tables.
• It reduces and controls duplication of record in a table

h) Give the differences between the Select Query and Action Query.

Select Query Action Query


Select query is simply used to select and display An action query is a query that makes changes to or
the relevant data from the database. removes many records in just one operation.
It does not make change to database. It makes change to database.

i) Identify a record and field from the following table structure:


Symbol No. Name Marks
00100202S Aarambha Shrestha 91
00100203T Suhisha Rayamajhi 99

Field = Symbol No. , Name and Marks


Record 1 = 001002020S, Aarambha Shrestha, 91
Record 2 = 00100203T, Suhisha Rayamajhi, 99

2|P a g e CS SEE 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
5. Write down the output of the given program and show them in dry run table:
DECLARE FUNCTION SQN (N)
CLS
S=0
FOR L=1 TO 3
READ NUM
S=S+SQN (NUM)
NEXT L
PRINT "Sum of square"; S
DATA 1, 4, 5
END
FUNCTION SQN (N)
SQN = N^2
END FUNCTION
Dry Run
S L=1 TO 3 Read S=S+SQN(NUM) SQN=N^2
Num
0 1 TO 3 yes 1 0+1=1 1^2=1
17 2 TO 3 yes 4 1+16=17 4^2=16
42 3 TO 3 yes 5 17+25=42 5^2=25
4 TO 3 No
Loop Exits
The output of the program is :
Sum of square 42

6. Re-Write the given program after correcting the bugs:


DECLARE SUB Square (A)
REM to print square of a input number
CLS
GET "Enter a number"; N
Square (N)
END
SUB Square (A)
Sq = A^ 4
Display "Square of a number is "; Sq
End Sub

Debugged Program
DECLARE SUB Square (A)
REM to print square of a input number
CLS
INPUT "Enter a number"; N
CALL Square (N)
END

SUB Square (A)


Sq = A^ 2
PRINT "Square of a number is "; Sq
End SUB

3|P a g e CS SEE 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
7. Study the following program and answer the given questions:
DECLARE FUNCTION Count (W$)
INPUT "Enter a word"; R$
C = Count (R$)
PRINT C
END
FUNCTION Count (W$)
FOR L = 1 TO LEN (W$)
Ch$MID$ (W$, L, 1)
IF UCASES (Ch$) = "K" THEN
N=N+1
END IF
NEXT L
Count = N
END FUNCTION
a) List any two library functions used in the above program.
UCASE$( ) and MID$( ) are the two library functions used in the above program

b) Write the use of variable 'C' in line 3 [i.e. C = Count (R$)] given in the above program.
The use of variable ‘C’ in line 3 [i.e. C = Count (R$)] given in the above program is to store the value
returned by the function count( ).
Group 'C'
8. Convert/Calculate as per the instruction:
a) (ABC)16 = (?)8
Convert each hex digit to 4 binary digits
ABC
=ABC
A = 1010
B = 1011
C = 1100
= 101010111100
Convert every 3 binary digits (from bit0) to octal digit
101010111100
= 101 010 111 100
101 = 5
010 = 2
111 = 7
100 = 4
= 5274
(ABC)16 = (5274)8

b) (435)10 = (?)2
Division by 2 Quotient Remainder(Digit)
(435)/2 217 1
(217)/2 108 1
(108)/2 54 0
(54)/2 27 0
(27)/2 13 1
(13)/2 6 1
(6)/2 3 0
(3)/2 1 1
(1)/2 0 1
= (110110011)2
(435)10 = (110110011)2
4|P a g e CS SEE 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
iii) (101)2x (101)2=(?)2

1 0 1
X 1 0 1
1 0 1
0 0 0 X
+ 1 0 1 X X
1 1 0 0 1

(101)2x (101)2=(11001)2

iv) (101101) /¸(101)

101) 1 0 1 1 0 1 (1001
- 1 0 1
0 0 0 1 0 1
- 1 0 1
0 0 0

Quotient = 1001
Remainder = 0

9a) Write a program in QBASIC that asks length, breadth and height of room and calculate its area
and volume. Create a User Defined Function to calculate Area and Sub Program to calculate the
Volume.
[Hint: Area LxB and Volume = LxBxH]

DECLARE FUNCTION AREA(L,B)


DECLARE SUB VOL(L,B,H)
CLS
INPUT “Enter Length”; L
INPUT “Enter Breadth”; B
INPUT “Enter Height”; H
PRINT “Area of room=”; AREA(L,B)
CALL VOL(L,B,H)
END

FUNCTION AREA(L,B)
AREA = L * B
END FUNCTION

SUB VOL(L,B,H)
V=L*B*H
PRINT “Volume of Room=”; V
END SUB

5|P a g e CS SEE 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
b) Employee's name, address, gender and salary are stored in the "EMP.DAT" sequential data file.
Write a QBASIC program that displays all information about personnel whose salaries exceed 60000.

OPEN "EMP.DAT" FOR INPUT AS #1


CLS
WHILE NOT EOF (1)
INPUT #1, N$, A$, G$, S
IF S > 60000 THEN PRINT N$, A$, G$, S
WEND
CLOSE #1
END

10. Write a program in 'C' language to find simple interest where user need to input Principle, Rate
and Time.

#include<stdio.h>
#include<conio.h>
int main()
{
float p, t, r, i;
printf("Enter principal: ");
scanf("%f", &p);
printf("Enter time: ");
scanf("%f", &t);
printf("Enter rate: ");
scanf("%f", &r);
i = (p*t*r)/100;
printf("Simple Interest = %.2f", i);
return 0;
}
अथवा (Or)

Write a program in 'C' language to display the series with their sum. 1,2,3,4, up to 10th term.

#include <stdio.h>
int main()
{
int i,s=0;
for(i=1;i<=10;i++)
{
printf("%d ",i);
s=s+i;
}
printf("\n Sum =%d",s);
return 0;
}

6|P a g e CS SEE 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
SEE COMPUTER SCIENCE 2079

1. Answer the following questions in one sentence.

a) What is network protocol?


Ans: A set of rules followed for interconnection and communication between computers in a network is
called network protocol.

b) What is Ecommerce?
Ans: E-commerce refers to the buying and selling of goods and services over the internet.

c) What is the default size of text field in MS-Access?


Ans: The default size of a text field is 50 characters (2003 version) and 255 characters (2007 version) in
MS-Access.

d) Which data type is used to store photo in MS-Access?


Ans: The data type used to store photos is called an OLE Object.

e) What is looping?
Ans: Looping is the process of repeating the execution of a statement or a block of statements until a
specific condition is satisfied.

f) List any two data types used in C-programming language.


Ans: Any two data types used in C-programming language are char and int.

2. Write appropriate technical term for the following:


a) A program that can disinfect a file from virus. Antivirus software
b) Learning through the electronic media. E-Learning

3. Write the full form of the following:


a) G2G – Government to Government
b) ISP – Internet Service Provider

4. Answer the following questions:

a) What is network topology? List any two types of network topology.


Ans: Network topology refers to the layout or inter - connected pattern of computers and devices in a
network. Two types are star topology and bus topology.

b) What is antivirus software? Name any two popular antivirus software.


Ans: Antivirus software is a program that scans, detects, and removes malicious software from a
computer or device to protect it from security threats.
Any two popular antivirus software are Kaspersky and Norton Antivirus.

c) Define cyber law and cyber crime.


Ans 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.
Cyber crime refers to criminal activities that are carried out using computers or the internet.

d) Define virtual reality. Write any two areas where virtual reality is used.

1|P a g e CS SEE 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
Virtual Reality (VR) is a technology that creates a simulated (virtual) world where users can feel and
interact with things as if they are real, using devices like VR headsets and gloves.
Any two areas where virtual reality is used are : Gaming and Education & Training (medical or flight
training).

e) What is password? Write any two importance of password protection.


Ans: A password is a secret word or phrase used to secure access to accounts or systems, ensuring only
authorized users can enter.
Any two importance of password protection are:
1. Password secures the data by protecting from unauthorized access.
2. It safeguards personal information from being stolen or misused.

f) What is DBMS? Write four objects of MS-Access.


Ans: DBMS is a computerized system that stores data, processes them and provides information in an
organized form.
Any four objects of MS-Access are Table, Form, Query and Report.

g) What are validation text and validation rule?


Ans: Validation Text is a field property which displays an error message that appears if the data entered
is invalid according to the specified validation rule.
Validation Rule is a field property which is used to limit the values that can be entered into a field.

h) What is form? Write any two advantages of it.


Ans: Form is one of the MS-Access database objects which provides graphical interface to view, modify
and add data in a table or multiple linked tables.
Any two advantages of form are:
1. Form displays complete record one at a time, so we can view and modify records using the form.
2. Forms provides GUI (Graphical Users Interface) using which users interact with MS-Access database.

i) What is record? Why is primary key necessary in record?


Ans: 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.

5. Write down the output of the given program:


DECLARE SUB Series(A)
CLS
A=20
CALL Series(A)
END
SUB Series(A)
FOR K=1 to 5
PRINT A;
A=A+10
NEXT K
END SUB

Dry Run Table


A K=1 to 5 PRINT A; A=A+10

2|P a g e CS SEE 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
20 1 to 5 yes 20 20+10=30

30 2 to 5 yes 30 30+10=40

40 3 to 5 yes 40 40+10=50

50 4 to 5 yes 50 50+10=60

60 5 to 5 yes 60 60+10=70

70 6 to 5 no
Loop exits

The output of the program is:


20 30 40 50 60

6. Re-Write the given program after correcting the bugs:


REM program to make a word reverse
DECLARE FUNCTION Rev$(N$)
CLS
LNPUT “Enter a word”; N$
DISPLAY “Reversed is”; Rev$(N$)
END
EUNCTION Rev$(N$)
FOR K=LEN$(N$) To 1 STEP-1
B$=B$+MID$(N$,1,K)
NEXT K
B$=Rev$
END FUNCTION

Debugged Program
REM program to make a word reverse
DECLARE FUNCTION Rev$(N$)
CLS
INPUT “Enter a word”; N$
PRINT “Reversed is”; Rev$(N$)
END
FUNCTION Rev$(N$)
FOR K=LEN (N$) To 1 STEP-1
B$=B$+MID$(N$,K,1)
NEXT K
Rev$=B$
END FUNCTION

7. Study the following program and answer the given questions:

3|P a g e CS SEE 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
DECLARE FUNCTION SUM(N)
CLS
INPUT “Enter any number”; N
X=SUM(N)
PRINT “The sum of individual digit is “; X
END
FUNCTION SUM(N)
WHILE N<>0
R=N MOD 10
S=S+R
N=INT(N/10)
WEND
SUM=S
END FUNCTION

a) Write the function of INT.


Ans: The INT function returns the integer part of a number, removing the decimal part.
b) How many times does the WHILE ….WEND loop repeat if the value of N is 123?
Ans: The WHILE ….WEND loop repeats 3 times if the value of N is 123.

8. Convert/Calculate as per the instruction:


a) (10110011)2 – (?)16
Soln:
Paired Binary Digit 1011 0011
Binary Equivalent value B 3
(10110011)2 = (B3)16

c) (1001 + 110)2 – (1000)2


1 0 0 1
+ 1 1 0
1 1 1 1
- 1 0 0 0
0 1 1 1
(1001 + 110)2 – (1000)2 = (0111)2

b) (410)10 = (?)2
2 410 Remainder
2 205 0
2 102 1
2 51 0
2 25 1
2 12 1
2 6 0
2 3 0
2 1 1
2 0 1
(410)10 = (110011010)2
d) (10110)2  (101)2
4|P a g e CS SEE 2079 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA

iv) (10110) 2 ¸ (101) 2


101) 10110( 100
-101
00010
-0
10

Quotient = 100
Remainder = 10

9. a) Write a program in QBASIC that asks radius of a circle to calculate its area and circumference.
Create a user defined function to calculate area and sub program to calculate circumference.
[Hint A= r2, C= 2r]

DECLARE FUNCTION AREA (R)


DECLARE SUB CIR (R)
CLS
INPUT “ENTER RADIUS”; R
PRINT “AREA OF SQUARE ”; AREA(R)
CALL CIR (R)
END

FUNCTION AREA (R)


AREA = 3.14 * R ^ 2
END FUNCTION

SUB CIR (R)


C = 2 * 3.14 * R
PRINT “CIRCUMFERENCE OF CIRCLE”; C
END SUB

b) A sequential data file called “Record.dat” has stored data under the field headings: Roll No., Name,
Gender, English, Nepali, Maths and Computer. Write a program to display all the information of
those students whose marks in English is more than 40.

OPEN "Record.dat" FOR INPUT AS #1


CLS
WHILE NOT EOF (1)
INPUT #1, R, N$, G$, E, NP, M, C
IF E > 40 THEN PRINT R, N$, G$, E, NP, M, C
WEND
CLOSE #1
END

5|P a g e CS SEE 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
10. Write a program in C language that asks any two numbers and displays the greatest among them.

#include<stdio.h>
#include<conio.h>
int main( )
{
int a,b;
printf("Enter any two numbers:\n ");
scanf("%d %d", &a, &b);
if(a>b)
printf("The greatest number is %d", a);
else
printf("The greatest number is %d", b);
return 0;
}

OR

Write a program in C-Langauge to display the series with their sum. 1,2,3,4….upto 10th terms.

#include <stdio.h>
int main()
{
int j, sum = 0;
printf("The first 10 natural number is :\n");
for (j = 1; j <= 10; j++)
{
sum = sum + j;
printf("%d ",j);
}
printf("\nThe Sum is : %d\n", sum);
}

***

6|P a g e CS SEE 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA

SEE (Grade Promotion) 2079 (2023)


ऐच्छिक द्वितीय कम्प्युटर द्विज्ञान
समय: १ घण्टा ३० द्वमनेट
पूर्ााङ्क : ५०

द्विइएका द्वनिे शनका आधारमा आफ्नै शैलीमा द्वसर्ानात्मक उत्तर द्विनुहोस् :


समूह 'क' (Group 'A')
१. तलका प्रश्नहरूको एक िाक्यमा उत्तर द्विनुहोस् :
Answer the following questions in one sentence: (६×१=६)
(क) िेब ब्राउर्र भनेको के हो ?
What is web browser?
Ans: Web browser is a computer program that access web pages and displays them on the user’s computer.

(ख) इन्टरनेटिारा प्रिान गररने कुनै िु ई सेिाहरू उल्लेख गनुाहोस् ।


Mention any two services provided by Internet.
Ans: Any two services provided by Internet are E-Commerce and E-Mail

(ग) एम्. एस्. एक्सेस को द्विल्डनेमको अद्वधकतम साइर् कद्वत हो ?


What is the maximum length of field name in MS-Access?
Ans: The maximum length of field name in MS-Access is 64 characters.

(घ) एम एस् एक्सेसको लद्वर्कल डे टा कुन हो?


Which in the logical data type of MS-Access?
Ans: The logical data type of MS-Access is Yes/No.

(ङ) मोड्युलर प्रोग्राद्वमङ्को कुनै एक िाइिा लेख्नुहोस् ।


Write any one advantage of Modular Programming.
Ans: Any one advantage of Modular Programming is it is easy to design, code and test the program modules
independently.

(च) C प्रोग्राद्वमङ भाषाको कुनै िु ई आधारभूत डाटा प्रकारहरू उल्लेख गनुाहोस् ।


Mention any two basic data types of C language.
Ans: Any two basic data types of C language are char and int

उपयुक्त प्राद्विद्वधक शब्द लेख्नुहोस् : Write appropriate technical term for the following: (२×१=२)

(क) सञ्जालहरूको सञ्जाल


Network of networks . Internet
(ख) कम्प्युटर प्रोग्राम र्सले कम्प्युटर भाइरसबाट कम्प्युटरलाई बचाउँ छ ।
Computer program that protects computer from computer virus. Antivirus Software

पूरा रूप लेख्नुहोस् :


Write the full form of the following. (२×१=२)
(क) POP – Post Office Protocol
(ख) IoT – Internet of Things

1|P a g e CS SEE GP 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
समूह 'ख' (Group 'B')

४. तलका प्रश्नहरूको उत्तर द्विनुहोस् : Answer the following questions: (९×२=१८)

(क) कम्प्युटर नेटिाक भनेको के हो ? यसका कुनै िु ईओटा महत्त्वहरू सूचीकृत गनुाहोस् ।
What is computer network? List any two importance of it.
Ans: Computer network is a group of two or more computers and devices connected to each other through
wired or wireless media to exchange data and information and share hardware, software and other resources.
Any two importance of computer network are:
• A network connected computers can share hardware devices such as scanner, printer, hard disk, etc.
• It also provides the facility of data and software backup system.

(ख) कम्प्युटर नैद्वतकता भनेको के हो ? यसका कुनै िु ई नीद्वतहरू लेख्नुहोस् ।


What is computer ethics? Write down any two ethics of it.
Ans: Computer ethics can be defined as to follow the rules and regulation of computer technology and not to
harm other computer users knowingly or unknowingly.

Any two computer ethics are:


a) We should not use a computer to harm other people.
b) We should not spread false and illegal information.

(ग) कम्प्युटरको सुरक्षा भन्नाले के बुद्विन्छ लेख्नुहोस् । ? हाडा िेयर


What is computer security? Write any two hardware security measures.
Ans: Computer security refers to the protection of computer systems and data from unauthorized access,
theft or misuse and damage and action to prevent such incidents.
Any two hardware security measures are Insurance and Power Protection Device.

(घ) E-commerce र Traditional Commerce द्वबच िु ई द्वभन्नता द्विनुहोस् ।


Give two differences between E-commerce and Traditional Commerce.
Two differences between E-commerce and Traditional Commerce are
Traditional Commerce E-commerce
Traditional commerce is the buying and Ecommerce refers to the buying and selling
selling of goods and services through of goods or services using the internet.
physical stores and in-person transactions,
without using digital technology.
Delivery of goods is instant. Delivery of goods takes time.

(ङ) आद्वटा द्विद्वसयल इन्टे द्वलर्ेन्स (AI) को पररभाषा लेख्नुहोस् । AI को कुनै िु ईओटा प्रयोगहरू लेख्नुहोस् ।
Define artificial intelligence (AI). Write any two uses of AI.
Ans: Artificial Intelligence (AI) refers to the simulation of human intelligence in machines that are
programmed to think and learn like humans.
Any two uses of AI are
· AI can be used to detect fraud in financial transactions, such as credit card fraud.
· AI can be used to diagnose diseases more accurately and efficiently than humans can.

(च) द्वडद्वबएम्एस्लाई कुनै िु ई उिाहरर्सद्वहत पररभाद्वषत गनुाहोस् ।


Define DBMS with any two examples.
Ans: DBMS is a computerized system that stores data, processes them and provides information in an
organized form.
E.g.: MS-Access, Oracle.

2|P a g e CS SEE GP 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA

(छ) एम्. एस्. एक्सेसमा ररपोटा भनेको के हो ? डे टाबेसमा ररपोटा को महत्त्व लेख्नुहोस् ।
What is report in MS-Access? Mention the importance of report in database.
Ans: Report is an object of Ms-Access which displays the output in an effective way to present the data in a
printed format.
Importance of report is to print documents according to user’s specifications of the summarized information
through query or table.

(र्) प्राइमरी द्वक को पररभाषा लेख्नुहोस् । यसको द्विशेषताहरु लेख्नुहोस् ।


Define Primary Key. Write its features.
Ans: A primary key is a unique field in a database table that identifies each record uniquely.
Its features are:
i) To reduce and control duplication of record in a table.
ii) To set the relationship between tables.

(ि) द्वनम्न ताद्वलका संरचनामा प्रयोग भएको field name and records उल्लेख गनुाहोस् : List the field name
and records used in the following table structure.
Symbol_No Name Marks
001009010 Hari Thapa 85
00100901Q Binu Sharma 91
Ans:
Field Names = Symbol_No, Name and Marks
Record 1= 00100900P Hari Thapa 85
Record 2 = 00100901Q Binu Sharma 91

५. तलका प्रोग्रामको आउटपुट लेख्नुहोस् । Dry run table मा िे खाउनुहोस् : २


Write down the output of the given program. Show in dry run table.
DECLARE SUB Result (C$)
C$= “COMPUTER"
CALL Result (C$)
END
SUB Result (C$)
FOR C=1 TO LEN(C$) STEP 2
M$=MIDS (C$,C,1)
N$=N$+MS
NEXT C
PRINT N$
ENF SUB
Dry Run
C$ C=1 To MS=MID$(C$,C,1) N$=N$+M$ PRINT N$
LEN(C$)
STEP 2
COMPUTER 1 to 8 step 2 MID$(COMPUTER,1,1) C
=C
3 to 8 step 2 MID$(COMPUTER,3,1) C+M=CM
=M
5 to 8 MID$(COMPUTER,5,1) CM+U=CMU

3|P a g e CS SEE GP 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
=U
7 to 8 MID$(COMPUTER,7,1) CMU+E=CMUE
=E
9 to 8 CMUE
Loop exits

Output
CMUE
तल द्विइएको प्रोग्राममा रहेका गल्तीहरूलाई सच्याएर पुनः लेख्नुहोस् :
Rewrite the given program after correcting the bugs:
REM to display records from existing file.
OPEN "emp.text" FOR APPEND AS #1
WHILE NOT EOF (#1)
WRITE # 1, eN$, posts, salaryS
PRINT eN$, post$, salary
NEXT
CLOSE #1
END

Debugged Program
REM to display records from existing file.
OPEN "emp.txt" FOR INPUT AS #1
WHILE NOT EOF (1)
INPUT # 1, eN$, posts, salary$
PRINT eN$, post$, salary
WEND
CLOSE #1
END

तल द्विइएको प्रोग्रामलाई अध्ययन गरी द्विइएका प्रश्नहरूको उत्तर द्विनुहोस् : (२×१=२)


Study the following program and answer the given questions.
DECLARE FUNCTION prod (A,B)
CLS
INPUT “Enter first number'; A
INPUT ‘Enter second number"; B
PRINT ‘“The product of the two number="; prod (A,B)
END
FUNCTION prod (A,B)
P=A*B
prod=P
END FUNCTION

(क) माद्विको प्रोग्राममा प्रयोग भएको न्युमेररक भेररएबलहरू लेख्नुहोस् ।


List all the numerical variables used in the program above.
Ans: The numerical variables used in the program above are A, B and P

ख) माद्विको प्रोग्राममा प्रयोग भएको लोकल भेररएिलहरू लेख्नुहोस् ।


List the local variables used in program above.
Ans: The local variables used in the program above is P.

4|P a g e CS SEE GP 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA

समूह 'ग' (Group 'C')


८. द्वनिे शनअनुसार रूपान्तर र द्वहसाब गनुाहोस् :

Convert/Calculate as per the instruction:


i) (214) 10 = (?)2
Divide by the base 2 to get the digits from the remainders:
Division Quotient Remainder
by 2 (Digit)
(214)/2 107 0
(107)/2 53 1
(53)/2 26 1
(26)/2 13 0
(13)/2 6 1
(6)/2 3 0
(3)/2 1 1
(1)/2 0 1
= (11010110)2

(214) 10 = (11010110)2

iii) (1011)2×(101) 2
1 0 1 1
x 1 0 1
1 0 1 1
0 0 0 0 x
1 0 1 1 x x
1 1 0 1 1 1
(1011)2×(101) 2 = (110111)2

ii) (ABC) 16 = (?)2


Convert each hex digit to 4 binary digits (see conversion table below):
ABC
=ABC
A= 1010
B=1011
C=1100
= 101010111100
(ABC) 16 = (101010111100)2

iv) (10101)2 / (11)2

11) 1 0 1 0 1 (111
1 1
1 0 0
1 1
0 0 1 1
1 1
0 0

5|P a g e CS SEE GP 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
Q=111
R=0
९. तलका प्रश्नहरूको उत्तर लेख्नुहोस् :
Answer the following questions: (४x२=८)
(क) कुनै एउटा कक्षाकोठाको लम्बाई र चौडाई द्विएर उक्त कोठाको क्षेत्रिल र पररद्वध पत्ता लगाउने Q-
BASIC प्रोगाम प्रयोग गरर लेख्नुहोस । क्षेत्रिल गर्ना गना user- defined
FUNCTION र पररद्वध गर्ना गना SUB procedure प्रयोग गरर बनाउनुहोस ।
Write a program in Q-BASIC that asks length and breadth of a room and calculate its area and
perimeter. Create a user-defined FUNCTION to calculate area and SUB program to calculate
perimeter. [Hint: A=L×B, P=2(L+B)]

DECLARE FUNCTION AREA(L,B)


DECLARE SUB PER(L,B)
CLS
INPUT “ENTER LENGTH”; L
INPUT “ENTER BREADTH”; B
PRINT “AREA OF A ROOM=”; AREA(L,B)
CALL PER(L,B)
END

FUNCTION AREA(L,B)
AREA=L*B
END FUNCTION

SUB AREA(L,B)
P=2*(L+B)
PRINT “PERIMETER OF RECTANGLE=”; P
END SUB

(ख) “STUDENT.DAT”
file मा द्विद्यािीहरूको नाम, कक्षा, सेक्सन र ठे गाना भण्डारर् गररएको छ । द्विद्यािीहरूको नाम, कक्षा, सेक्स
न र ठे गाना द्वप्रन्ट गने प्रोग्राम लेख्नुहोस् ।
Students' name, class, section and address are stored in a data file called "STUDENT.DAT" Write a
program to print all the records of students.

OPEN “STUDENT.DAT” FOR INPUT AS #1


CLS
WHILE NOT EOF(1)
INPUT #1, N$, C, S$, A$
PRINT N$, C, S$, A$
WEND
CLOSE #1
END

6|P a g e CS SEE GP 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA

१०. C ल्याङ् वेर्को प्रयोग गरे र प्रयोगकतााबाट कुनै िु ईिटा नम्बरहरु मागेर र सो नम्बहरुको
औषत द्वनकाल्ने प्रोग्राम लेख्नुहोस् । Write C program to find average number of any two numbers. (४)

#include <stdio.h>
int main()
{
int num1, num2;
float avg;
printf("Enter first number: ");
scanf("%d",&num1);
printf("Enter second number: ");
scanf("%d",&num2);
avg= (num1+num2)/2;
printf("Average of two number is: %f",avg);
return 0;
}

िा (OR)

C-language को प्रयोग गरी द्विइएको अनुक्रम िे खाउने (२, ४, ६, ८.१० औं पि) प्रोग्राम लेख्नुहोस् ।
Write a program in C-language to display the series 2, 4, 6, 8 up to the 10th term.

#include<stdio.h>
void main( )
{
int i,a=2;
for(i=1;i<=10;i++)
{
printf(“%d”, a);
a=a+2;
}
}

The END

7|P a g e CS SEE GP 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
SEE COMPUTER SCIENCE 2078

1. Answer the following questions in one sentence: 6x1=6

a) Write the name of any two search engines.


Ans: The name of any two search engines is google and bing.

b) What is social media?


Ans: Social media refers to online platforms like Facebook and Instagram that allow people to connect,
share information, and interact with each other.

c) Which data type is suitable to store photographs of students in MS-Access?


Ans: The suitable data type to store photographs of students in MS-Access is OLE object.

d) Which view is used to modify a table structure in MS-Access?


Ans: Design View is used to modify a table structure in MS-Access.

e) Which statement is used to call sub-procedure?


Ans: CALL statement is used to call sub-procedure.

f) Write any two data types used in C language.


Ans: Any two data types used in C language are int and char.

2. Write appropriate technical term for the following. 2x1=2

a) A system of copying data and information reading in computer into another


location. Backup

b) A company which provides services of Internet. Internet Service Provider (ISP)

3. Write the full form of the following. 2x1=2

a) FTP: File Transfer Protocol

b) MAN: Metropolitan Area Network

4. Answer the following questions. 9x2=18

a) What is computer network? Write any two advantages of it.


Ans: Computer network is a group of two or more computers and devices connected to each other through
wired or wireless media to exchange data and information and share hardware, software and other resources.
Any two advantages of computer network are:
1. A network connected computers can share hardware devices such as scanner, printer, hard disk, etc.
2. Networking also provides the facility of data and software backup system.

b) Define software security. Write any two protection measures for it.
Ans: Software security means protecting software from being hacked or misused which ensures the
software works properly and keeps data safe.
Any two protection measures for software security are: Backup and Password

c) What is search engine? Write any two popular search engines.


Ans: A search engine is an online tool that helps users find information on the internet using keywords
or phrases and provide relevant results.
1|P a g e CS SEE 2078 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
The name of any two popular search engines is google and bing.

d) Define e-commerce. Write any two benefits of it.


Ans: E-commerce is the buying and selling of goods and services over the internet.
Any two benefits of e-commerce are:
1. Faster buying/selling procedure, as well as easy to find products.
2. There are no geographical limitations, can deliver service globally.

e) Write any two advantages and disadvantages of social media.


Ans: Any two advantages of social media are:
1. It creates awareness and innovate the way people live.
2. Social media let us share anything with others around the world.
Any two disadvantages of social media are:
1. Personal data and privacy can be easily hacked and shared on the internet.
2. More chances of creating fake accounts.

f) What is DBMS? Write any two advantages of it.


Ans: Database management system (DBMS) is a computerized system that stores data, processes them
and provides information in an organized form.
Any two advantages of DBMS are:
1. It reduces data redundancy which means duplication of data.
2. Large volume of data can be stored and updated easily.

g) What is primary key? Write any two features of it.


Ans: A primary key is a unique field in a database table that identifies each record uniquely.
Any two features of primary key are:
1. To reduce and control duplication of the record in a table.
2. To set the relationship between tables.

h) Define field and record.


Ans: A field is a column in a table which contains information about a certain type for all records. Field
is a smallest unit of information.
A record is a row in a table which contains information about single items in a database. Record is
complete set of information.

i) Define form. Write any two uses of it.


Ans: Form is one of the MS-Access database objects that is primarily used to create an interface for
entering data in a table or multiple linked tables.
Any two uses of form are:
1. Form displays complete record one at a time, so we can view and modify records using the form.
2. Forms provides GUI (Graphical Users Interface) using which users interact with MS-Access
database.

5. Write the output of the given program: (Workout with a dry run). 2
DECLARE SUB ABC(A)
CLS
A=2
CALL ABC(A)
END
SUB ABC(A)
FOR J= 1 TO 5
PRINT A;
A=A+3;
2|P a g e CS SEE 2078 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
NEXT J
END SUB
Dry run
A J=1 TO 5 PRINT A; A=A+3
2 1 to 5 Yes 2 2+3=5
5 2 to 5 Yes 5 5+3=8
8 3 to 5 Yes 8 8+3=11
11 4 to 5 Yes 11 11+3=14
14 5 to 5 Yes 14 14+3=17
17 6 to 5 No (loop
exits)
The output of the program is
2 5 8 11 14

6. Re-write the given program after correcting the bugs: 2


DECLARE SUB Series ( )
CLS
EXECUTE Series
END
SUB Series( )
REM Program to generate 1 1 2 3 5 .....upto the 20th terms
A=1
B=1
FOR ctr=10 to 1
DISPLAY A:B:
A=A+B
B=A+B
NEXT ctr
END Series ( )

Debugged Program
DECLARE SUB Series ( )
CLS
CALL Series
END
SUB Series( )
REM Program to generate 1 1 2 3 5 .....upto the 20th terms
A=1
B=1
FOR ctr=1 TO 10
PRINT A; B;
A=A+B
B=A+B
NEXT ctr
END SUB

7. Study the following program and answer the given questions. 2x1=2
DECLARE FUNCTION TEST(X)
X=100
Z=TEST(X)
PRINT Z
END

3|P a g e CS SEE 2078 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA

FUNCTION TEST(X)
FOR R=1 TO X
S=S+I
NEXT R
TEST=S
END FUNCTION

a) How many parameters are used in the above program?


Ans: One parameters is used in the above program.
b) How many times does the statement S=S+I execute in the above program?
The statement S=S+I will execute 100 times in the above program

8. Convert / Calculate as per the instruction. 4x1=4


i) (11111101)2 = (?)16
Soln:
Paired Binary Digit 1111 1101
Binary Equivalent value F D

(11111101)2 = (FD)16

ii) (245)10 = (?)2


Soln:
2 245 Remainder
2 122 1
2 61 0
2 30 1
2 15 0
2 7 1
2 3 1
2 1 1
0 1

(245)10 = (11110101)2

iv) (101110) 2 ¸ (110) 2


110) 101110( 0111
000
1011
-110
1011
-110
1010
-110
100

Quotient = 111
Remainder = 100
4|P a g e CS SEE 2078 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
iii) (1010) 2 x (101) 2 =(?)2

1 0 1 0
x 1 0 1
1 0 1 0
0 0 0 0 x
1 0 1 0 x x
1 1 0 0 1 0

(1010) 2 x (101) 2 =(110010)2

9 a) Write a program in QBASIC that asks length, breadth of a room and calculate its area and
perimeter. Create a user defined function to calculate area and sub program to calculate perimeter.
[Hint: [Area=LxB], [p=2(L+B]]

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) Write a program to create a sequential data file “salary.dat” to store programmer’s name, salary
and post according to the need of the user.

OPEN “salary.dat” FOR OUTPUT AS #1


DO
CLS
INPUT “Enter name”; N$
INPUT “Enter Salary”; S
INPUT “Enter Post”; P$
WRITE #1, N$, S, P$
INPUT “Do you want to continue(Y/N)”; CH$
LOOP WHILE UCASE$(CH$)=”Y”
CLOSE #1
END

5|P a g e CS SEE 2078 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
10. Write a C program that asks a number and check whether it is negative, positive or zero.

#include<stdio.h>
#include<conio.h>
int main()
{
int n;
printf("Enter any number: ");
scanf("%d", &n);
if(n>0)
printf("%d is positive number",n);
else if(n<0)
printf("%d is negative number",n);
else
printf("%d is zero number",n);
return 0;
}
OR

Write a program in C language to display first 10 odd numbers.


#include<stdio.h>
#include<conio.h>
int main()
{
int i, a;
i=1;
a=1;
while(i<=10)
{
printf("%d \n", a);
a=a+2;
i++;
}
return 0;
}

***

6|P a g e CS SEE 2078 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
SEE Grade Promotion 2078 (2022) Solved Computer Science
Group ‘A’
1. Answer the following questions in one sentence: 6x1=6

a) What is web browser?


Ans: Web browser is a computer program that access web pages and displays them on the user’s
computer.

b) Mention any two services provided by internet.


Ans: Any two services provided by internet are Search engine and E-mail.

c) What is the default extension of MS-Access?


Ans: The default extension of Ms-Access is :
.mdb (2003 version) and .accdb (2007 version).

d) Which object of MS-Access is used to retrieve data from the table?


Ans: Query is used to retrieve data from a table.

e) Write any one advantage of Modular Programming.


Ans: Any one advantage of modular programming is:
The debugging of the program becomes easier and faster.

f) Mention any two basic data type of C language?


Ans: Any two basic data types of C language are: int and char.

2. Write appropriate technical term for the following:


a) Network of Networks. Internet
b) Computer program that protects computer from computer virus. Antivirus software

3. Write the full form of the following:

a) POP: Post Office Protocol


b) AI: Artificial Intelligence

Group B (24 Marks)


4. Answer the following questions. 9x2=18

a) What is computer network? List any two importance of it.


Ans: Computer network is a group of two or more computers and devices connected to each other
through wired or wireless media to exchange data and information and share hardware, software and
other resources.
Any two importance of computer network are:
1. A network connected computers can share hardware devices such as scanner, printer, hard disk, etc.
2. Networking also provides the facility of data and software backup system.

b) What is computer ethics? Write down any two ethics of it.


Ans: 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 computer ethics are:
• Do not use a computer to publish fake information.
• Do not search the file or record of other people.

1|P a g e CS SEEGP A 2078 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
c) What is computer security? Write any two hardware security measures.
Ans: Computer security refers to the protection of computer systems and data from unauthorized
access, theft or misuse and damage and action to prevent such incidents.
The name of any two hardware security measures are:
Regular Maintenance
Power Protection device (Volt guard, Spike guard, UPS)

d) Give two differences between E-Commerce and Traditional Commerce.


Ans: Any two differences between E-Commerce and Traditional Commerce are:
E-Commerce Traditional Commerce
Traditional commerce is the buying and Ecommerce refers to the buying and
selling of goods and services through selling of goods or services using the
physical stores and in-person transactions, internet.
without using digital technology.
Delivery of goods is instant. Delivery of goods takes time.

e) Write ant two symptoms of computer virus.


Ans: Any symptoms of computer virus are:
· Program takes long time to load.
· Increased use of disk space and growth in file size.

f) What is DBMS? Write any two examples.


Ans: DBMS is a computerized system that stores data, processes them and provides information in
an organized form
Any two examples of DBMS are MS-Access and Oracle.

g) What is primary key? List any two advantages of it.


Ans: A primary key is a unique field in a database table that identifies each record uniquely.
Any two advantages of primary key are:
1. To reduce and control duplication of the record in a table.
2. To set the relationship between tables.

h) What is data sorting? List any two advantages of using it.


Ans: 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.
Any two advantages of using it are:
1. Sorting helps to organize data and make it easier to find and retrieve specific information.
2. Sorting can save time and improve efficiency by allowing users to quickly access the data they
need.

i) List the field name from the following table structure.


Symbol No. Name Marks
00100200Q Surya Gurung 85
00100201R Birendra Sharma 91

Ans: The field names are Symbol No., Name and Marks.

2|P a g e CS SEEGP A 2078 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA

5. Write down the output of the given program. Show with dry run in table. 2
DECLARE SUB Result(C$)
C$=”COMPUTER”
CALL Result(C$)
END
SUB Result(C$)
FOR C=1 TO LEN(C$) STEP 2
M$=MID$(C$,C,1)
N$=N$+M$
NEXT C
PRINT N$
END SUB
Dry run
C$ C=1TO 8 M$= MID$(C$,C,1) N$ =N$+M$ PRINT
step 2 Yes N$
COMPUTER C C CMUE
3 to 8 Yes M CM
5 to 8 Yes U CMU
7 to 8 Yes E CMUE
9 to 8 No
Loop Exits

The output of the program is


CMUE

6. Re-write the given program after correcting the bugs: 2


REM to display records from existing file.
CLS
OPEN “emp.txt” FOR APPEND AS #1
WHILE NOT EOF(#1)
WRITE #1, eN$, post$, salary
PRINT eN$, post$, salary
CLOSE#1
END

Debugged Program
REM to display records from existing file.
CLS
OPEN “emp.txt” FOR INPUT AS #1
WHILE NOT EOF(1)
INPUT #1, eN$, post$, salary
PRINT eN$, post$, salary
WEND
CLOSE #1
END

3|P a g e CS SEEGP A 2078 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA

7. Study the following program and answer the given questions. 2x1=2
DECLARE FUNCTION Prod(A,B)
CLS
INPUT “Enter first number”; A
INPUT “Enter second number”; B
PRINT “The product of the two number=”; prod(A,B)
END
FUNCTION Prod(A,B)
P=A*B
Prod=P
END FUNCTION

a) List all the numerical variables used in the program.


Ans: The numerical variables used in the program are A, B and P

b) List the local variable/s used in the above program.


The local variable/s used in the program are P.

8. Convert / Calculate as per the instruction. 4x1=4


i) (214)10 = (?)2
Soln:
2 214 Remainder
2 107 0
2 53 1
2 26 1
2 13 0
2 6 1
2 3 0
2 1 1
1 0 1
(214)10 = (11010110)2

i) (ABC)16 = (?)2
Soln:
Hexadecimal digit A B C
Binary Equivalent 1010 1011 1100
value
(ABC)16 = (101010111100)2

iii) (1011) 2 × (101) 2 + (101) 2 =(?)2


1 0 1 1
x 1 0 1
1 0 1 1
0 0 0 0 x
1 0 1 1 x x
1 1 0 1 1 1

4|P a g e CS SEEGP A 2078 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
Now,
110111
+ 101
111100
(1011) 2 × (101) 2 + (101) 2 =(?)2 =(111100)2

iv) (101110) 2 ¸ (110) 2


11) 10101 111

-11
100
- 11
11
-11
00

Quotient = 111
Remainder = 00

9 a) Write a program to calculate Area of circle using Function procedure and use SUB procedure
to calculate its circumference in Q-Basic. [Hint: [A=r2], [C=2r]

DECLARE FUNCTION AREA (R)


DECLARE SUB CIR(R)
CLS
INPUT “Enter Radius”; R
PRINT “Area of circle=”; AREA(R)
CALL CIR(R)
END

FUNCTION AREA(R)
AREA = 22/7*R^2
END FUNCTION

SUB CIR(R)
C=2*22/7*R
PRINT “Circumference of circle=”; C
END SUB

b) Students Name, Class, Section and Address are stored in a data file called “STUDENT.dat”.
Write a program to print all the records of students.
OPEN “student.dat” FOR INPUT AS #1
CLS
PRINT “Name”, “Class”, “Section”, “Address”
WHILE NOT EOF(1)
INPUT #1, N$, C, S$, A$
PRINT N$, C, S$, A$
WEND
CLOSE #1
END

5|P a g e CS SEEGP A 2078 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA

10. Write a program in C language to input a number then check whether the number is fully
divisible by 5 or not.
#include<stdio.h>
#include<conio.h>
int main()
{
int n;
printf("Enter any number: ");
scanf("%d", &n);
if(n%5= =0)
printf("%d is fully divisible by 5",n);
else
printf("%d is not fully divisible by 5",n);
return 0;
}
OR
Write a program in C language to display the series 2, 4, 6, 8 up to 10th terms.
#include<stdio.h>
#include<conio.h>
int main()
{
int i, a;
i=1;
a=2;
while(i<=10)
{
printf("%d \n", a);
a=a+2;
i++;
}
return 0;
}

***

6|P a g e CS SEEGP A 2078 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
SEE (Grade Promotion) 2078 – 2022
Opt II Computer Science

Group A

1. Answer the following questions in one sentence:

a) What is search engine?


Ans: A search engine is an online tool that helps users find information on the internet using
keywords or phrases and provide relevant results.

b) What is the business done through the internet called?


The business done through the internet is called e-commerce.

c) What is the default size of text field in MS-Access?


Ans: The default extension of Ms-Access is :
.mdb (2003 version) and .accdb(2007 version).

d) Which data type is used to store photo in MS-Access?


Ans: The suitable data type to store photographs of students in MS-Access is OLE object.

e) What is looping?
Ans: Looping is the process of repeating the execution of a statement or a block of statements until a
specific condition is satisfied.

f) List any two data types used in C-Programming language.


Any two data types used in C-Programming language are int and char.

2. Write appropriate technical term for the following:


a) A program that can disinfect a file from virus. Antivirus software
b) Learning through the electronic media. E-learning

3. Write the full form of the following.


a) G2G – Government to Government
b) ISP – Internet Service Provider

4. Answer to the following questions:


a) What is network topology? List any two types of network topology.
Network topology refers to the layout or inter - connected pattern of computers and devices in a
network.
Any two types of network topology are bus topology and ring topology.

b) What is antivirus software? Name any two popular antivirus software.


Ans: Antivirus software is a program that scans, detects, and removes malicious software from a
computer or device to protect it from security threats.
Any two popular antivirus software are Kaspersky and NOD 32.

c) What is cyber law and cyber crime?


Ans 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.
Cyber crime refers to criminal activities that are carried out using computers or the internet.

1|P a g e CS SEE GP B 2078 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
d) What is virtual reality? Write any two areas where virtual reality are used.
Ans: Virtual Reality (VR) is a technology that creates a simulated (virtual) world where users
can feel and interact with things as if they are real, using devices like VR headsets and gloves.
Any two areas where virtual reality is used are : Gaming and Education & Training (medical or flight
training).

e) What is password? Write any two importance of password protection.


Ans: A password is a secret word or phrase used to secure access to accounts or systems, ensuring
only authorized users can enter.
Any two importance of password protection are:
1. Password secures the data by protecting from unauthorized access.
2. It safeguards personal information from being stolen or misused.

f) What is DBMS? Write four objects of MS-Access.


Ans: DBMS is a computerized system that stores data, processes them and provides information in
an organized form.
Any four objects of MS-Access are Table, Form, Query and Report.

g) What are validation text and validation rule?


Ans: Validation Text is a field property which displays an error message that appears if the data
entered is invalid according to the specified validation rule.
Validation Rule is a field property which is used to limit the values that can be entered into a field.

h) What is form? Write any two advantages of it.


Ans: Form is one of the MS-Access database objects which provides graphical interface to view,
modify and add data in a table or multiple linked tables.
Any two advantages of form are:
1. Form displays complete record one at a time, so we can view and modify records using the form.
2. Forms provides GUI (Graphical Users Interface) using which users interact with MS-Access
database.

i) What is record? Why is primary key necessary in record?


Ans: 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.

5. Write down the output of the given program:


DECLARE SUB Series(A)
CLS
A=20
CALL Series(A)
END
SUB Series(A)
FOR K=1 to 5
PRINT A;
A=A+10
NEXT K
END SUB

2|P a g e CS SEE GP B 2078 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
Dry Run Table
A K=1 to 5 PRINT A; A=A+10
20 1 to 5 yes 20 20+10=30
30 2 to 5 yes 30 30+10=40
40 3 to 5 yes 40 40+10=50
50 4 to 5 yes 50 50+10=60
60 5 to 5 yes 60 60+10=70
70 6 to 5 no
Loop exits
The output of the program is:
20 30 40 50 60

6. Re-Write the given program after correcting the bugs:


REM program to make a word reverse
DECLARE FUNCTION Rev$(N$)
CLS
INPUT “Enter a word”; N$
DISPLAY “Reversed is”; Rev$(N$)
END
FUNCTION Rev$(N$)
FOR K=LEN$(N$) To 1 STEP-1
B$=B$+MID$(N$,1,K)
NEXT K
B$=Rev$
END FUNCTION

Debugged Program
REM program to make a word reverse
DECLARE FUNCTION Rev$(N$)
CLS
INPUT “Enter a word”; N$
PRINT “Reversed is”; Rev$(N$)
END
FUNCTION Rev$(N$)
FOR K=LEN (N$) To 1 STEP-1
B$=B$+MID$(N$,K,1)
NEXT K
Rev$=B$
END FUNCTION

7. Study the following program and answer the given questions:


DECLARE FUNCTION SUM(N)
CLS
INPUT “Enter any number”; N
X=SUM(N)
PRINT “The sum of individual digit is “; X
END
FUNCTION SUM(N)
3|P a g e CS SEE GP B 2078 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
WHILE N<>0
R=N MOD 10
S=S+R
N=INT(N/10)
WEND
SUM=S
END FUNCTION

a) Write the function of INT.


Ans: The INT function returns the integer part of a number, removing the decimal part.

b) How many times does the WHILE ….WEND loop repeat if the value of N is 123?
Ans: The WHILE ….WEND loop repeats 3 times if the value of N is 123.

8. Convert/Calculate as per the instruction:


i) (11001101)2 = (?)16
Soln:
Paired Binary Digit 1100 1101
Binary Equivalent value C D

(10110011)2 = (CD)16

ii) (524)10 = (?)2


2 524 Remainder
2 262 0
2 131 0
2 65 1
2 32 1
2 16 0
2 8 0
2 4 0
2 2 0
2 1 0
2 0 1

(524)10 = (1000001100)2
iii) (1010)2  (110)2 – (1011)2 = (?)2
1 0 1 0
× 1 1 0
0 0 0 0
1 0 1 0 ×
1 0 1 0 × ×
1 1 1 1 0 0
- 1 0 1 1
1 1 0 0 0 1
(1010)2  (110)2 – (1011)2 = (110001)2
4|P a g e CS SEE GP B 2078 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
iv) (10110)2 ÷ (101)2
101) 10110( 100
-101
00010
- 0
10

Quotient = 100
Remainder = 10

9. Answer the following questions.

a) Write a program in QBASIC that will asks the user to input length, breadth and height of a
room then use SUB procedure calculate its volume and FUNCTION procedure to calculate its
area of four walls.
DECLARE SUB VOL(L,B,H)
DECLARE FUNCTION AREA(L,B,H)
CLS
INPUT “Enter length”; L
INPUT “Enter breadth”; B
INPUT ”Enter height”; H
CALL VOL(L, B, H)
PRINT “Area of four walls=”; AREA(L, B, H)
END

SUB VOL(L, B, H)
V=L*B*H
PRINT “Volume of room”; V
END SUB

FUNCTION AREA(L, B, H)
AREA=2*H*(L+B)
END FUNCTION

b) A sequential data file called “Record.dat” has stored data under the field heading Roll No.,
Name, Gender, English, Nepali, Maths and Computer. Write a program to display all the
information of those students whose marks in English is more than 40.

OPEN "Record.dat" FOR INPUT AS #1


CLS
WHILE NOT EOF (1)
INPUT #1, R, N$, G$, E, NP, M, C
IF E > 40 THEN PRINT R, N$, G$, E, NP, M, C
WEND
CLOSE #1
END

5|P a g e CS SEE GP B 2078 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
10. Write a program in C language that asks any two numbers and displays the greatest among them.

#include<stdio.h>
#include<conio.h>
int main()
{
int a,b;
printf("Enter any two numbers:\n ");
scanf("%d %d", &a, &b);
if(a>b)
printf("The greatest number is %d", a);
else
printf("The greatest number is %d", b);
return 0;
}

OR

Write a program in C-Langauge to display the series with their sum. 1,2,3,4….upto 10th terms.

#include <stdio.h>
int main()
{
int j, sum = 0;
printf("The first 10 natural number is :\n");
for (j = 1; j <= 10; j++)
{
sum = sum + j;
printf("%d ",j);
}
printf("\nThe Sum is : %d\n", sum);
}

***

6|P a g e CS SEE GP B 2078 https://seeqbasicomputer.blogspot.com/


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 E-commerce refers to the buying and selling
and selling of goods and services from of goods and services over the internet
person to person without use of 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 R=A MOD IS R MOD YES NO D=C\5 OUT=D


(A,B) B 2=0? C=R MOD C=R MOD 6
6 + 30 + 15
17 7 3 17 MOD 7 3 MOD 3 MOD 6 + 18\5 OUT=3
=3 2=0? 15 =3
1=0? NO =3+15=18

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 #
by 8 (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
=8C3
= 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
SOLEVD NATIONAL PABSAN KATHMANDU
Pre-Qualifying Exam-2081
Class-X
FM-50
Sub-Opt, Computer Science
Time-2hrs
PM-17.5

"Group-A" [10 Marks]

1. Answer the following questions in one sentence. [6×1=6]

a. Define computer network.


Ans: Computer network is a group of two or more computers and devices connected to each other through
wired or wireless media to exchange data and information and share hardware, software and other resources.

b. What is search engine?


Ans: A search engine is an online tool that helps users find information on the internet using keywords or
phrases, and provide relevant results.

c. What is tuple in database?


Ans: A tuple is a row in a table which contains information about single items in a database.

d. Give name of any two RDBMS software.


Ans: MS-Access and Oracle

e. Define local variable.


Ans: A variable which is defined in a module and is not accessible to any other module is called local
variable.

f. Write down any two features of C programming language.


Ans: Any two features of C programming language are:
• Portability: C code can be compiled and executed on different systems with minimal modifications.
• C is a case-sensitive programming language. It understands the capital alphabets and small alphabets
as different values.

2. Write the appropriate technical terms for the following. [2×1=2]

a. Networking devices use to regenerate the signal and transfer further. Repeater
b. Online postal service, E-mail

3. Write the full forms. [2×1=2]

i. SIM – Subscriber Identity Module


ii. NOS – Network Operating System

"Group-B" [24 Marks]

4. Answer the following questions. [9×2=18]

a. What are the two advantages of ring topology over bus topology?
Ans: The two advantages of ring topology over bus topology are:
Ring topology manages data traffic more efficiently with technologies like token passing.
Ring topology supports equal data transmission opportunities for all devices.
b. Define hardware security. Write the importance of power protection device to protect the
computer.
Ans: Hardware security refers to the protection of the physical components of a computer or electronic
device from unauthorized access, theft, or damage.
The importance of power protection device to protect the computer is to prevent damage to the computer's
hardware and data loss due to sudden power fluctuations.

c. What do you mean by Digital Citizenship? List its' two advantages.


Ans: Digital citizenship refers to the responsible and ethical use of technology and the internet which
involves understanding, practicing, and promoting appropriate behavior when using digital tools and
resources.
Any two advantages are:
It teaches users to protect personal information and avoid online risks like cyberbullying and scams.
Encourages creating a responsible and ethical online presence.

d. Define e-commerce. Give example of any two commercial sites in Nepal.


Ans: E-commerce refers to the buying and selling of goods and services over the internet.
Any two commercial sites in Nepal are: mucha and daraz.
e. List any two threats of using social media.

f. Define Form and Report.


Ans: Form is one of the MS-Access database objects which provides graphical interface to view, modify and
add data in a table or multiple linked tables.
Report is one of the MS-Access database objects used to present information in an effective and organized
format that is ready for printing.

g. Write down the advantages of database management system over traditional data storage system.
The advantages of database management system over traditional data storage system are:
a) It reduces data redundancy which means duplication of data.
b) It allows multiple users to access the same data simultaneously.
c) Large volume of data can be stored and updated easily.
d) It provides high security of data as well as maintains accurate database.

h. What is the difference of 'Allow Zero length' and 'required' field properties of MS-Access.
Ans: The "Allow Zero Length" property controls if empty strings are allowed, while the "Required"
property ensures the field cannot be left null.

i. Define Query. List out its type.


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.
Its types are:
Select query and Action Query (update, delete, append and make table query

5. Write the output of the following program. [2]

DECLARE SUB series ()


CALL series
END

SUB series ()
i=3
FOR c = 1T0 5
PRINT i *c^2;
NEXT c
END SUB

Dry Run
i C=1 to 5 PRINT i *c^2;
3 1 to 5 yes 3x1^2
3x1
=3
2 to 5 yes 3x2^2
3x4
=12
3 to 5 yes 3x3^2
=3x9
27
4 to 5 yes 3x4^2
=3x16
=48
5 to 5 yes 3x5^2
3x25
=75
6 to 5 no
Loop exists

The output of the program is:


3 12 27 48 75

6. Re-write the given program after correcting the bugs. REM to find the factorial of a given number.

[2]

DECLARE FUNCTION FACTO (N$)


CLS
INPUT "Enter a number"; N
CALL FACTO (N)
END

FUNCTION FACTO ( )
F=1
WHILE N = 0
F =F* N
N=N-1
WEND
FACTO=F
END SUB

Debugged Program:
DECLARE FUNCTION FACTO (N)
CLS
INPUT "Enter a number"; N
PRINT FACTO (N)
END

FUNCTION FACTO (N)


F=1
WHILE N < > 0
F =F* N
N=N-1
WEND
FACTO=F
END FUNCTION

7. Study the given program and answer the given questions.[2]

DECLARE SUB SUM (N)


CLS
INPUT "Enter any number"; N
CALL SUM (N)
END

SUB SUM (N)


WHILE N > 0
R=N MOD 10
T=T+R
N =Ni10
WEND
PRINT "The Sum of individual digit is"; T
END SUB

Questions:
a) How many parameter(s) is used in the above program? List them.
Ans: 1 parameter is used in the above program.

b) Write the use of MOD in above program.


Ans: The MOD operator is used to calculate the remainder of a division operation between two numbers.

"Group-C" [16 Marks]

8. Convert/Calculate the following as per instructions [4×1=4]

i. (9876)10 into Binary

Divide by the base 2 to get the digits from the remainders:


Division Quotient Remainder
by 2 (Digit)
(9876)/2 4938 0
(4938)/2 2469 0
(2469)/2 1234 1
(1234)/2 617 0
(617)/2 308 1
(308)/2 154 0
(154)/2 77 0
(77)/2 38 1
(38)/2 19 0
(19)/2 9 1
(9)/2 4 1
(4)/2 2 0
(2)/2 1 0
(1)/2 0 1
= (10011010010100)2

(9876)10 = (10011010010100)2
ii. (2081)16 into octal
Converting hex to binary
6C16 =
6 = 0110
C = 1100 = 11011002
11011002
Converting binary to octal
001 = 1
101 = 5
100 = 4

(2081)16 = (154)8

iii. 11010+10110

1 1 0 1 0
+ 1 0 1 1 0
1 1 0 0 0 0

11010+10110 = 110000

iv. 101110  101

101) 1 0 1 1 1 0 (1001
-1 0 1
0 0 0 1 1 0
1 0 1
0 0 1

Q = 1001
R=1

9. (a) Write a program to calculate area of a circle using SUB..... END SUB and perimeter of rectangle
using FUNCTION... END FUNCTION. [4]

DECLARE SUB AREA (R)


DECLARE FUNCTION PER(L, B)
CLS
INPUT “Enter radius of circle”; R
INPUT “Enter length of rectangle”; L
INPUT “Enter breadth of rectangle”; B
CALL AREA(R)
PRINT “Perimeter of rectangle=”; PER(L,B)
END

SUB AREA(R)
A= 22/7 * R ^ 2
PRINT “Area of rectangle=”; A
END SUB

FUNCTION PERI(L, B)
PERI = 2 * (L + B)
END FUNCTION
b. A sequential file "detail.dat" contain Name, Age and mobile number of few persons. Write a
QBASIC program to display the name of those persons who are eligible to cast the vote. [ Age must be
18 or above to cast the vote.] [4]

OPEN “detail.dat” FOR INPUT AS #1


CLS
PRINT “Name of persons who are eligible to cast vote are”
WHILE NOT EOF(1)
INPUT #1, N$, A, P
IF A>=18 THEN PRINT N$
WEND
CLOSE #1
END

10. Write a C program to test whether the given number is exactly divisible by 13 or not.

#include <stdio.h>
int main()
{
int num;
printf("Enter a number: ");
scanf("%d", &num);
if (num % 13 == 0)
{
printf("The number %d is divisible by 13.\n", num);
}
else
{
printf("The number %d is not divisible by 13.\n", num);
}
return 0;
}

***
PABSON, Lalitpur
SEE PRE-QUALIFYING EXAMINATION-2081
Subject-Opt II. Computer Science
Time: 3 hrs
Attempt all questions.
Group A [20 Marks]

1. Answer the following questions in one sentence: (6x1=6)

a) What is hacking?
Hacking is the act of breaking into computer systems or networks without permission, often to steal,
change, or destroy data, or to disrupt operations.

b) Why is browser needed?


Browser is needed to access and view websites on the internet.

c) Write two examples of cyber-crime.


Any two examples of cyber-crime are Phishing and Hacking

d) What are the different data types available in C?


The different data types available in C are int, char, double and float

e) Which data type is used to store paragraph in MS-Access?


The data type used to store paragraph in MS-Access is Memo.

f) What is the use of CALL statement in modular programming?


The use of CALL statement is to call sub-procedure in modular programming.

2. Write the technical term for the following statements:


a) The process of transferring data or files from a local device to a remote system, server, or online
platforms. Uploading
b) The responsible and ethical use of technology and digital platform to engage, communicate, and
participate in online communities effectively and safely. Digital Citizenship

3. Write the full forms of the following:


a) IRC - Internet Relay Chat
b) CCTV – Closed Circuit Television

Group B [24 Marks]


4. Answer the following questions: [9 x 2=18]

a) What do you mean by digital footprint? List any two ways to maintain our digital reputation.
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.
Any two ways to maintain our digital reputation are:
• Think carefully before sharing online, as it can be difficult to remove or change once it's posted.
• Use privacy settings to choose who can see your posts and keep your personal info, like your
phone number and address, private.

b) Write any two advantages and two disadvantages of cloud computing.


Any two advantages of cloud computing are:
• It is easier to get back-up and restore the data.
• It reduces both hardware and software maintenance costs for organizations.
Any two disadvantages of cloud computing are:
• Storing sensitive data on remote servers raises privacy issues.
• Uploading and downloading large volumes of data can be time-consuming.

c) What DBMS? List its two functions.


DBMS is a computerized system that stores data, processes them and provides information in an
organized form.
Any two functions are:
• It reduces data redundancy which means duplication of data.
• It allows multiple users to access the same data simultaneously.

d) What do you mean a by field property in MS Access? List any two field properties with example.
Field properties are settings or attributes that allow users to control various aspects of data entry,
validation, formatting, and behavior within the database.
Any two field properties with example are:
• Field Size - Field size is a field property which is used to set the maximum size for data stored in
the field that is set to the Text or Number data type.
• Caption - Caption is a field property which gives alternative name given for any field.
The maximum size for this is 2048 characters.

e) What is form? List its uses.


Form is one of the MS-Access database objects which provides graphical interface to view, modify
and add data in a table or multiple linked tables.
The uses of form are:
• Forms provide an easy-to-use interface for data entry and manipulation, improving data accuracy
and completeness.
• Forms can include validation rules to ensure data quality and prevent errors.

f) What is hardware security? List any four methods to protect the data from your computer.
Hardware security refers to the protection of the physical components of a computer or electronic
device from unauthorized access, theft, or damage.
Any four methods to protect the data from computer are:
Password, Backup, Scandisk and Antivirus

g) What is bus topology? Mention any two differences between bus and ring topology.
Bus topology is a network configuration where all devices are connected to a single central cable
known as a "bus".
Any two differences between bus and ring topology
Bus Topology Ring Topology
Data sent in both directions over a shared cable Data sent in one direction around the ring
Failure in the bus can disrupt the entire network Single point of failure can disrupt the network, but
can be mitigated with dual rings

h) What is B2C? Give any two examples of B2C in Nepal.


B2C is a type of e-commerce model which establishes the electronic business relationships between
a business organization (merchant) and final consumers.
Any two examples of B2C in Nepal are: Daraz and Hamrobazar.

i) What is query? List its types.


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.
Its types are : Select Query and Action Query

Write the output of the given program showing the dry run table. (2)
DECLARE SUB test()
CALL test
END
SUB test
X=0
FOR K=10 TO 4 STEP-2
A=K^2
X=X+A
NEXT K
PRINT X
END SUB

X K=10 TO 4 STEP-2 A=K^2 X=X+A PRINT X


0 10 TO 4 YES 10^2=100 0+100=100
8 TO 4 YES 8^2=64 100+64=164
6 TO 4 YES 6^2=36 164+36=200
10 TO 4 YES 4^2=16 200+16=216
2 TO 4 NO 216
LOOP EXITS

The output of the program is :


216

6. Re-write the following program correcting the bug.


REM To copy all data from sequential data file INFO.DAT to NEWINFO.DAT.
OPEN "INFO.DAT" FOR INPUT AS #1
OPEN "NEWINFO.DAT" FOR INPUT AS #2
DO WHILE NOT EOF(1)
LINE INPUT #1, ALL$
COPY #2, ALL$
WEND
FINISH #1,#2
END

Debugged Program
REM To copy all data from sequential data file INFO.DAT to NEWINFO.DAT.
OPEN "INFO.DAT" FOR INPUT AS #1
OPEN "NEWINFO.DAT" FOR OUTPUT AS #2
DO WHILE NOT EOF(1)
LINE INPUT #1, ALL$
WRITE #2, ALL$
LOOP
CLOSE #1,#2
END

7. Read the program given below and answer the questions that follows.(2)
DECLARE FUNCTION RETURNS(A$)
LINE INPUT "Enter a Sentence"; S$
PRINT RETURN$(S$)
END

FUNCTION RETURNS(A$)
FOR T=1 TO LEN(A$)
E$= MID$(A$,T,1)
IF E$ SPACE$(1) THEN
R$=E$+R$
END IF
NEXT T
RETURN$=R$
END FUNCTION
Questions:
a) List all the string library function(s) from the program.
The string library function(s) from the program are: LEN( ), MID$( ), SPACE$( )
b) How many times loop T execute, if A$= 'MY PRIDE MY NATION"?
T execute 18 times, if A$= 'MY PRIDE MY NATION"?

Group C [16 Marks]

8. Convert /Calculate as per the instructions. (4 x 1)

i. (111101100)2 into octal


Soln:
Converting binary to octal
111 = 7
101 = 5
100 = 4
(111101100)2 = (754)8

ii (401)16 into Decimal


Soln:
(401)₁₆
= (4 × 16²) + (0 × 16¹) + (1 × 16⁰) = (1025)₁₀
=4×256 + 0 × 16 + 1 × 1
=1024 + 0 + 1
=1025
(401)16 = (1025)10

iii. (10101)2-(11011)2+(10001)2

iy (101101)2  (100)

100) 1 0 1 1 0 1 (1011
1 0 0
1 1 0
1 0 0
1 0 1
1 0 0
1

Q=1011
R=1

Write a program in QBASIC that asks length, breadth and height of room and calculates its area and volume.
Create a user-defined function to calculate area and sub-program to calculate volume. (4) [Hint: Area=LxB
Volume LXBXH]

DECLARE FUNCTION AREA(L,B)


DECLARE SUB VOL(L,B,H)
CLS
INPUT “Enter Length”; L
INPUT “Enter Breadth”; B
INPUT “Enter Height”; H
PRINT “Area of room=”; AREA(L,B)
CALL VOL(L,B,H)
END

FUNCTION AREA(L,B)
AREA = L * B
END FUNCTION

SUB VOL(L,B,H)
V=L*B*H
PRINT “Volume of Room=”; V
END SUB

19. A sequential data file called "STUDENT.DAT" has stored data under the field heading Registration No.,
Class, Section, Name, Date of Birth and Gender. Write a program to display all the information of class
NINE students whose gender is 'FEMALE'. (4)

OPEN “STUDENT.DAT” FOR INPUT AS #1


CLS
WHILE NOT EOF(1)
INPUT #1, R, CL, SE$, N$, D$, G$
IF UCASE$(G$)=”FEMALE” AND CL=9 THEN
PRINT R, CL, SE$, N$, D$, G$
END IF
WEND
CLOSE #1
END

11. Using C language, write a program to input three integers then display the highest integer. (4)

#include <stdio.h>
int main()
{
int num1, num2, num3;
printf("Enter three integers: ");
scanf("%d %d %d", &num1, &num2, &num3);
if (num1 >= num2 && num1 >= num3)
{
printf("The highest integer is: %d\n", num1);
}
else if (num2 >= num1 && num2 >= num3)
{
printf("The highest integer is: %d\n", num2);
} else
{
printf("The highest integer is: %d\n", num3);
}
return 0;
}

OR
Using C language, write a program to display all even numbers from 20 to 40 along with their sum.

#include <stdio.h>
int main()
{
int sum = 0;
printf("Even numbers from 20 to 40 are:\n");
for (int i = 20; i <= 40; i++) {

if (i % 2 == 0)
{
printf("%d ", i);
sum += i;
}
}
printf("\nSum of even numbers from 20 to 40 is: %d\n", sum);
return 0;
}
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
2081-06-18
SOLVED
PABSON Kathmandu
MID TERMINAL EXAMINATION-2081 [SET A]
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'(10 Marks)

1. Answer the following questions in one sentence: (6x1=6)

a) What is LAN?
Ans: LAN (Local Area Network) is a network that connects computers within a limited area such as a home,
school, or office building.

b) Give any two examples of AI.


Ans: Two examples of AI are voice assistants (e.g., Siri, Alexa) and self-driving cars.

c) What is data redundancy?


Ans: Data redundancy is the duplication of data within a database.

d) What is the purpose of a table?


Ans: The purpose of a table is to organize and store data systematically in rows and columns.

e) What is global variable in QBASIC?


Ans: A global variable in QBASIC is a variable that can be accessed and modified from any part of the
program.

f) What is looping?
Ans: Looping is the process of repeating a set of instructions until a specified condition is met.

2. Write appropriate technical term for the following: (2×1=2)

a) Digital marks created while using internet. Digital footprint


b) Making duplicate copy of file for security purpose. Backup

3. Write the full form of the following: (2×1=2)

a) GIF - Graphics Interchange Format


b) NIC - Network Interface Card

Group 'B' (24 Marks)

4. Answer the following questions: (9×2=18) mail.

a) Give any two advantages of e-mail over traditional mail.


Ans: Two advantages of email over traditional mail are faster delivery and the ability to send multimedia
attachments (such as images and documents) instantly.
1|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
b) Write any two advantages and disadvantages of social media.
Ans: Advantages of social media:
• Facilitates easy communication and networking with people worldwide.
• Provides a platform for sharing information and promoting businesses.
Disadvantages of social media:
• Can lead to privacy issues and data breaches.
• May cause addiction and negatively impact mental health.

c) What do you mean by software security? Write any two methods to protect the computer software.
Ans: Software security refers to measures taken to protect software from unauthorized access,
vulnerabilities, and malicious attacks.
Two methods to protect computer software:
• Use strong passwords.
• Install and regularly update antivirus software.

d) Write any two advantages and disadvantages of online payment.


Ans: Advantages of online payment:
• It is fast and convenient, allowing payments to be made instantly from anywhere.
• It provides easy record-keeping and transaction history.
Disadvantages of online payment:
• It can be easily targeted by hackers and used for fraud.
• It requires a reliable internet connection, which may not always be available.

e) Define virtual reality. Write any two areas where VR is used.


Ans: Virtual reality (VR) is a computer-generated simulation that immerses users in a three-dimensional,
interactive environment.
Two areas where VR is used:
• Gaming and entertainment.
• Medical training and therapy.

f) What is database? Give any two examples of it.


Ans: A database is an organized collection of data that is stored and managed for easy access, retrieval, and
updating.
Two examples of databases: Dictionary and Marks Ledger

g) What is validation rule and validation text?


Ans: Validation rule is a condition set on data entry fields to ensure that the entered data meets specific
criteria.
Validation text is the message displayed to users when the data they enter does not meet the validation rule.

h) What is a query? What is the purpose of query in MS-Access?


Ans: A query is a request to extract specific information from a database.
The purpose of a query is to retrieve, filter, and manipulate data from one or more tables to meet specific
requirements, allowing users to easily analyze and make decisions based on that data.

i) What is report in MS-Access? Why it is important?


Ans: A report in MS-Access is a formatted document that presents data from the database, allowing users to
view, summarize, and print information in an organized way.
Reports are important because they help present data in a structured way, making it easier to analyze, share,
and make informed decisions.

2|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA

5. Write down the output of the given program. (Show with dry run in table). (2)

DECLARE SUB Show (XY$)


CLS
XY$ = "HTUOMENXSA"
CALL Show(XY$)
END

SUB Show(XY$)
A = 47
FOR I = 1 TO 5
N = A MOD 7
PRINT MID$(XY$, N, 1)
A=A-1
NEXT I
END SUB

Dry Run in Table:


XY$ A I = 1 TO 5 N =A MOD 7 PRINT MID$(XY$, N, 1) A=A-1
HTUOMENXSA 47 1 to 5 yes 47 MOD 7 = 5 M 46
46 2 to 5 yes 46 MOD 7 = 4 O 45
45 3 to 5 yes 45 MOD 7 = 3 U 44
44 4 to 5 yes 44 MOD 7 = 2 T 43
43 5 to 5 yes 43 MOD 7 = 1 H 42
42 6 to 5 no
Loop exits

The output of the program is:


M
O
U
T
H

6. Re-write the given program after correcting the bugs: (2)


REM to display greatest number
DECLARE GREAT FUNCTION (a, b, c)
ACCEPT a, b, c
PRINT GREAT (x, y, z)
END

FUNCTION GREAT (a, b, c)


IF a>b or a>c THEN
G=a
ELSEIF b>a AND b>c THEN
G=b
ELSE
G=c
NEXT
G=GREAT
END SUB

3|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
Debugged Program

REM to display greatest number


DECLARE GREAT FUNCTION (a, b, c)
INPUT a, b, c
PRINT GREAT (a,b,c)
END

FUNCTION GREAT (a, b, c)


IF a>b AND a>c THEN
G=a
ELSEIF b>a AND b>c THEN
G=b
ELSE
G=c
END IF
GREAT=G
END SUB

7. Study the following program and answer the given questions: (2x1=2)

REM “to count vowels”


DECLARE FUNCTION count (A$)
INPUT "Enter a word"; A$

End

FUNCTION count (A$)


B=LEN (A$)
C$=UCASE$(A$)
FOR I=1 to B
E$=MID$(C$, I, 1)
IF E$="A" or E$= "E" or E$= "I" or E$="O" or E$ = "U" THEN
C=C+1
END IF
NEXT I
Count=C
END FUNCTION

Questions:

a) List the string library functions used in the above program.


Ans: The string library functions used in the above program Re LEN ( ), UCASE$( ), MID$( )
b) Write down the missing execute the program. statements in the main module to execute the
program.
Ans: PRINT count(A$) is missing execute the program. statements in the main module to execute the
program.

4|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
Group C (16 Marks)

8. Convert/Calculate as per the instruction: (1x44)

i) (231)8 = (x)10
(2 × 8²) + (3 × 8¹) + (1 × 8⁰)
(2 × 64) + (3 × 8) + (1 × 1)
(128) + (24) + (1)
= 153
(231)8 = (153)10

ii) (1D3)16 = (?)2


Convert each hex digit to 4 binary digits (see conversion table below):
1D3
=1D3
1 = 0001
D = 1101
3 = 0011

(1D3)16 = (111010011)2

ⅲ) (111001-11) + 111001
1 1 1 0 0 1
- 1 1-
1 1 0 1 1 0
+ 1 1 1 0 0 1
1 1 0 1 1 1 1

(111001-11) + 111001 = 1101111

iv) (101101  110)


110) 1 0 1 1 0 1 (111
1 1 0
1 0 1 0
1 1 0
1 0 0 1
1 1 0
1 1

Q=111
R=11

9. Answer the following (4x2=8)

a) WAP that asks principal, time and rate of interest and calculate simple interest using SUB.... END
SUB and amount using FUNCTION.... END FUNCTION. [Hint: SI=P*T*R/100, Amount=P+SI]

DECLARE SUB CSI (P, T, R, SI)


DECLARE FUNCTION AMT (P, SI)
CLS

5|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
INPUT "Enter Principal: "; P
INPUT "Enter Time (in years): "; T
INPUT "Enter Rate of Interest: "; R

CALL CSI(P, T, R, SI)


A = AMT(P, SI)
PRINT "Simple Interest: "; SI
PRINT "Total Amount: "; A
END

SUB CSI (P, T, R, SI)


SI = P * T * R / 100
END SUB

FUNCTION AMT (P, SI)


AMT = P + SI
END FUNCTION

b Write a program to check whether a string is palindrome or not using SUB...END SUB

DECLARE SUB REV (S$)


CLS
INPUT "ENTER ANY STRING"; S$
CALL REV(S$)
END

SUB REV (S$)


FOR I = LEN(S$) TO 1 STEP -1
B$ = MID$(S$, I, 1)
W$ = W$ + B$
NEXT I
IF S$ = W$ THEN
PRINT “THE GIVEN STRING IS PALINDROME”
ELSE
PRINT “THE GIVEN STRING IS NOT PALINDROME”
END IF
END SUB

10. Write a program to ask number and check it is exactly divisible by 4 and 6 using SUB......END
SUB.
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 “THE GIVEN NUMBER IS COMPLETELY DIVISIBLE BY 4 AND 6”
ELSE
PRINT THE GIVEN NUMBER IS NOT COMPLETELY DIVISIBLE BY 4 AND 6”
END IF
END SUB

or

6|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA

Write a program in QBASIC to display sum of first 10 natural numbers using FUNCTION.... END
FUNCTION.

DECLARE FUNCTION SUM( )


CLS
PRINT “Sum of first 10 natural numbers is”; SUM
END

FUNCTION SUM( )
S=0
FOR I = 1 TO 10
S=S+I
NEXT I
SUM = S
END FUNCTION

7|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
2081-06-18
SOLVED
PABSON Kathmandu
MID TERMINAL EXAMINATION-2081 [SET B]
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'(10 Marks)

1. Answer the following questions in one sentence: (6x1=6)

a) Give any two examples of simplex mode of data communication


Ans: any two examples of simplex mode of data communication are: newspaper and radio.

b) What is hardware security?


Ans: Hardware security refers to the protection of the physical components of a computer or electronic
device from unauthorized access, theft, or damage.

c) What is primary key?


Ans: A primary key is a unique field in a database table that identifies each record uniquely.

d) Which view is to modify a table structure in MS-Access?


Ans: Design view is used to modify a table structure in MS-Access?

e) What is modular programming?


Ans: Modular programming is a technique which divides program into many small logical, manageable and
functional modules or blocks.

f) What are parameters in QBASIC?


Ans: Parameter are variables which are used to specify or declare types of data to be passed to the procedure
either sub or function.
2. Write appropriate technical term for the following: (2×1=2)

a) The very first page of every websites. Home Page


b) Online transaction through mobile phones. M-Commerce

3. Write the full form of the following: (2×1=2)

a) ARPANET – Advanced Research Projects Agency


b) PDF – Portable Document Format

Group 'B' (24 Marks)

4. Answer the following questions: (9×2=18) mail.

a) What is peer to peer network model?


Ans: A peer-to-peer (P2P) network is a type of network where each computer or device (peer) can act as
both a client and a server.
1|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
b) What is cyber-crime? Give few examples of it.
Ans: Cyber-crime refers to illegal activities committed through the use of computers and Internet.
Examples of cyber crime are hacking, phishing, cyber bullying etc.

c) Write the importance of UPS in computer system.


Ans: The importance of UPS in computer security system is that it controls fluctuation of electric voltage and
provides enough backup electric power to the computer system when there is power failure.

d) Write down the advantages and disadvantages of e-commerce.


Ans: Advantages of e-commerce:
• Faster buying/selling procedure, as well as easy to find products.
• There are no geographical limitations, can deliver service globally.
Disadvantages of e-commerce:
• Lack of personal touch. We cannot touch the goods physically.
• We cannot do any transaction without Internet access device. So, it is heavily dependent on Internet
technologies.

e) Define e-governance. List out the models of e-governance.


Ans: E-governance is a set of services provided by the government to public via electronic media especially
using Internet.
The models of e-governance are:
• Government-to-Citizen(G2C)
• Government-to-business (G2B)
• Government-to-Government (G2G)
• Government-to-Employee (G2E)

f) What is data types? List any four important data types used in MS-Access.
Ans: Data type is an attribute for a field that determines the type of data that can be stored in that field.
Any four important data types used in MS-Access are : text, memo, number and currency.

g) What is data sorting? List any two advantages of using it.


Ans: The process of arranging all the records in a table either ascending or descending order based on field
or fields is known as sorting.
Any two advantages of using it are:
• Sorting helps to organize data and make it easier to find and retrieve specific information.
• Sorting can save time and improve efficiency by allowing users to quickly access the data they need.

h) Give the differences between select query and action query?


Ans: The differences between select query and action query are:
Select Query Action Query
Select query is simply used to select and display An action query is a query that makes changes to or
the relevant data from the database. removes many records in just one operation.
It does not make change to database. It makes change to database.

i) What is form in MS-Access? Write any two advantages of it.


Ans: Form is one of the MS-Access database objects which provides graphical interface to view, modify and
add data in a table or multiple linked tables.
Any two advantages of form are:
• Forms provide an easy-to-use interface for data entry and manipulation, improving data accuracy and
completeness.
• Forms can include validation rules to ensure data quality and prevent errors.
2|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA

5. Write down the output of the given program. (Show with dry run in table). (2)

DECLARE SUB RESULT(S$)


S$ =" SCIENCE"
CALL RESULT(S$)
END
SUB RESULT(S$)
B=LEN(S$)
C=1
WHILE C<=B
X$=X$+(MID$(S$,C,1)
C=C+2
WEND
PRINT X$
END SUB

Dry Run in Table:


S$ B=LEN(S$) C C<=B? X$=X$+(MID$(S$,C,1) C=C+2 PRINT X$
SCIENCE 7 1 1<=7 yes S 1+2=3
3 3<=7 yes S+I=SI 3+2=5
5 5<=7 yes SI+N=SIN 5+2=7
7 7<=7 yes SIN+E=SINE 7+2=9
9 9<=7 no SINE
Loop exits

The output of the program is:


SINE

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

3|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
REM To check the supplied no. is odd or even
DECLARE FUNCTION Check$ (X)
CLS
INPUT “ANY NUMBER:”; N
PRINT Check$ (N)
END
FUNCTION Check$ (N)
Y=2
R= N MOD Y
IF R=0 THEN
C$= “EVEN”
ELSE
C$= “ODD”
END IF
Check$ = C$
END FUNCTION

7. Study the following program and answer the given questions: (2x1=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.
Ans: The two built in functions used in the above program Re LEN ( ), RIGHT$( )
b) List the real parameters of the above program.
Ans: W$ is the real parameter used in the above program.

Group C (16 Marks)

8. Convert/Calculate as per the instruction: (1x44)

i) (231)10 = (x)16
Divide by the base 16 to get the digits from the remainders:
Division Quotient Remainder
by 16 (Digit)
(231)/16 14 7
(14)/16 0 14
4|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
= (E7)16

(231)8 = (153)10

ii) (10010001)2 = (?)10


= 1x27+0x26+0x25+1x24+0x23+0x22+0x21+1x20
=1x128 +0x64 + 0x32 + 1x16+0x4+0x2+1x1
=128+0+0+16+0+0+1
=145
(10010001)2 = (145)10

ⅲ) (1101001-1111) + 111001
1 1 0 1 0 0 1
1 1 1 1
1 0 1 1 0 1 0
+ 1 1 1 0 0 1
1 0 0 1 0 0 1 1

(1101001-1111) + 111001 = 10010011

iv) (1011001  111)


111) 1 0 1 1 0 0 1 (1100
1 1 1
1 0 0 0
1 1 1
0 0 0 1 0 1
0
1 0 1

Q=1100
R=101

9. Answer the following (4x2=8)

a) WAP to calculate area of rectangle using FUNCTION and area of circle using SUB.

DECLARE FUNCTION AREA (R)


DECLARE SUB CIR (R)
CLS
INPUT "ENTER RADIUS"; R
PRINT " AREA OF A CIRCLE="; AREA (R)
CALL CIR (R)
END

FUNCTION AREA (R)


AREA = 3.14 * R ^ 2
END FUNCTION

SUB CIR (R)


C = 2 * 3.14 * R
5|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
PRINT " CIRCUMFERENCE OF CIRCLE =" ; C
END SUB

b Write a program 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 “REVERSE NUMBER IS”; S
END SUB

10. Write a program to ask a number and check it is exactly divisible by 3 and 7 using
FUNCTION……END FUNCTION.
DECLARE SUB CHECK (N)
CLS
INPUT “ENTER ANY NUMBER”; N
CALL CHECK (N)
END

SUB CHECK (N)


IF N MOD 3 = 0 AND N MOD 7 = 0 THEN
PRINT “THE GIVEN NUMBER IS COMPLETELY DIVISIBLE BY 3 AND 7”
ELSE
PRINT THE GIVEN NUMBER IS NOT COMPLETELY DIVISIBLE BY 3 AND 7”
END IF
END SUB

or

Write a program to accept age and citizen of a person to check whether he/she is eligible to cast vote or not using
SUB…END SUB.

DECLARE SUB CHECK(A )


CLS
INPUT “Enter age”; A
CALL CHECK(A)
END

SUB CHECK(A)
IF A >=18 THEN
PRINT “You are eligible to vote”
ELSE
PRINT “You are not eligible to vote”
END IF

6|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
END SUB

7|P a g e CS SEE JEC BKT 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
PABSON BOARD EXAMINATION 2079 [SET A]

Group "A" [6x1=6]


1. Answer the following questions in one sentence.
a) Define database.
b) What will be the value of ‘y’ in given C expression, y=64%5?
c) What is a digital signature?
d) What is hardware security?
e) What is a global variable?
f) Define IP address.
2. Write appropriate technical terms for the following: [2x1=2]
a) The money that is exchanged electrically.
b) A computer which provides the services to the other computer in a network.
3. Write the full form of the following: [2x1=2]
a) SMPS
b) ISP

Group "B" (Short Answer Questions) [9x2=18]

4. Answer the following questions in short.


a) What is network topology? List them.
b) Define two major uses of the internet.
c) What is data sorting? Give any two examples.
d) Define online payment with an example.
e) Write any two features of the C programming language.
f) What is a report? Mention its uses.
g) Write the difference between data and information.
h) What is a firewall in a computer? Write its type.
i) Define DBMS with an example.

5. Write down the output of the given program with a dry run table:
DECLARE SUB PATTERN(N)
CALL PATTERN
END

SUB PATTERN
A=2
FOR I=1 TO 5
PRINT A;
A=A+2
NEXT I
END SUB

6. Re-write the given program after correcting the bug:

FUNCTION SUM(M, N)
REM to print sum of two numbers
A=6
B=7
DISPLAY sum(M,N)
END

FUNCTION SUM(M,N)
1|P a g e CS PABSON SET A 2079 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
S=M+N
S=SUM
END FUNCTION

7. Study the following program and answer the given questions:

DECLARE FUNCTION ODDEVEN$(N)


CLS
INPUT "Enter a number"; N
PRINT "Number is"; ODDEVEN$(N)
END

FUNCTION ODDEVEN$(N)
IF N MOD 2=0 THEN
MS$="even"
ELSE
MS$="odd"
END IF
ODDEVEN$=MS$
END FUNCTION
Questions:

a) What is the main objective of the above program?


b) What is the use of MOD in the above program?

Group "C") [4x1=4

8. Conversion/Calculation:

Convert (1110001110)₂ to octal.


Convert (111)₁₀ to binary.
c) (1000) 2 – (111) 2 = (?) 2
d) (111111) 2 ÷ (111) 2

9a. Write a program in QBASIC to display the greater number using a function procedure and the smaller
number using a sub procedure among three numbers.

b. Create a sequential data file to store the name and marks obtained in English, Math, and Science subjects
for a few students.

10. Write a program in C-language to display the first 10 natural numbers.


OR:
Write a C program that takes principle, rate, and time as input and calculates the simple interest.

2|P a g e CS PABSON SET A 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
PABSON BOARD EXAMINATION 2079 [SET A]
Group "A"
Answer the following questions in one sentence: [6x1=6]
a) Define database.
Ans: A database is a collection of systematically organized inter-related data that stores, organizes,
and retrieves data.

b) What will be the value of ‘y’ in given C expression, y=64%5?


Ans: The value of y will be 4.

c) What is digital signature?


Ans: A digital signature is a security mechanism that attaches a code to an electronic message,
confirming its authenticity.

d) What is hardware security?


Ans: Hardware security refers to the protection of the physical components of a computer or
electronic device from unauthorized access, theft, or damage.

e) What is global variable.


Ans: A global variable is a variable that can be accessed from any module or procedure within a
program.

f) Define IP address.
Ans: IP address is a unique numerical identifier for every device or network that connects to the
internet.

2. Write appropriate technical terms for the following: [2x1=2]


a) The money that is exchanged electrically. Digital currency
b) A computer which provides the services to the other computer in a network. Server

3. Write the full form of the following: [2x1=2]


a) SMPS- Switched Mode Power Supply
b) ISP- Internet Service Provider

Group "B"
4. Answer the following questions in short : [9x2=18]
a) What is network topology? List them.
Ans: Network topology refers to the physical or logical arrangement of network components.
Its types are: bus topology, ring topology and star topology

b) Define two major uses of internet.


Ans: Any two major uses of internet are:
Communication: Sending emails, chatting, and video conferencing with others.
Entertainment: Watching videos, listening to music, and playing games online.

c) What is data sorting. Give any two examples.


Ans: 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
Examples include alphabetical sorting of names and numerical sorting of exam scores.

d) Define online payment with example.


Ans: Online payment refers to the payment for buying goods or services through the Internet using
different online payment gateway.
3|P a g e CS PABSON SET A 2079 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
Eg: eSewa Nepal, iPay, Khalti, etc.
e) Write any two features of C programming language?
Ans: Any two features of c programming language are:
a) Structured Programming: C supports breaking down programs into functions, making the
code easier to manage and understand.
b) Portability: C code can be compiled and executed on different systems with minimal
modifications.

f) What is report? Mention its uses.


Ans: Report is one of the MS-Access database objects used to present information in an effective and
organized format that is ready for printing.
Its Uses are:
• Reports provide a formatted presentation of data that is easy to read and understand.
• Reports enable users to summarize, analyze, and visualize data in meaningful ways.

g. Write the difference between data and information.


Data Information
Data are raw form of any facts, figures or Information is the organized collection of inter-
entities which does not give any meaning. related data which has significant meaning
For example, Aaradhya, 1000, account, balance For example, Aaradhya has 1000 balance in his
etc. are raw data individually does not give any bank account gives significant meaning
meaning.

h. What is firewall in computer. Write its type.


Ans: A firewall is a security system that monitors and controls incoming and outgoing network
traffic to protect systems from unauthorized access and cyber threats.
Its Types are:
• Hardware Firewall: A physical device that sits between a network and its internet connection,
providing centralized protection by filtering and monitoring network traffic.
• Software Firewall: A program installed on individual computers or servers that controls and
monitors network traffic, providing protection from unauthorized access and threats.

i. Define DBMS with example.


DBMS is a computerized system that stores data, processes them and provides information in an
organized form. E.g. MS-Access, Oracle, MySQL, Fox Pro etc
5. Write down the output of the given program with dry run table. [2]
DECLARE SUB PATTERN(N)
CALL PATTERN
END
SUB PATTERN
A=2
FOR I=1 TO 5
PRINT A;
A=A+2
NEXT I
END SUB
Dry Run
A I=1 TO 5 PRINT A; A=A+2
2 1 TO 5 YES 2 2+2=4
4 2 TO 5 YES 4 4+2=6
6 3 TO 5 YES 6 6+2=8
8 4 TO 5 YES 8 8+2=10
4|P a g e CS PABSON SET A 2079 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
10 5 TO 5 YES 10 10+2=12
12 6 TO 5 NO
Output
2 4 6 8 10
6. Re-write the given program after correcting the bug. [2]

FUNCTION SUM(M, N)
REM to print sum of two numbers
A=6
B=7
DISPLAY sum(M,N)
END

FUNCTION SUM(M,N)
S=M+N
S=SUM
END FUNCTION
Debugged Program
DECLARE FUNCTION SUM(M, N)
REM to print sum of two numbers
A=6
B=7
PRINT sum(A,B)
END

FUNCTION SUM(M,N)
S=M+N
SUM=S
END FUNCTION

7. Study the following programs and answer the given questions. [2x1=2]
DECLARE FUNCTION ODDEVEN$(N)
CLS
INPUT ”Enter a number”; N
PRINT “Number is”; ODDEVEN$(N)
END

FUNCTION ODDEVEN$(N)
IF N MOD 2=0 THEN
MS$=”even”
ELSE
MS$=”odd”
END IF
ODDEVEN$=MS$
END FUNCTION
a) What is the main objective of above program?
Ans: The main objective of the above program is to check whether the input number is even or odd.
b) What is the use of MOD in above program?.
Ans: The MOD operator (modulus) is used to find the remainder of a division between two numbers.

5|P a g e CS PABSON SET A 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
Group C
8. Convert /Calculate as per the instruction. [4x1=4]
a) (1110001110)2 = (?)8
Paired Binary Digit 001 110 001 110
Binary Equivalent value 1 6 1 6
(1110001110)2 = (1616)8

b) (111)10 = (?) 2
2 111 Remainder
2 55 1
2 27 1
2 13 1
2 6 1
2 3 0
2 1 1
2 0 1

(111)10 = (1101111) 2

c) (1000) 2 – (111) 2 = (?) 2

1 0 0 0
- 1 1 1
0 0 0 1
(1000) 2 – (111) 2 = (0001) 2

d) (111111) 2 ÷ (111) 2

111) 111111( 1001


-111
000111
-111
000

Quotient = 1001
Remainder = 0

6|P a g e CS PABSON SET A 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
9. a. Write a program in QBASIC to display greater number using function procedure and
smaller number using sub procedure among three numbers.

DECLARE FUNCTION GREAT(A,B,C)


DECLARE SUB SMALL(A,B,C)
CLS
INPUT"ENTER FIRST NUMBER";A
INPUT"ENTER SECOND NUMBER";B
INPUT"ENTER THIRD NUMBER";C
PRINT"THE GREATEST NUMBER IS: ";GREAT(A,B,C)
CALL SMALL(A,B,C)
END

FUNCTION GREAT(A,B,C)
IF A>B AND A>C THEN
GREAT=A
ELSEIF B>A AND B>C THEN
GREAT=B
ELSE
GREAT=C
END IF
END FUNCTION

SUB SMALL(A,B,C)
IF A<B AND A<C THEN
PRINT"THE SMALLEST NUMBER IS ";A
ELSEIF B<A AND B<C THEN
PRINT"THE SMALLEST NUMBER IS ";B
ELSE
PRINT"THE SMALLEST NUMBER IS ";C
END IF
END SUB

b. Create a sequential data file to store name and mark obtained in English, Math and Science
subjects for few students.
OPEN “std.dat” FOR OUTPUT AS #1
DO
CLS
INPUT “Enter name”; N$
INPUT “Enter marks in English”; E
INPUT “Enter marks in math”; M
INPUT “Enter marks in science”; S
WRITE #1, N$, E, M, S
INPUT “Do you want to continue(Y/N)”; CH$
LOOP WHILE UCASE$(CH$)=”Y”
CLOSE #1
END

7|P a g e CS PABSON SET A 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
10. Write a program in C-language to display first 10 natural numbers. [4]
#include<stdio.h>
int main ( )
{
int i;
for(i=1;i<=10;i++)
{
printf(“ \n %d”,i);
}
return 0;
}
OR
Write a ‘C’ program that takes principle, rate and time as input and it calculate the simple
interest.
#include<stdio.h>
int main()
{
float p,t,r,i;
printf("enter principal: ");
scanf("%f",&p);
printf("enter time: ");
scanf("%f",&t);
printf("enter rate: ");
scanf("%f",&r);
i=(p*t*r)/100;
printf("simple interest is %f",i);
return 0;
}
***

8|P a g e CS PABSON SET A 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
Group "A"
Answer the following questions in one sentence:
a) What is a search engine?
b) What is digital currency?
c) Define MS Access.
d) What is software security?
e) What is cloud computing?
f) Write any two features of the C programming language.

Write appropriate technical terms for the following:


a) A company that provides Internet service to customers.
b) A powerful program that controls and coordinates a computer’s hardware devices and runs software and
applications.

Write the full form of the following:


a) SMTP
b) POS

Group "B"
Answer the following questions in short:
a) What is the difference between a switch and a router?
b) Define two major uses of the internet.
c) What is data sorting? Give any two examples.
d) Define online payment with an example.
e) What is hardware security? Write any two security measures of it.
f) What is a report? Mention its uses.
g) What do you understand by data redundancy?
h) What is a firewall in a computer? Write its types.
i) What is a primary key? Write its importance.

Write down the output of the given program with a dry run table:

qbasic
Copy code
DECLARE SUB NUMBER ()
CLS
CALL NUMBER
END

SUB NUMBER
N=3:C=1
WHILE C<=5
PRINT N
N=N*10+3
C=C+1
WEND
END SUB
Re-write the given program after correcting the bug:

REM To store name and age in a sequential data file STD.DOC


OPEN STD.DOC FOR OUT AS#1
CLS
INPUT "Enter name";N
1|P a g e CS PABSON SETB 2079 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
INPUT "Enter age";A
WRITE 1,N$,A
CLOSE #1
END
Group "C"
Study the following programs and answer the given questions:

DECLARE SUB question (a, b, c)


CLS
x=10: y=20 : z=15
CALL question(x,y,z)
END

SUB question(a,b,c)
a = a +10
b=b+a
c=a+b
PRINT a,b,c
END SUB
a) What would be its output if x=1, y=2, z=3?
b) Write actual and formal parameters used in the program.

Conversion/Calculation:
a) Convert (1110011010)₂ to octal.
b) Convert (255)₁₀ to binary.
c) (1001)₂ – (111)₂ = (?)₂
d) (111111)₂ ÷ (111)₂

a) Write a program in QBASIC to display the greater number using a function procedure and the smaller
number using a sub procedure among three numbers.

b) A sequential data file called "record.txt" has stored data under the field heading Roll No., Name, Gender,
English, Nepali, Maths, and Computer. Write a program to display all the information of those students whose
gender is 'F' and obtained marks in computer is more than 90.

Write a program in C-language to:


a) Display the first 10 natural numbers.
OR
b) Calculate simple interest given principal, rate, and time as input.

2|P a g e CS PABSON SETB 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
PABSON BOARD EXAMINATION 2079 [SET B]
Group "A"
Answer the following questions in one sentence: [6x1=6]
a) What is search engine ?
Ans: A search engine is a tool on the internet that helps to find information using keywords.

b) What is digital currency?


Ans: Digital currency is money that exists only in electronic form and is used for online transaction.

c) Define MS Access.
Ans: MS Access is a relational database management system developed by Microsoft which allows
users to store, manage, and analyze large volumes of data in a structured format using tables.

d) What is Software 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.

e) What is Cloud computing?


Ans: Cloud computing is a technology that allows users to access and manage computing resources
such as servers, storage, and applications over the internet.

f) Write any two features of C programming language?


Ans: Any two features of c programming language are:
a) Structured Programming: C supports breaking down programs into functions, making the code
easier to manage and understand.
b) Portability: C code can be compiled and executed on different systems with minimal
modifications.

2. Write appropriate technical terms for the following: [2x1=2]


a) A company that provides Internet service to customers. Internet Service Provider (ISP)
b) A powerful program that controls and coordinates a computer’s hardware devices and runs software
and applications. Operating System

3. Write the full form of the following: [2x1=2]


a) SMTP- Simple Mail Transfer Protocol
b) POS- Point Of Sale

Group "B"
4. Answer the following questions in short : [9x2=18]
a) What is the difference between Switch and Router?
Router Switch
The main objective of router is to The main objective of switch is to
connect various networks connect various devices
simultaneously. simultaneously.
A router can take a routing decision The switch takes more time while
much faster than a switch. making complicated routing
decisions.

b) Define two major uses of internet.


Ans: Any two major uses of internet are:
Communication: Sending emails, chatting, and video conferencing with others.
Entertainment: Watching videos, listening to music, and playing games online.
3|P a g e CS PABSON SETB 2079 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA

c) What is data sorting. Give any two examples.


Ans: 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
Examples include alphabetical sorting of names and numerical sorting of exam scores.

d) Define online payment with example.


Ans: Online payment refers to the payment for buying goods or services through the Internet using
different online payment gateway.
Eg: eSewa Nepal, iPay, Khalti, etc.

e) What is hardware security ? Write any two security measures of it.


Ans: Hardware security refers to the protection of the physical components of a computer or
electronic device from unauthorized access, theft, or damage.
Any two security measures of it are: Insurance and Regular Maintenance.

f) What is report? Mention its uses.


Ans: Report is one of the MS-Access database objects used to present information in an effective and
organized format that is ready for printing.
Its Uses are:
• Reports provide a formatted presentation of data that is easy to read and understand.
• Reports enable users to summarize, analyze, and visualize data in meaningful ways.

g. What do you understand by Data Redundancy?


Ans: Data redundancy is the duplication of data within a database.
Data redundancy can be controlled by normalizing the database, eliminating duplicate data and
storing it in separate tables, and using foreign keys to establish relationships between the tables.

h. What is firewall in computer. Write its type.


Ans: A firewall is a security system that monitors and controls incoming and outgoing network
traffic to protect systems from unauthorized access and cyber threats.
Its Types are:
• Hardware Firewall: A physical device that sits between a network and its internet connection,
providing centralized protection by filtering and monitoring network traffic.
• Software Firewall: A program installed on individual computers or servers that controls and
monitors network traffic, providing protection from unauthorized access and threats.

i) What is primary key? Write its importance.


Ans: A primary key is a unique field in a database table that identifies each record uniquely.
Its importance are:
- It reduces and control duplication of records in a table.
- It sets the relationship between tables.

5. Write down the output of the given program with dry run table. [2]
DECLARE SUB NUMBER ()
CLS
CALL NUMBER
END
SUB NUMBER
N=3:C=1
WHILE C<=5
PRINT N

4|P a g e CS PABSON SETB 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
N=N*10+3
C=C+1
WEND
END SUB
Dry Run
N C WHILE C<=5 PRINT N N=N*10+3 C=C+1
3 1 1<=5 yes 3 33 1+1=2
33 2 2<=5 yes 33 333 2+1=3
333 3 3<=5 yes 333 3333 3+1=4
3333 4 4<=5 yes 3333 33333 4+1=5
33333 5 5<=5 yes 33333 333333 5+1=6
333333 6 6<=5 no
(loop exits)

Output
3
33
333
3333
33333

6. Re-write the given program after correcting the bug. [2]

REM To store name and age in a sequential data file STD.DOC


OPEN STD.DOC FOR OUT AS#1
CLS
INPUT "Enter name";N
INPUT "Enter age";A
WRITE 1,N$,A
CLOSE #1
END

Debugged Program
REM To store name and age in a sequential data file STD.DOC
OPEN “STD.DOC” FOR OUTPUT AS#1
CLS
INPUT”Enter name”;N$
INPUT”Enter age”;A
WRITE #1,N$,A
CLOSE #1
END

7. Study the following programs and answer the given questions. [2x1=2]
DECLARE SUB question (a, b, c)
CLS
x=10: y=20 : z=15
CALL question(x,y,z)
END
SUB question(a,b,c)
a = a +10
b=b+a
c=a+b

5|P a g e CS PABSON SETB 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
PRINT a,b,c
END SUB
a) What would be its output if x=1,y=2, z=3?
Ans: The output would be 11 13 24.
b) Write actual and formal parameters used in the program.
Ans: Actual parameters- x,y,z Formal parameters-a,b,c
Group C

8. Convert /Calculate as per the instruction. [4x1=4]


a) (1110011010)2 = (?)8

Convert every 3 binary digits (from bit0) to octal digit (see conversion table below):
1110011010
= 1 110 011 010
001= 1
110=6
011=3
010=2
= 1632
(1110011010)2 = (1632)8

b) (255)10 = (?) 2

Divide by the base 2 to get the digits from the remainders:


Division Quotient Remainder
by 2 (Digit)
(255)/2 127 1
(127)/2 63 1
(63)/2 31 1
(31)/2 15 1
(15)/2 7 1
(7)/2 3 1
(3)/2 1 1
(1)/2 0 1
= (11111111)2

c) (1001) 2 – (111) 2 = (?) 2


1 0 0 1
- 1 1 1
0 0 1 0

(1001) 2 – (111) 2 = (10) 2

d) (111111) 2 ÷ (111) 2

111) 1 1 1 1 1 1 (1001
1 1 1
0 0 0 1 1 1
1 1 1
0 0 0
Q=1001 R=0

6|P a g e CS PABSON SETB 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
9. a. Write a program in QBASIC to display greater number using function procedure and
smaller number using sub procedure among three numbers.
DECLARE FUNCTION GREAT(A,B,C)
DECLARE SUB SMALL(A,B,C)
CLS
INPUT"ENTER FIRST NUMBER";A
INPUT"ENTER SECOND NUMBER";B
INPUT"ENTER THIRD NUMBER";C
PRINT"THE GREATEST NUMBER IS: ";GREAT(A,B,C)
CALL SMALL(A,B,C)
END

FUNCTION GREAT(A,B,C)
IF A>B AND A>C THEN
GREAT=A
ELSEIF B>A AND B>C THEN
GREAT=B
ELSE
GREAT=C
END IF
END FUNCTION

SUB SMALL(A,B,C)
IF A<B AND A<C THEN
PRINT"THE SMALLEST NUMBER IS ";A
ELSEIF B<A AND B<C THEN
PRINT"THE SMALLEST NUMBER IS ";B
ELSE
PRINT"THE SMALLEST NUMBER IS ";C
END IF
END SUB

b. A sequential data file called "record.txt " has stored data under the field heading Roll No.,
Name, Gender, English, Nepali ,Maths and Computer. Write a program to display all the
information of those students whose gender is 'F' and obtained marks in computer is more
than 90.
OPEN ”record.txt” FOR INPUT AS #1
CLS
WHILE NOT EOF(1)
INPUT #1,R,N$,G$,E,N,M,C
IF UCASE$(G$)=”F” AND C>90 THEN
PRINT R,N$,G$,E,N,M,C
END IF
WEND
CLOSE #1
END

7|P a g e CS PABSON SETB 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
10. Write a program in C-language to display first 10 natural numbers. [4]
#include<stdio.h>
int main ( )
{
int i;
for(i=1;i<=10;i++)
{
printf(“ \n %d”,i);
}
return 0;
}
OR
Write a ‘C’ program that takes principle, rate and time as input and it calculate the simple
interest.
#include<stdio.h>
int main()
{
float p,t,r,i;
printf("enter principal: ");
scanf("%f",&p);
printf("enter time: ");
scanf("%f",&t);
printf("enter rate: ");
scanf("%f",&r);
i=(p*t*r)/100;
printf("simple interest is %f",i);
return 0;
}
***

8|P a g e CS PABSON SETB 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
PABSON BOARD EXAMINATION 2079 [SET C]

Group A
1. Answer the following questions in one sentence.
a) Where does intranet has been used?
b) Write any two benefits of cloud computing.
c) Which data type is used to store date of birth of an employee in MS-Access?
d) Write any two data type used in MS-Access database?
e) What are procedure in QBASIC?
f) Write any two features in 'C' language.
2. Write appropriate technical term for the following.
a) The protocol that makes the network communication possible.
b) Digital marks created while using Internet.
3. Write the full form of the following.
a) ISDN
b) TCP/IP
Group B
4. Answer the following question in short.
a) Differentiate between peer to peer and client-server network with figure.
b) What is cyber ethics? Give any two example of it.
c) What is software security? Write any two measures of software security.
d) Define E-Commerce ? Write its importance.
e) Why mobile computing is necessary in present time? Write any two importance of it.
f) Differentiate between Primary key and Foreign key with example.
g) What is query? List any two advantages of it.
h) What is data sorting ? List any two advantages of using it.
i) Define form. Write its importance.
Group C
5. Write down the output of the given program. Show with dry run in table.

DECLARE SUB SERIES ()


CLS
CALL SERIES
END

SUB SERIES ( )
X=1
Y=2
FOR P =1 TO 10
PRINT X;
X=X+Y
Y=Y+1
NEXT P
END SUB

6. Re-write the given program after correcting the bugs:

REM to store record in data file


CLS
OPEN "employee.dat" FOR INPUT AS #1
DO
1|P a g e CS PABSON SET C 2079 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
INPUT "Enter Name, address and gender": NS, A. G
INPUT #1, NS, A. G
INPUT "Do you want to continue "; Y$
WHILE UCASE$(Y$) = "Y"
CLOSE "employee.dat"
END

7. Study the following program and answer the given questions:

DECLARE FUNCTION text$(N$)


CLS
INPUT "Enter any string":X$
PRINT text$(X$)
END

FUNCTION text$(N$)
FOR i=len (N$) TO 1 STEP-1
W$=W$+MID$(N$,i,1)
NEXT i
text$ = WS
NEXT Q
END FUNCTION

a) What is the main objective of above program?


b) List all the parameters used in above program.
Convert/Calculate as per the instruction.
a) (10111101)₂ = (?)₈
b) (645)₁₀ = (?)₁₆
c) (10101)₂ × (111)₂ = (?)₂
d) (111110)₂ ÷ (110)₂
8. Write a program in QBASIC to input length and breadth of room and calculate its area using
function and perimeter using sub procedure.
b) A sequential data file called "Records.dat" has stored data under the field heading Roll No., Name,
Gender, English, Nepali, Maths and Computer. Write a program to display all the records of students whose
marks in computer is more than 90.
9. Write a program in C to sum of odd number from 80 to 90.
OR
Write a program in 'C' language to input three number and find greatest number among three numbers.

Group A
1. Answer the following questions in one sentence.

a) Where does intranet has been used?


Ans: Intranet has been used to share internal information and resources within an organization.

b) Write any two benefits of cloud computing.


Ans: Any two benefits of cloud computing are
It allows to quickly and easily access and store information from anywhere in the world using the internet.
It is easier to get back-up and restore the data.

2|P a g e CS PABSON SET C 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
c) Which data type is used to store date of birth of an employee in MS-Access?
Ans: Date/Time data type is used to store date of birth of an employee in MS-Access

d) Write any two data type used in MS-Access database ?


Ans: Any two data type used in MS-Access database are text and number

e) What are procedure in QBASIC?


Ans: The procedure used in QBASIC are SUB procedure and FUNCTION procedure

f) Write any two features in 'C' language.


Ans: Any two features in 'C' language
C is a structured programming language that helps in breaking down a program into manageable
modules.
C is case-sensitive, distinguishing between uppercase and lowercase letters.

2. Write appropriate technical term for the following. [2x1=2]

a) The protocol that makes the network communication possible. TCP/IP


b) Digital marks created while using Internet. Digital Footprint

3. Write the full form of the following. [2x1=2]

(a) ISDN – Integrated Services Digital Network


b) TCP/IP – Transmission Control Protocol / Internet Protocol

Group B

Answer the following question in short. 9x2=18

a) Differentiate between peer to peer and client-server network with figure.

client-server network peer to peer network


In a client-server network, powerful computers In a peer-to-peer network, all computers have
called servers provide resources and services, equal roles and can both provide and request
while other computers, known as clients, resources without a centralized server.
access these resources and services.
Security and data management are handled by Security is managed individually on each peer.
the server. Network administrator manages and Each peer is responsible for its own security
enforces security policies. and data.

b) What is cyber ethics? Give any two example of it.


Ans: 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 examples of computer ethics are
• Do not use a computer to publish fake information.
• Do not search the file or record of other people.

(c) What is software security? Write any two measures of software 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.
Any two measures of software security are:
backup
3|P a g e CS PABSON SET C 2079 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
password

(d) Define E-Commerce ? Write its importance.


Ans: E-commerce refers to the buying and selling of goods and services over the internet.
The importance of e-commerce :
It reduces operational costs and improves customer reach.
It speeds up transactions and enhances customer convenience.

e) Why mobile computing is necessary in present time? Write any two importance of it.
Ans: Mobile computing allows users to access information and perform tasks from mobile devices.
Any two importance of mobile computing are:
It allows people to work and communicate from anywhere at any time.
It keeps connected to the Internet, allowing to access information all the times.

f) Differentiate between Primary key and Foreign key with example.


Primary key Foreign key
A primary key is a field or combination of A foreign key in MS Access is a field that
fields in a table that uniquely identifies each establishes a relationship between two tables
record, and is used to establish relationships by referencing the primary key of another table
between tables and enforce data integrity
A unique identifier for each record in a table; A field that links to the primary key of another
cannot be null. table; can be null.
Eg. Employee ID in an employee table Eg. Customer ID in an orders table, referencing
the primary key in the customer table.
g) What is query? List any two advantages of it.
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 advantages of query are:
Queries can filter and retrieve specific data based on criteria.
Queries help in organizing and summarizing data efficiently.

h) What is data sorting ? List any two advantages of using it.


Ans: The process of arranging all the records in a table either ascending or descending order based on field
or fields is known as sorting.
The advantages of sorting are:
Sorting helps to organize data and make it easier to find and retrieve specific information.
Sorting can save time and improve efficiency by allowing users to quickly access the data they need.

i) Define form. Write its importance


Ans; Form is one of the MS-Access database objects which provides graphical interface to view, modify and
add data in a table or multiple linked tables.
The importance of form are:
• Forms provide an easy-to-use interface for data entry and manipulation, improving data accuracy and
completeness.
• Forms can include validation rules to ensure data quality and prevent errors.

5. Write down the output of the given program. Show with dry run in table.

DECLARE SUB SERIES ()


CLS
CALL SERIES
END
4|P a g e CS PABSON SET C 2079 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA

SUB SERIES ( )
X=1
Y=2
FOR P =1 TO 10
PRINT X;
X=X+Y
Y=Y+1
NEXT P
END SUB

Dry run
X Y P=1 TO 10 PRINT X; X=X+Y Y=Y+1
1 2 1 TO 10 Yes 1 1+2=3 2+1=3
3 3 2 TO 10 Yes 3 3+3=6 3+1=4
6 4 3 TO 10 Yes 6 6+4=10 4+1=5
10 5 4 TO 10 Yes 10 10+5=15 5+1=6
15 6 5 TO 10 Yes 15 15+6=21 6+1=7
21 7 6 TO 10 Yes 21 21+7=28 7+1=8
28 8 7 TO 10 Yes 28 28+8=36 8+1=9
36 9 8 TO 10 Yes 36 36+9=45 9+1=10
45 10 9 TO 10 Yes 45 45+10=55 10+1=11
55 11 10 TO 10 55 55+10=65 11+1=12
Yes
66 12 11 TO 10 No
Loop Exits

The output of the program


1 3 6 10 15 21 28 26 45 55

6. Re-write the given program after correcting the bugs: [2]


REM to store record in data file
CLS
OPEN "employee.dat" FOR INPUT AS #1
DO
INPUT "Enter Name, address and gender": NS, A. G
INPUT #1, NS, A. G
INPUT "Do you want to continue "; Y$
WHILE UCASE$(Y$) = "Y"
CLOSE "employee.dat"
END

Debugged Program
CLS
OPEN "employee.dat" FOR OUTPUT AS #1
5|P a g e CS PABSON SET C 2079 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
DO
INPUT "Enter Name, address and gender": NS, A$, G$
WRITE #1, NS, A$, G$
INPUT "Do you want to continue "; Y$
LOOP WHILE UCASE$(Y$) = "Y"
CLOSE #1
END

7. Study the following program and answer the given questions: [2]
DECLARE FUNCTION text$(N$)
CLS
INPUT "Enter any string":X$
PRINT text$(X$)
END

FUNCTION text$(N$)
FOR i=len (N$) TO 1 STEP-1
W$=W$+MID$(N$,i,1)
NEXT i
text$ = WS
NEXT Q
END FUNCTION

Questions:

a) What is the main objective of above program?


Ans: The main objective of above program is to reverse the input string.

b) List all the parameters used in above program.


Ans: The parameters used in above program are X$ and N$

Group C

8. Convert/ Calculate as per the instruction.


a) (10111101) 2 = (2)8
Soln:
Paired Binary Digit 10 111 101
Binary Equivalent value 2 7 5
(10111101) 2 = (275)8

c) ( 10101) 2 X (111)

1 0 1 0 1
x 1 1 1
1 0 1 0 1
1 0 1 0 1 x
1 0 1 0 1 x x
10 0 1 0 0 1 1

(10101)2×(111) 2 = (10010011)2

b) (645) 10 = (?)16
6|P a g e CS PABSON SET C 2079 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA

16 645 Remainder
16 40 5
16 2 8
0 2
(645) 10 = (285)16

d) (111110) / (110)

110) 111110 1010


-110
00111
-110
0010
-0
10

Quotient = 1010
Remainder = 10

9. a) Write a program in QBASIC to input length and breadth of room and calculate its area using
function and perimeter using sub procedure. [Hint: Area = lxb.
Perimeter = 2(l+b)]

DECLARE FUNCTION AREA (L,B)


DECLARE SUB PERI(L,B)
CLS
INPUT “ENTER LENGTH”;L
INPUT “ENTER BREADTH”; B
PRINT “AREA OF RECTANGLE=”; AREA(L,B)
CALL PERI(L,B)
END

FUNCTION AREA(L,B)
AREA=L*B
END FUNCTION

SUB PERI(L,B)
P=2*(L+B)
PRINT “PERIMETER OF RECTANGLE=”; P
END SUB

b) A sequential data file called "Records.dat" has stored data under the field heading Roll No., Name,
Gender, English, Nepali, Maths and Computer. Write a program to display all the records of students
whose marks in computer is more than 90.

OPEN “Records.dat” FOR INPUT AS #1


CLS
7|P a g e CS PABSON SET C 2079 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
WHILE NOT EOF(1)
INPUT #1, R, N$, G$, E, N, M, C
IF C>90 THEN PRINT R; N$; G$; E; N; M; C
WEND
CLOSE #1
END

10. Write a program in C to sum of odd number from 80 to 90.

#include <stdio.h>
int main()
{
int i, s=0;
for(i=81; i<=90; i=i+2)
s=s+i;
printf("Sum of odd numbers from 80 to 90= %d", s);
return 0;
}
OR
Write a program in 'C' language to input three number and find greatest number among three
numbers.

#include <stdio.h>
int main()
{
int a, b, c;
printf("Enter any three numbers");
scanf("%d %d %d", &a, &b, &c);
if (a > b && a > c)
printf("%d is the largest number.", a);
else if (b > a && b > c)
printf("%d is the largest number.", b);
else
printf("%d is the largest number.",c);

return 0;
}
***

8|P a g e CS PABSON SET C 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
SEE PABSON Computer Science 2079 SET D

Answer the following questions in one sentence:


a) In which communication media data transfer is the fastest?
b) What is cyber-crime?
c) What is topology?
d) What is a primary key?
e) Write the types of parameters.
f) How many keywords are in the C language?

Write appropriate technical term for the following:

a. A main computer of a computer network.


b. A malicious program of computer that damages data and Software.

3.Write the full form of the following:

a) WLAN –
b) POP –

B. Answer the following questions.

a) What is data communication? Write the basic elements of data communication.


b) What is computer ethics? Write any two commandments of computer ethics.
c) What is digital citizenship? List out the major themes of digital citizenship.
d) What is online payment? Write some different modes of electronic payment.
e) What is hardware security? Write the role of UPS in hardware security.
f) What is a database? Write any two examples.
g) What is a table in Access? In how many ways can we create a table in MS Access?
h) What is an action query? Write its type.
i) Name any four objects of MS-Access.

C. Write down the output of the given program. Show with dry run in table

DECLARE SUB SERI()


CLS
CALL SERI
END

SUB SERI
X# = 1
FOR I = 1 TO 5
PRINT X# * X#
X# = X# * 10 +1
NEXT I
END SUB
D. Rewrite the given program after correcting the bugs.

REM to create sequential data file "record.dat" to enter some records.


CLS
OPEN "record.dat" FOR INPUT AS #1
UP:
INPUT "ENTER NAME";N$
1|P a g e CS PABSON SET D 2079 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
INPUT "ENTER ADDRESS";A$
INPUT "ENTER PHONE NUMBER";PH
WRITE #2, N$,A$,PH
INPUT "Do you want to continue(y/n)?";an
IF LCASE(an$)="y" THEN GOTO UP
CLOSE #1
END
E. Study the following program and answer the given questions:
DECLARE FUNCTION TEST (A)
X = 10
Z = TEST (X)
PRINT Z
END

FUNCTION TEST (B)


FOR I = 1 TO B
S=S+I*I
NEXT I
TEST= S
END FUNCTION.

a) How many parameters are used in the above program?


b) How many times does the statement S=S + I * I will be executed in the above program?

F. Convert as per instructions.


a) Convert (110111)₂ into (?)₈.
b) Convert (25AF)₁₆ into (?)₁₀.
c) Perform the operation 110110 + 100011.
d) Perform the operation 1110001 ÷ 110.

9 a.Write a program in QBasic that asks for the radius and height of a cylinder and calculates the volume
and curve surface area.
b. Write a program to display the records of those employees whose salary is more than Rs. 25,000.
10. Write a program in C language to ask to enter two numbers and find out the sum and product.
OR

Write a C program to ask to enter a number and then find out whether it is even or odd.

2|P a g e CS PABSON SET D 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
SEE PABSON Computer Science 2079 SET D
Answer the following questions in one sentence:
1. In which communication media data transfer is the fastest?
Ans . In Fiber optic cable, data transfer is the fastest.

2. What is cyber-crime?
Ans. Cybercrime refers to illegal activities carried out using computers, networks, or the internet, such as
hacking, identity theft, online fraud, and spreading malicious software.

3. What is topology?
Ans. Network topology refers to the physical or logical arrangement of network components.

4. What is primary key?


Ans. A primary key is a unique field in a database table that identifies each record uniquely.

5. Write the types of parameters?


Ans. The types of parameters are actual and formal parameters.

6. How many keywords are in C language?


Ans. There are 32 keywords in C language.

Write appropriate technical term for the following:

a. A main computer of a computer network. Server


b. A malicious program of computer that damages data and Software. Malware

3.Write the full form of the following:

a) WLAN – Wireless Local Area Network


b) POP – Post Office Protocol

B. Answer the following questions.

1.What is data communication? Write the basic elements of data communication.


Ans. Data communication is the process of transferring data and information between computers or other
electronic devices through a communication medium, such as cables or wireless signals.
The basic elements of data communication are: data (message), sender, medium, receiver and protocol.

2.What is computer ethics? Write any two commandments of computer ethics.


Ans. 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
Two commandments of computer ethics are:
Do not use a computer to publish fake information.
Do not search the file or record of other people.

3.What is digital citizenship? List out the major themes of digital citizenship.
Ans. Digital citizenship refers to the responsible and ethical use of technology and the internet which
involves understanding, practicing, and promoting appropriate behavior when using digital tools and
resources.
Major themes of digital citizenship are :
Digital Access: The state of full electronic participation in society
 Digital Commerce: The act of promoting the purchase of goods through electronic means

3|P a g e CS PABSON SET D 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
 Digital Communication: Electronic exchange of information
 Digital literacy: Teaching and learning about teaching and technology

4.What is online payment? Write some different modes of electronic payment.


Ans. Online payment refers to the payment for buying goods or services through the Internet using
different online payment gateway.
Some modes of electronic payment are:
a) Credit Card
b) Debit Card
c) Smart Card
e) Electronic Fund Transfer (EFT)

5.What is hardware security? Write the role of Ups in hardware security.


Ans. Hardware security refers to the protection of the physical components of a computer or electronic
device from unauthorized access, theft, or damage.
The role of UPS in hardware security is to provide backup power during electrical outages, preventing
data loss and damage to hardware.

6.What is database? Write any two examples.


Ans. A collection of systematically organized inter-related data which store, organize and retrieve data is
called database.
Two examples of database are : Dictionary and Marks ledger.

7.What is table in Access? In how many ways we can create a table in Ms Access?
Ans Tables are the primary building block of database which stores and manages large volume of data
into rows and column.
Ways to create a table in Ms Access are :
Design view
Datasheet view
Using wizard

8.What is action query? Write its type.


Ans. An action query is a type of query that makes changes to or removes many records in just one
operation.
It’s types are :
- Append Query: Adds new records to an existing table.
- Update Query: Modifies existing records in a table.
- Delete Query: Deletes records from a table.
- Make Table Query: Creates a new table based on data from one or more tables.

9.Name any four objects of Ms-Access .


Ans. Four objects of Ms-Access are:
- Table
- Query
- Form
- Report

4|P a g e CS PABSON SET D 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
C. Write down the output of the given program. Show with dry run in table

DECLARE SUB SERI()


CLS
CALL SERI
END

SUB SERI
X# = 1
FOR I = 1 TO 5
PRINT X# * X#
X# = X# * 10 +1
NEXT I
END SUB
Dry Run Table

X# I=1 To 5 PRINT X# * X# X# = X# * 10 +1
1 1 to 5 ‘yes’ 1 11
11 2 to 5 ‘yes’ 121 111
111 3 to 5 ‘yes’ 12321 1111
1111 4 to 5 ‘yes’ 1234321 11111
11111 5 to 5 ‘yes’ 123454321 111111
111111 6 to 5 ‘no’
Loop exits
The output of the program is
1
121
12321
1234321
123454321

D. Rewrite the given program after correcting the bugs.

REM to create sequential data file "record.dat" to enter some records.


CLS
OPEN "record.dat" FOR INPUT AS #1
UP:
INPUT "ENTER NAME";N$
INPUT "ENTER ADDRESS";A$
INPUT "ENTER PHONE NUMBER";PH
WRITE #2, N$,A$,PH
INPUT "Do you want to continue(y/n)?";an
IF LCASE(an$)="y" THEN GOTO UP
CLOSE #1
END

Debugged program
REM to create sequential data file "record.dat" to enter some records.
CLS
OPEN "record.dat" FOR OUTPUT AS #1
UP:
INPUT "ENTER NAME";N$

5|P a g e CS PABSON SET D 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
INPUT "ENTER ADDRESS";A$
INPUT "ENTER PHONE NUMBER";PH
WRITE #1, N$,A$,PH
INPUT "Do you want to continue(y/n)?";an$
IF LCASE$(an$)="y" THEN GOTO UP
CLOSE #1
END

E. Study the following program and answer the given questions:


DECLARE FUNCTION TEST (A)
X = 10
Z = TEST (X)
PRINT Z
END

FUNCTION TEST (B)


FOR I = 1 TO B
S=S+I*I
NEXT I
TEST= S
END FUNCTION.

Questions:
a) How many parameters are used in the above program?
Ans. 1 parameter is used in the above program.

b) How many times does the statement S=S + I * I will be executed in the above program?
Ans. The statement S= S + I * I will be executed 10 times.

F. Convert as per instructions.


a) (110111)2 into (?)8
Ans.
Binary digits : 110111
Grouping 3 digits : 110 111
Octal equivalent : 6 7
∴ (110111)2 = (67)8

b)(25AF)16 into (?)10


Ans.

= 2 163 + 5×162 + 10×161 + 15×160


= 2 * 4096 + 5*256 + 10*16 + 15*1
= 8192 + 1280 + 160 + 15
= 9647
(25AF)16 into (9647)10
c)110110 + 100011
Ans.
1 1 0 1 1 0
1 0 0 0 1 1
10 1 1 0 0 1
110110 + 100011 = 1011001

6|P a g e CS PABSON SET D 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA

d)1110001 ÷ 110
Ans.

110) 1 1 1 0 0 0 1 (10010
1 1 0
0 0 1 0 0 0
1 1 0
0 0 1 0 1
0
1 0 1

Q=10010
R=101

9a. Write a program in QBasic that ask the radius and height of a cylinder and calculate the
volume and curve surface area. Create a user-defined function to calculate volume and sub-
procedure to calculate curve surface area of a cylinder. [Hints: V=πr2 h, CSA=2πrh]
Ans.
DECLARE FUNCTION VOL(R,H)
DECLARE SUB CSA(R,H)
CLS
INPUT “ENTER THE RADIUS”;R
INPUT “ENTER THE HEIGHT”;H
PRINT “THE VOLUME OF CYLINDER IS ”;VOL(R,H)
CALL CSA(R,H)
END

FUNCTION VOL(R,H)
VOL = 3.14*R*R*H
END FUNCTION
SUB CSA(R,H)
C = 2*3.14*R*H
PRINT “THE CURVE SURFACE AREA OF CYLINDER IS ”; C
END SUB

b. A sequential data file called "Emp.dat" has stored data under the field heading name, post and
salary. Write a program to display the records of those employees whose salary is more than Rs.
25000.
Ans.
OPEN “Emp.dat” FOR INPUT AS #1
CLS
WHILE NOT EOF(1)
INPUT #1,N$,P$,S
IF S > 25000 THEN PRINT N$,P$,S
WEND
CLOSE #1
END

7|P a g e CS PABSON SET D 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA

10. Write a program in C language to ask to enter two numbers and find out sum and product.
Ans.
#include<stdio.h>
int main()
{
Int a,b,s,p;
printf(“enter first number “);
scanf(“%d”,&a);
printf(“enter second number ”);
scanf(“%d”, &b);
s = a + b;
p = a * b;
printf(“the sum of two numbers is %d”,s);
printf(“the product of two numbers is %d”,p);
return 0;
}

Write a C program to ask to enter a number then find out whether it is even or odd.
Ans.
#include<stdio.h>
Int main()
{
Int n;
printf(“enter any number”);
scanf(“%d”,&n);
if(n%2 = = 0)
printf(“The given number is even”);
else
printf(“The given number is odd”);
return 0;
}

8|P a g e CS PABSON SET D 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
10. JOINT EXAMINATION BOARD (PABSON BHAKTAPUR) 2079
Group A (10 Marks)

(a) What is an e-mail?


E-mail is the most widely used service on the Internet which sends and receives messages electronically
through the Internet

(b) What is cyber law?


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

(c) What is bandwidth?


The amount of data that can be carried from one point to another in a given time period is called bandwidth.

(d) Write any two data types of MS-Access.


Any two data type of MS Access are Date/Time and Currency

(e) What is parameters?


Parameters are variables which are used to specify or declare types of data to be passed to the procedures
either sub or function

(f) What is C?
C Language is a high-level structured programming language which is used to develop system software.

2. Write appropriate technical term for the following


(a) Law that governs the legal issues of cyberspace. Cyber Law
(b) Business through internet. E-commerce

3. Write the full form of the following:


UTP – Unshielded Twisted Pair
IoT – Internet of Things

4. Answer the following questions:


(a) Define mode of communication.
Data transmission mode is the way of transmission of data from one location to another.
There are three types of transmission mode:
Simplex mode
Simplex mode is the transmission of data and information that takes place in only one direction. It is a
unidirectional mode of data transmission.
Radio, newspaper, television broadcasting, books etc. are examples of simplex mode.
Half duplex mode
Half-duplex is the transmission of data and information that flows in both directions but only one direction
at a time.
Walky-talky and wireless handset are examples of half-duplex mode.
Full duplex mode
Full duplex mode is the transmission of data and information that flows in both direction simultaneously on
the transmission path.
Mobile and landline phones are examples of full duplex mode

(b) What is digital footprint? Write any two tips to maintain digital reputation.
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.
Any two tips to maintain digital reputation are:
1|P a g e CS PABSON BKT JEC 2079 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
Be Mindful of What You Share: Always think before posting anything online.
Regularly Review and Update Privacy Settings: Frequently check the privacy settings on your
social media accounts and other online platforms.

(c) What is password Policy? Write any two important criteria for creating strong password.
A password policy is a set of rules or guidelines designed to ensure that passwords are secure.
Any two important criteria for creating strong password are
 Don't use easily guessable the name of a pet, child, family member, birthdays, birthplace, name of a
favourite holiday.
 Mix characters, numbers and symbols. Also, mix small and capital letters.

(d) What is e-commerce? Write any two advantages of e-commerce.


E E-commerce, or electronic commerce, refers to the buying and selling of goods and services over the
internet.
Advantages of E-commerce
• Faster buying/selling procedure, as well as easy to find products.
• There are no geographical limitations, can deliver service globally.

(e) What is loT? Write any two advantages of it.


Internet of Things (IoT) is a network of physical objects embedded with sensors, software, and other
technologies, allowing them to connect to the internet and communicate with each other.
Advantages of Internet of Things (IoT)
• It enables convenient control of home appliances.
• Information is easily accessible from any place at any time on any device.

(f) What is DBMS? Write any two examples.


DBMS is a computerized system that stores data, processes them and provides information in an organized
form. E.g. MS-Access, Oracle, MySQL, Fox Pro etc

(g) What is MS Access? Write any two advantages of it.


MS-Access is a relational database management system developed by Microsoft Corporation which is used
to store and manipulates large volume of data in multiple tables.

Any two advantages of Ms-Access are:


a) It provides the flexible ways to add, edit, delete and display the related data.
b) Queries help to view, change and analyse the data indifferent ways.

(h) What is query? Write its type.


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.
Its types are:
Select query is a type of query which is used to select and display the relevant data from the
database.
Action query is a query that makes changes to or removes many records in just one operation. Types
of action query are Update, Delete, Append and Make Table query.

( i) What is data type? Write some data types of ms-access.


Data type is an attribute for a field that determines the type of data that can be stored in that field.
Some data types of ms-access are: Text, Memo, Number, Currency etc.

2|P a g e CS PABSON BKT JEC 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
2 k. Write the output of the following program.

DECLARE SUB seri()


CLS
CALL seri
END
SUB seri

a$="KATHMANDU”
b=LEN(a$)
FOR I=1 TO 5
PRINT TAB(I); MID$(a$, i, b)
b=b-2
NEXT I
END SUB

a$ b=LEN(a$) I=1 TO 5 PRINT TAB(I); b=b-2


MIDS(a$, i, b)
KATHMANDU 9 1 TO 5 yes KATHMANDU 9-2=7
2 TO 5 yes ATHMAND 7-2=5
3 TO 5 yes THMAN 5-2=3
4 TO 5 yes HMA 3-2=1
5 TO 5 yes M 2-1=1
6 TO 5 No

The output of the program is:


KATHMANDU
ATHMAND
THMAN
HMA
M

J. Rewrite the following program after correcting it.


Rem To print only class 10 record from "student.dat"
CLS
OPEN "T", #2, "Student.Dat"
WHILE NOT EOF (#2)
WRITE#2, N$, C,R
IF C = 10 THEN
DISPLAY N$, C, R
END IF
NEXT
CLOSE #2
END

Debugged Program
Rem To print only class 10 record from "student.dat"
CLS
OPEN "T", #2, "Student.Dat"
WHILE NOT EOF (2)
INPUT#2, N$, C,R

3|P a g e CS PABSON BKT JEC 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
IF C = 10 THEN
PRINT N$, C, R
END IF
WEND
CLOSE #2
END

(1) Read the following program and answer the questions given below.
DECLARE FUNCTION TEST (X)
CLS
Y = 100
Z = TEST (Y)
PRINT Z
END
FUNCTION TEST (A)
FOR I = 1 TO A
S=S+I
NEXT I
TEST = S
END FUNCTION

(a) List the different parameter used in the above program with their types.
Formal Parameters are A and X
Actual parameter is Y
(b) List the different operators used in the above program with their types.
Arithmetic operator is +
Relational operator is =

5. Convert/Calculate as per the instruction:


(a) (110111)2 into (Decimal)
= (1 × 2⁵) + (1 × 2⁴) + (0 × 2³) + (1 × 2²) + (1 × 2¹) + (1 × 2⁰)
=1 × 32 + 1 × 16 + 0 × 8 + 1 × 4 + 1 × 2 + 1 × 1
= 32+16+0+4+2+1
= (55)₁₀
(110111)₂ = (55)₁₀
b) (25AF)16 into (Binary)
Convert each hex digit to 4 binary digits (see conversion table below):
25AF
=25AF
=
= 0010010110101111
Hexadecimal digit 2 5 A F
Binary Equivalent value 0010 0101 1010 1111
(25AF)16 into (001001011010111)

(c) 11110+10011
11110
+10011
0110001
11110 + 10011 = 0110001

(d) 1110110

4|P a g e CS PABSON BKT JEC 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
110 ) 1110 ( 10
-110
10
-0
10
Quotient – 10
Remainder = 10
Group C (16 Marks)

6 . (a) Write a program in QBASIC that asks length,breadth and height of a room and calculates its
area and volume. Create a user-defined
function to calculate area and sub-program to calculate volume. [Hints: Area = LxB, Volume = L x B
x H)

DECLARE FUNCTION AREA(L,B)


DECLARE SUB VOL(L,B,H)
CLS
INPUT “Enter Length”; L
INPUT “Enter Breadth”; B
INPUT “Enter Height”; H
PRINT “Area of room=”; AREA(L,B)
CALL VOL(L,B,H)
END

FUNCTION AREA(L,B)
AREA = L * B
END FUNCTION

SUB VOL(L,B,H)
V=L*B*H
PRINT “Volume of Room=”; V
END SUB

(b) Write a program to update the rate by increasing 10% from a sequential data file "Data.dat" that
store item name, rate and quantity.
OPEN "DATA.DAT" FOR INPUT AS#1
OPEN "TEMP.DAT" FOR OUTPUT AS #2
CLS
WHILE NOT EOF (1)
INPUT #1, N$, R, Q
R1 = R + 10/100 * R
WRITE #2, N$, R1, Q
WEND
CLOSE #1, #2
KILL "DATA.DAT"
NAME "TEMP.DAT" AS "DATA.DAT"
END

Write a program in C language to ask to enter base and height of a triangle then calculate its area.
#include<stdio.h>
#include<conio.h>
int main()
{
5|P a g e CS PABSON BKT JEC 2079 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
int b,h;
float a;
printf("Enter base: ");
scanf("%d", &b);
printf("Enter height: ");
scanf("%d", &h);
a=(b*h)/2;
printf("Area of triangle= %.2f", a);
return 0;
}

Or,

Write a C program to find the sum of first 10 natural numbers.


#include <stdio.h>
int main()
{
int j, sum = 0;
printf("The first 10 natural number is :\n");
for (j = 1; j <= 10; j++)
{
sum = sum + j;
printf("%d ",j);
}
printf("\nThe Sum is : %d\n", sum);
}

6|P a g e CS PABSON BKT JEC 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
Group-A
(Very Short Questions - 10 Marks)
1) Answer the following questions:
a) Define Bandwidth.
b) What is digital citizenship?
c) Name any two modes of Electronic Payments.
d) Define relationship.
e) What do you mean by modular programming?
f) Write any two data types used in C language.

2) Give the appropriate technical terms of the following:


a) Hacking done with permission from the client.
b) The process of identifying an individual usually based on a username and password.

3) Write the full forms for the following:


a) SMTP b) VRML

Group-B
(Short Questions - 24 Marks)
4) Answer the following questions:
a) Define data communication. Write its components.
b) Write any two Opportunities and Threats in Social Media.
c) What is software security? List any two security mechanisms of Computer Hardware Security.
d) Define M-commerce. Write any four examples of M-Commerce.
e) What do you mean by IoT? List its any two advantages.
f) What is DBMS? Write any two advantages of DBMS.
g) Define the term Validation Rule and Validation Text.
h) Differentiate between select query and update query.
i) Define Data types. List any four names of the data types.

FIND OUTPUT ALONG WITH DRY RUN

DECLARE SUB SERIES ( )


CLS
CALL SERIES
END
SUB SERIES
A$="NEPAL"
B=1
FOR I=1 TO LEN(A$) STEP 2
IF B < > 3 THEN
PRINT MID$(A$,B,I)
ELSE
PRINT MID$(A$,1,I)
END IF
B=B+1
NEXT I
END SUB
Debug

DECLARE FUNCTION vowel(S$)


w$=we love our country
v=vowel(w$)
1|P a g e CS PABSON BKT JEC 2079 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
PRINT "The total no. of vowel::"; v
END
FUNCTION vowel$(S$)
c=0
FOR K=1 TO length(S$)
B$=MID$(S$, K, 1)
B$=LCASE$(B$)
SELECT CASE B$
CASE "a", "e", "i", "o", "u"
c=c+1
END SELECT
NEXT K
C=vowel
END FUNCTION
Analytical Questions

OPEN “MARKINFO.TXT” FOR INPUT AS #1


OPEN “TEMP.TXT” FOR OUTPUT AS #2
CLS
DO UNTIL EOF(1)
INPUT #1, REGISTRATIONNUMBER, STUDENTNAME$, ENGLISH, NEPALI, MATHEMATICS
IF MATHEMATICS<20 THEN
MATHEMATICS=MATHEMATICS+10
END IF
WRITE #2, REGISTRATIONNUMBER, STUDENTNAME$, ENGLISH, NEPALI, MATHEMATICS
LOOP
CLOSE#1
CLOSE #2
KILL “MARKINFO.TXT”
NAME “TEMP.TXT” AS “MARKINFO.TXT”
END
Analytical Questions
a) What is the main objective of the program given above?
b) Do you get any problem in the above program if the "Kill" statement is removed? Give a reason.

Calculate/Convert as per the instructions:


a) (101010)2×(101011)2−(100101)2
b) (1001011)2÷(10101)2
c) (DEF42)16=(?)8 d) (986)10=(?)2

Programming Questions
9. a) Write a QBASIC program that asks for the length, breadth, and height, and calculates the Volume of a
Cuboid and Total Surface Area. Create a USER-DEFINED FUNCTION to calculate the Volume of a
Cuboid and a SUB-PROGRAM to calculate the Total Surface Area.

b) A sequential data file "records.dat" contains S.NO., Name, Address, Telephone No, and Email Address.
Write a program to count and display those records whose email address ends in the "yahoo.com" domain.
Your display should be in tabular format, showing the fields Name, Address, and Email address only.
10. Write a program in C language that asks for a number and checks whether the number is Positive,
Negative, or Zero.
OR
Write a program in C language to display the series with their sum 7,10,13,16,…7, 10, 13,
16,\dots7,10,13,16,… up to the 10th term.
2|P a g e CS PABSON BKT JEC 2079 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
Group-A
(Very Short Questions-10 Marks)
1) Answer the following questions:

a) Define Bandwidth.
Ans: Bandwidth is the maximum amount of data that can be sent or received over a network in a specific
amount of time.

b) What is digital citizenship?


Ans: Digital citizenship refers to the responsible and ethical use of technology and the internet which
involves understanding, practicing, and promoting appropriate behavior when using digital tools and
resources.

c) Name any two modes of Electronic Payments.


Ans: Any two modes of electronic payments are:
a) Credit Card
b) Mobile wallets

d) Define relationship.
Ans: A relationship is a connection between two or more tables that defines how data in those tables is
related to each other.

e) What do you mean by modular programming?


Ans: Modular programming is a technique used to divide program into many small logical, manageable and
functional modules or blocks.

f) Write any two data types used in C language.


Ans: Any two data types used in C language are:
i) int
ii) char

2) Give the appropriate technical terms of the following:


a) Hacking done with permission from the client. Ethical Hacking
b) The process of identifying an individual usually based on a username and password. Authentication

3) Write the full forms for the following:


SMTP- Simple Mail Transfer Protocol
VRML- Virtual Reality Modeling Language

Group-B
(Short Questions-24 Marks)
4) Answer the following questions:
a) Define data communication. Write its components.
Ans: Data communication is the process of transferring data and information between computers and other
electronic devices.
Its components are:
Data (message) : Data is to be communicated between sender and receiver.
Sender : Sender is a device used to transfer data.
Medium: Medium is a channel through which sender and receiver make communication.
Receiver: Receiver is a device used to receive data.
Protocol: Protocol is a set of rules followed by sender and receiver.

3|P a g e CS PABSON BKT JEC 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
b) Write any two Opportunities and Threats in Social Media.
Opportunities of using social media
1. Social media let us share anything with others around the world.
2. It keeps us informed about the world.

Threats of using social media


1. Personal data and privacy can be easily hacked and shared on the internet.
2. Spreading false or unreliable information.

c) What is software security? List any two security mechanism of Computer Hardware Security.
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.
Any two security mechanism of Computer Hardware Security are:
i) Insurance
ii) Regular maintenance

d) Define M-commerce. Write any four examples of M-Commerce.


Ans: M-Commerce refers to the process of buying and selling of goods and services through wireless
handheld devices such as smartphones, tablets or personal digital assistants (PDAs).
Any four examples of M-Commerce are:
Purchasing airlines / movie tickets, Restaurant / Hotel booking and reservation, Fund Transfer, Top – Up
Charges Fund Transfer etc.

e) What do you mean by Iot? List its any two advantages.


Ans: The Internet of Things (IoT) refers to a network of physical devices that are connected to the internet,
allowing them to collect, share, and act on data.
Its two advantages are:
• Information is easily accessible from any place at any time on any device.
• It enables convenient control of home appliances.

f) What is DBMS. Write any two advantages of DBMS.


Ans: DBMS is a computerized system that stores data, processes them and provides information in an
organized form.
Any two advantages of DBMS are:
a) It reduces data redundancy which means duplication of data.
b) It allows multiple users to access the same data simultaneously.

g) Define the term Validation Rule and Validation Text.


Ans: Validation Rule is a field property which is used to limit the values that can be entered into a field.
Validation Text is a field property which displays an error message that appears if the data entered is invalid
according to the specified validation rule.

h) Differentiate between select query and update query.


Select Query Update Query
- Select query is a type of query which is - An update query is a type of query
used to select and display the relevant data that makes entire changes to a record
from the database.. or group of records in one or more
- The Select query is used to select data from tables
a database. - The Update query is used to update existing
records in a table.

4|P a g e CS PABSON BKT JEC 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
i)Define Data types. List any four names of the data types.
Ans: Data type is an attribute for a field that determines the type of data that can be stored in that field.
Any four names of data types are:
i) Text
ii) Number
iii) Memo
iv) Currency

FIND OUTPUT ALONG WITH DRY RUN

DECLARE SUB SERIES ( )


CLS
CALL SERIES
END
SUB SERIES
A$="NEPAL"
B=1
FOR I=1 TO LEN(A$) STEP 2
IF B < > 3 THEN
PRINT MID$(A$,B,I)
ELSE
PRINT MID$(A$,1,I)
END IF
B=B+1
NEXT I
END SUB

DRY RUN
A$ B 1 TO 5 STEP 2 B< > 3 YES -PRINT No- PRINT B=B+1
MID$(A$,B,I) MID$(A$,1,I)
NEPAL 1 1 TO 5 YES 1 < > 3 YES N 1+1=2
2 3 TO 5 YES 2 < > 3 YES EPA 2+1=3
3 5 TO 5 YES 3 < > 3 NO NEPAL 3+1=4
4 7 TO 5 NO
LOOP EXITS
OUTPUT
N
EPA
NEPAL

Debug

DECLARE FUNCTION vowel(S$)


w$=we love our country
v=vowel(w$)
PRINT "The total no. of vowel::"; v
END
FUNCTION vowel$(S$)
c=0
FOR K=1 TO length(S$)
B$=MID$(S$, K, 1)

5|P a g e CS PABSON BKT JEC 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
B$=LCASE$(B$)
SELECT CASE B$
CASE "a", "e", "i", "o", "u"
c=c+1
END SELECT
NEXT K
C=vowel
END FUNCTION

Debugged Program

DECLARE FUNCTION vowel(S$)


w$="we love our country"
v=vowel(w$)
PRINT "The total no. of vowel::"; v
END
FUNCTION vowel(S$)
c=0
FOR K=1 TO LEN(S$)
B$=MID$(S$, K, 1)
B$=LCASE$(B$)
SELECT CASE B$
CASE "a", "e", "i", "o", "u"
c=c+1
END SELECT
NEXT K
vowel = c
END FUNCTION

Analytical Questions

OPEN “MARKINFO.TXT” FOR INPUT AS #1


OPEN “TEMP.TXT” FOR OUTPUT AS #2
CLS
DO UNTIL EOF(1)
INPUT #1, REGISTRATIONNUMBER, STUDENTNAME$, ENGLISH, NEPALI, MATHEMATICS
IF MATHEMATICS<20 THEN
MATHEMATICS=MATHEMATICS+10
END IF
WRITE #2, REGISTRATIONNUMBER, STUDENTNAME$, ENGLISH, NEPALI, MATHEMATICS
LOOP
CLOSE#1
CLOSE #2
KILL “MARKINFO.TXT”
NAME “TEMP.TXT” AS “MARKINFO.TXT”
END

a) What is the main objective of the program given above?


The main objective of the program given above is to increase marks of math by 10 whose marks in math is
less than 20.
b) Do you get any problem in above program if “Kill” statement is removed? Give reason.
Yes, there will be a problem in the above program if the "KILL" statement is removed. If the "KILL"
statement is removed, the program will not be able to delete the existing "MARKINFO.TXT" file.
6|P a g e CS PABSON BKT JEC 2079 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA

8) Calculate/Convert as per the instructions:


a) (101010)2 × (101011)2-(100101)2

1 0 1 0 1 0
x 1 0 1 0 1 1
1 0 1 0 1 0
1 0 1 0 1 0 x
0 0 0 0 0 0 x x
1 0 1 0 1 0 x x x
0 0 0 0 0 0 x x x x
1 0 1 0 1 0 x x x x X
1 1 1 0 0 0 0 1 1 1 0
- 1 0 0 1 0 1
1 1 0 1 1 1 0 1 0 0 1

(101010)2 × (101011)2-(100101)2 = (11011101001)2

b) (1001011)2 ÷ (10101)2

10101) 1 0 0 1 0 1 1 (11
1 0 1 0 1
1 0 0 0 0 1
1 0 1 0 1
0 0 1 1 0 0

Q=11
R=1100

c) (DEF42)16 =(?)8

Convert each hex digit to 4 binary digits and then convert each 3 binary digits to octal digits (see conversion
tables below):
DEF42
=DEF42
D= 1101
E =1110
F=1111
4 =0100
2=0010
= 11 011 110 111 101 000 010
011=3
011 =3
110=6
111=7
101=5
000=0
010=2

=3367502
7|P a g e CS PABSON BKT JEC 2079 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
(DEF42)16 =(3367502)8

c) (986)10 = (?)2

Divide by the base 2 to get the digits from the remainders:


Division Quotient Remainder
by 2 (Digit)
(986)/2 493 0
(493)/2 246 1
(246)/2 123 0
(123)/2 61 1
(61)/2 30 1
(30)/2 15 0
(15)/2 7 1
(7)/2 3 1
(3)/2 1 1
(1)/2 0 1
= (1111011010)2

(986)10 = (1111011010)2

9. a) Write a QBASIC program that asks length, breadth, height and calculate Volume of Cuboid and
Total Surface Area. Create a USER DEFINED FINCTION to calculate Volume of Cuboid and SUB-
PROGRAM to calculate Total Suface of Area.
DECLARE FUNCTION VOL(L,B,H)
DECLARE SUB TSA(L,B,H)
CLS
INPUT”Enter length”;L
INPUT”Enter breadth”;B
INPUT”Enter height”;H
PRINT”Volume of cuboid= “;VOL(L,B,H)
CALL TSA(L,B,H)
END

FUNCTION VOL(L,B,H)
VOL=L*B*H
END FUNCTION

SUB TSA(L,B,H)
T=2*(L*B+B*H+L*H)
PRINT”Total surface area of cuboid=”;T
END SUB

8|P a g e CS PABSON BKT JEC 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
b) A sequential data file"records.dat" contains S.NO., Name, Address, Telephone No and Email
Address. WAP to count and display those records whose email address ends in "yahoo.com" domain.
Your display should be in tabular format having the fields Name, Address and Email address only.
OPEN "records.dat" FOR INPUT AS #1
CLS
WHILE NOT EOF(1)
INPUT #1, SN, N$, A$, T, E$
IF LCASE$(RIGHT$(E$,9))="yahoo.com"
THEN PRINT N$,A$,E$
C=C+1
END IF
WEND
PRINT "TOTAL NO. OF HAVING YAHOO EMAIL ADDRESS ARE"; C
CLOSE #1
END

10. Write a program in C language that asks a number check whether number is Positive, Negative or
zero.
#include<stdio.h>
int main()
{
int n;
printf("Enter any number: ");
scanf("%d",&n);
if(n>0)
printf("The given number is positive");
else if(n<0)
printf("The given number is negative");
else
printf("The given number is zero");
return 0;
}

OR
Write a program in C language to display the series with their sum 7, 10, 13, 16…… upto 10th term.
#include<stdio.h>
int main()
{
int n=7,i,s=0;
for(i=1;i<=10;i++)
{
printf("%d ",n);
s=s+n;
n=n+3;
}
printf("\nsum= %d",s);
return 0;
}

9|P a g e CS PABSON BKT JEC 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
(a) Define Computer security.
Computer security refers to protecting computer and its content from damage, theft or misuse and action to
prevent such incidents

(b) What is e-commerce?


E-Commerce refers to electronic transactions such as buying, selling and exchanging of goods, services and
information over computer communication network such as the Internet.

(c) Define Keyword with example.


Keyword is a set of special words which are already defined for some tasks.
E.g. auto, double, int, long etc

(d) Why C is called a middle level language?


C is called middle level language because it combines elements of high level language with some features of
assembler

(e) Which data type is used to store your school fee in MS-Access?
Currency is the data type used to store school fee in MS-Access.

(f) Define Form.


Form is one of the MS-Access database objects which provides graphical interface to view, modify and add
data in a table or multiple linked tables.

2. Write appropriate technical term.

(a) Arrangements of nodes in a Network. Topology

(b) A concept of transferring data from your computer to server Computer. Uploading

3. Write the full form.

(a) SMTP – Simple Mail Transfer Protocol


(b) SIM – Subscriber Identification Module

(a) Define Network Architecture. List out its types.


Network architecture defines how the computer communicates and interacts with each other on network.
Its types are:
1. Peer to Peer Network
2. Client-Server Network
3. Centralized Network

(b) Write any two measures to protect hardware and explain.


Any two measures to protect hardware are:
Regular Maintenance
Computer system need regular maintenance to keep the computer hardware in good working condition and it
also helps to find out problems in hardware and correct the problems before they cause several damages.
Power Protection Device
An electric device that controls electric voltage and provides enough backup to the computer system when
there is power failure. Computer needs 220 volts to 240 volts constantly. Some common power protection
devices are:
a) UPS
b) Volt Guard
c) CVT (Constant Voltage Transformer) etc.
1|P a g e CS PABSON BKT JEC 2079 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA

(c) Write down the advantages of internet.


The advantages of internet are:
a) Internet has an endless knowledge supply which anyone can access that too free of cost.
b) Selling and buying has become so easy with the use of internet and it has helped millions to sell and
buy their goods online.
c) Internet has given us E-Mail which is fast, secure and reliable mode of communication.
d) It makes easy to transfer the file or information.

( d) "Al is for the aid of people not their against. Explain.


AI is an emerging branch in computer science, which interprets the means and method of making
computers think like human beings. AI is for the aid of people not their against. AI reduces labor and
operational costs by automating tasks. AI processes and analyzes data faster than humans, leading to
quicker decision-making. AI can automate repetitive tasks, saving time and reducing errors. AI
systems can work continuously (24/7) without rest
(e) What is cyber-crime? Explain any one of them

Cyber crime refers to criminal activities that are carried out using computers, networks and the internet.
Phishing is the fake attempt to obtain sensitive information such as usernames, passwords and credit card
details by disguising oneself as a trustworthy entity in an electronic communication

(f) Define database. Given some examples of RDBMS software.


A collection of systematically organized inter-related data is called a database. The purpose of data base is to
store, organize and retrieve data. some examples of RDBMS software : MySQL, Oracle, MS Access,
MariaDB

(g) What is query? List out its types.


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.
Its types are:
Select query is a type of query which is used to select and display the relevant data from the
database.
Action query is a query that makes changes to or removes many records in just one operation. Types of
action query are Update, Delete, Append and Make Table query

(h) List out the objects of MS-Access. Explain about table.


The objects of MS-Access are table, form, query and report.
Tables are the primary building block of database which stores and manages large volume of data into rows
and column. Tables are essential for creating forms, queries, and reports that extract useful insights and
information from data. Tables provide security features to restrict access to sensitive data and ensure data
privacy

(1) What is report? Write down its 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.
Its important is to present data from one or more tables in a formatted and organized manner, allowing users
to easily view and analyze the information

5. Write down the output of given program.

2|P a g e CS PABSON BKT JEC 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
DECLARE FUNCTION ABC$(X$)
CLS
INPUT "Enter a string"; A$
PRINT ABC$("COMPUTER")
END

FUNCTION ABC$(X$)
C=4
FOR i=1 to 1
BS=MID$(X$,4,3)
NEXT I
ABC$=B$
END FUNCTION

Dry Run
A$ C i=1 to BS=MID$(A$,4,3) ABC$=B$ PRINT
1 ABC$("COMPUTER")
COMPUTER 4 1 to 1 MID$(X$,4,3)= PUT PUT
yes PUT
2 to 1
No
Loop
Exits
The output of the program is:
PUT

6. Re-write the program after correcting the bug.


DECLARE SUB sbn()
CLS
CALL SUB sbn (14)
END SUB

SUB sbn()
INPUT "enter the variable value”; var
PRINT "Square of given number"; var^2
END

Debugged Program

DECLARE SUB sbn( )


CLS
CALL sbn
END

SUB sbn( )
INPUT "enter the variable value”; var
PRINT "Square of given number"; var^2
END SUB

3|P a g e CS PABSON BKT JEC 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
7. Study the following program and answer the given questions.

OPEN "student.txt" FOR OUTPUT AS #1


OPEN "Tem.txt" FOR INPUT AS #2
WHILE NOT EOF (2)
INPUT #2, reg, Name$, Add$
IF reg>10 AND reg <20 then
WRITE #1, reg, Name$, Add$
END IF
WEND
CLOSE #1, #2
END

( a) Write down the mode used in above program


Ans: The mode used in above program are INPUT and OUTPUT mode.

(b) Write the name of String variable used in file based on above program.
Te name of String variable used in file based on above program are :
Name$, Add$

Group C

8. Convert/Calculate as per instruction.

(a) (2079)10 into binary

2 2079 Remainder
2 1039 1
2 519 1
2 259 1
2 129 1
2 64 1
2 32 0
2 16 0
2 8 0
2 4 0
2 2 0
1 0
0 1

(2079)10 = (100000011111)2

(b) (CAD)16 into Octal

Converting Hexadecimal to Binary


4|P a g e CS PABSON BKT JEC 2079 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
C = 1100
A = 1010
D = 1101
=(110010101101)2

Again, Converting Binary to Octal


110 = 6
010 = 2
101 = 5
101 = 5
(CAD)16 into (6255)8

(c) (11001110)+(110011)
11001110
+110011
100000001

(11001110)+(110011) = (100000001)

(d) (101001)(101)

101 ) 101001 ( 1000


-101
000001
- 0
1
Quotient – 1000
Remainder - 1

9. Write a program to find area of four walls using FUNCTION... END perimeter of rectangle using
SUB...END SUB.

DECLARE FUNCTION AREA (L,B, H)


DECLARE SUB PER(L,B)
CLS
INPUT “Enter Length”; L
INPUT “Enter Breadth”; B
INPUT “Enter Height”; H
PRINT “Area of four walls=”; AREA(L,B, H)
CALL PER(L,B)
END

FUNCTION AREA(L,B)
AREA = 2*H*(L+B)
END FUNCTION

SUB PER(L,B)
P=2*(L+B)
PRINT “Perimeter of rectangle=”; P
END SUB

5|P a g e CS PABSON BKT JEC 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
10. Write a program to read the data from the file "empinfo.txt" and display their NAME, EMPID,
POST whose POST is Clerk.

OPEN "empinfo.txt" FOR INPUT AS #1


CLS
WHILE NOT EOF (1)
INPUT #1, N$, E, P$
IF UCASE$(P$) = “CLERK” THEN PRINT N$, E, P$
WEND
CLOSE #1
END

11. Write a program to read a number and test whether it is positive and negative using C-
programming.

#include<stdio.h>
#include<conio.h>
int main()
{
int n;
printf("Enter any number: ");
scanf("%d", &n);
if(n>0)
printf("%d is positive number",n);
else if(n<0)
printf("%d is negative number",n);
return 0;
}

6|P a g e CS PABSON BKT JEC 2079 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
SOLVED PABSON 2080 (KOSHI)
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: [6x1=6]

a) Write the different modes of communication.


Ans: The different modes of communication are simplex, half duplex and full duplex.

b) What to loT?
Ans: IoT (Internet of Things) refers to the network of interconnected devices that communicate and
exchange data via the internet.

c) List the different LAN topology.


Ans: The different LAN topologies are bus, star and ring topology.

d) What is Global Variable in QBasic?


Ans: A global variable is a variable that is declared outside any function and is accessible from any
part of the program.

e) What is tuple?
Ans: A tuple is a row in a table which contains information about single items in a database.

f) Write any two data types used in C-language.


Ans: The two data types used in C language are int and float.

2.Write appropriate technical term for the following:

a) Sending and receiving messages electronically through the Internet. Email (Electronic Mail)
b) Services provided by the government to public via electronic media especially using Internet.
E-Governance (Electronic Governance)

3. Write the full form of the following:

a) FTP - File Transfer Protocol


b) B2B - Business to Business

4. Answer the following questions

a) What is computer network? Write any two advantages of computer network.


Ans: Computer network is a group of two or more computers and devices connected to each other
through wired or wireless media to exchange data and information and share hardware, software and
other resources.
Any two advantages of computer network are:
A network connected computers can share hardware devices such as scanner, printer, hard disk, etc.
It can communicate and share information all over the world through Internet.

1|P a g e CS SEE KOSHI 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
b) List any four areas where Al can help us.
Ans: Any four areas where Al can help us
• Robotics – AI is used in robotics to control robots and make them perform task autonomously.
• Gaming - The AI machines can play strategic games like chess, where the machine needs to think
of a large number of possible places.
• Natural Language Processing − It is possible to interact with the computer that understands
natural language spoken by humans.
• Security - AI is used in facial recognition, threat detection, and cybersecurity

c) What is digital Footprint? Write any two points to reduce the size of digital footprint while using
internet.
Ans: A digital footprint is the trail of data left behind by users on the internet.
any two points to reduce the size of digital footprint while using internet are:
- avoid sharing personal information publicly
- regularly delete unused accounts.

d) Mention the benefits and limitations of E-commerce .


Ans: The benefits and limitations of E-commerce are:
Advantages of E-commerce
• Faster buying/selling procedure, as well as easy to find products.
• There are no geographical limitations, can deliver service globally.
Disadvantages of E-commerce
• Lack of personal touch. We cannot touch the goods physically.
• We cannot do any transaction without Internet access device. So, it is heavily dependent on Internet
technologies

e) Define Encryption and Decryption.


Ans: Encryption is the process of converting data into a coded form to prevent unauthorized access.
Decryption is the process of converting the coded data back into its original form.

f) What is RDBMS? Write any two examples


Ans: RDBMS (Relational Database Management System) is a database management system based on a
relational model. Examples: MySQL, Oracle.

g) Write the functions of Primary key.


Ans: The primary key uniquely identifies each record in a database table and ensures that no duplicate
records exist.

h) What is query? Write its type.


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.
Its types are Select Query and Action Query (Update, Delete, Append and Make Table)

i) Define Form and Report.


Ans: A form is a user interface that allows users to enter and modify data in a database.
A report is a formatted output of database data, often used for printing or presenting information.

2|P a g e CS SEE KOSHI 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
5. Write down the output of the given program. Show with dry run in table.
DECLARE FUNCTION PRE(A)
CLS
A=12345
S=PRE(A)
PRINT S
END

FUNCTION PRE(A)
WHILE A < >0
R = A MOD 10
S=S+R
A=A\10
WEND
PRE=S
END FUNCTION

Dry Run Table


A WHILE A < >0 R = A MOD 10 S=S+R A=A\10 PRINT S

12345 12345<>0 YES =12345 MOD 10 =0+5=5 12345\10 15


=5 =1234
1234<>0 YES 1234 MOD 10 =5+4=9 1234\10
=4 =123
123<>0 YES 123 MOD 10 =9+3=12 123\10=12
=3
12<>0 YES 12 MOD 10 12+2=14 12\10=1
=2
1<>0 YES 1 MOD 10=1 14+1=15 1\10=0
0<>0 NO
LOOP EXITS

The output of the program is :


15

6. Re-write the given program after correcting the bugs:


REM to create sequential data file "record.dat" to delete some records.
CLS
OPEN "record.dat" FOR INPUT AS #I
OPEN "new.dat" FOR OUTPUT AS #1
WHILE NOT EOF(#1)
INPUT #1 N$, A$, PH
PRINT N$, A$, PH
INPUT "Do you want to delete this record?(y/n)"; an$
IF LCASE(ans$) < > "y" then
WRITE #2, N$, A$, PH
ENDIF
WEND
CLOSE #1, #2
DEL "record.dat"
NAME "new.dat" AS "record.dat"
END
3|P a g e CS SEE KOSHI 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
Debugged Program
REM to create sequential data file "record.dat" to delete some records.
CLS
OPEN "record.dat" FOR INPUT AS #1
OPEN "new.dat" FOR OUTPUT AS #2
WHILE NOT EOF(1)
INPUT #1, N$, A$, PH
PRINT N$, A$, PH
INPUT "Do you want to delete this record?(y/n)"; an$
IF LCASE$(an$) < > "y" THEN
WRITE #2, N$, A$, PH
END IF
WEND
CLOSE #1, #2
KILL "record.dat"
NAME "new.dat" AS "record.dat"
END

7. Study the following program and answer the given

DECLARE SUB TEN (A$)


B$=SCIENCE"
CALL TEN(B$)
END

SUB TEN(C$)
L=LEN(C$)
FOR I=1 TO 4
D$=MID$(C$,I,L)
PRINT TAB(I); D$
L=L-2
NEXT I
END SUB

Questions:

a. How many parameters are used in the above program?


Ans: - One parameter is used in the above program

b. List the different library functions used in the above program.


Ans: MID$( ), LEN ( ) , TAB ( ) are library functions used in the above program.

8. Convert/calculate as per the instruction: [4×1-41

a. (11011)2 into Decimal number


Ans:
(11011)₂
=(1 × 2⁴) + (1 × 2³) + (0 × 2²) + (1 × 2¹) + (1 × 2⁰)
=(1 × 16) + (1 × 8) + (0 × 4) + (1 × 2) + (1 × 1)
=16+8+0+2+1
= (27)₁₀
(11011)₂ = (27)₁₀

4|P a g e CS SEE KOSHI 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
b (2AF)16 into Octal number
Ans:
Convert each hex digit to 4 binary digits and then convert each 3 binary digits to octal digits (see conversion
tables below):
2AF
Converting Hexadecimal to Binary
2 = 0010
A = 1010
F = 1111
= 10 1010 1111
Now, Converting Binary to Octal
1=1
010 = 2
101 = 5
111 = 7
= 1257
(2AF)16 =(1257)8

c. 1100x100-101
1 1 0 0
x 1 0 0
0 0 0 0
0 0 0 0 x
1 1 0 0 x x
1 1 0 0 0 0
1 0 1
1 0 1 0 1 1

1100x100-101 = 101011

d. 10001 / 110
110) 1 0 0 0 1 (10
- 1 1 0
0 0 1 0 1
- 0
1 0 1

Q=10
R=101

9. a. Write a program in Qbasic that ask the radius of a hemisphere and calculate its volume and total
surface area. Create a user-defined function First(r) to calculate volume and sub-procedure Second(r)
to calculate total surface area of a hemisphere. [Hints: TSA=3r2, V=2/3r3)

DECLARE FUNCTION First(r)


DECLARE SUB Second(r)
CLS
INPUT "Enter the radius of the hemisphere: ", r
PRINT "Volume of hemisphere: "; First(r)
CALL Second(r)
END

5|P a g e CS SEE KOSHI 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
FUNCTION First(r)
First = (2 / 3) * 3.1416 * r ^ 3
END FUNCTION

SUB Second(r)
TSA = 3 * 3.1416 * r ^ 2
PRINT "Total Surface Area: "; TSA
END SUB

b. A sequential data file called "list.dat" has stored data under the field heading items name quantity
and rate. Write a program to update all the records by increasing the rate by 10%.
OPEN "list.dat" FOR INPUT AS #1
OPEN "temp.dat" FOR OUTPUT AS #2
WHILE NOT EOF(1)
INPUT #1, item$, quantity, rate
rate = rate + 10/100 * rate
WRITE #2, item$, quantity, rate
WEND
CLOSE #1, #2
KILL "list.dat"
NAME "temp.dat" AS "list.dat"
END

10. Write a program in C language to enter a number and find out whether it is positive or negative

#include <stdio.h>
int main()
{
int num;
printf("Enter a number: ");
scanf("%d", &num);
if (num > 0)
printf("The number is positive.\n");
else if (num < 0)
printf("The number is negative.\n");
else
printf("The number is zero.\n");
return 0;
}
Write a C program to display the sum of first 10 natural number.
#include <stdio.h>
int main()
{
int sum = 0;
for (int i = 1; i <= 10; i++) {
sum += i;
}
printf("The sum of the first 10 natural numbers is: %d\n", sum);
return 0;
}

6|P a g e CS SEE KOSHI 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA

7|P a g e CS SEE KOSHI 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
Set 2: PABSON 2080 (Madhesh)
Attempt all questions.
Group 'A
1. Answer the following questions in one sentence:

a) What is data communication?


Ans: Data communication is the exchange of data between devices through a transmission medium.

b) What is computer Virus?


Ans: A computer virus is a destructive program that copies itself and infects a PC, spreading from
one file to another, and then from one PC to another when the files are copied or shared.

c) Name any two types of data file in Qbasic.


Ans: Sequential file and Random file

d) What is primary key?


Ans: A primary key is a field or combination of fields in a table that uniquely identifies each record,
and is used to establish relationships between tables and enforce data integrity

e) What is field?
Ans: A field is a column in a table which contains information about a certain type for all records.

f) What is C language?
Ans: C Language is a high-level structured programming language which is used to develop system
software.

2. Write appropriate technical term for the following:


a) A network limited with a room or building. LAN (Local Area Network)
b) Commercial transaction through mobile devices. M-Commerce (Mobile Commerce)

3. Write the full form of the following:


a) UPS – Uninterruptible Power Supply
b) WWW – World Wide Web

Group 'B'
4. Answer the following questions:
a) What is transmission media? Write its types.
Ans: A channel or path through which data and information are transmitted between connected
devices in a network environment is called transmission media.
Its types are:
1. Guided (Wired/bounded) communication media (Fiber optic, Twisted Pair and Co-axial)
2. Unguided (Wireless/unbounded) communication media (Radiowave, Microwave, Satellite)

b) What is loT? Write any two importance of it.


Ans: The Internet of Things (IoT) refers to the network of physical objects embedded with sensors,
software, and other technologies to connect and exchange data with other devices and systems over
the internet.
Any two importance of IoT are:
It reduces the human effort, so it saves a lot of time.
Information is easily accessible from any place at any time on any device

c) Write any four opportunities and threats its social media.


Ans: Any four opportunities and threats its social media are:
1|P a g e CS SEE MADHESH 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
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) Spreading false or unreliable information.

d) What is E-commerce Write its types.


Ans: E-commerce refers to the buying and selling of goods and services over the internet.
Its types include Business to Consumer (B2C), Business to Business (B2B), Consumer to Consumer
(C2C), and Consumer to Business (C2B).

e) What is information security? Write any two ways to protect our data.
Ans: Information security is the practice of protecting digital information from unauthorized access, corruption,
or theft. Two ways to protect data are:
• Using strong passwords and changing them regularly.
• Implementing encryption to secure sensitive data.

f) What is database? Write any two examples.


Ans: A collection of systematically organized inter-related data which store, organize and retrieve
data is called a database. E.g. Dictionary and Marks Ledger.

g) What is table? Write the basic components of table.


Ans: Tables are the primary building block of database which stores and manages large volume of
data into rows and column.
The basic components of a table are fields (columns) and records (rows).

h) What is action query? Write its type.


Ans: An action query in a database performs a task on the data, such as inserting, updating, or
deleting records. Its types include append queries, update queries, delete queries, and make-table
queries.

i) Define input mask and validation rule.


Ans: Input mask is a field property that controls the value of a record and sets in a specific format.
Validation Rule is a field property which is used to limit the values that can be entered into a field.

5. Write down the output of the given program. Show with dry run in table.

DECLARE SUB SERIES ( )


CES
CALL SERIES
END

SUB SERIES
A=1
B=5
PRINT A

2|P a g e CS SEE MADHESH 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
PRINT B
FOR 1=1 to 5
C=A + B
PRINT C
A=B
B=C
NEXT I
END SUB

Dry Run Table:

A B PRINT A PRINT B I=1 TO 5 C=A+B PRINT C A=B B=C


4 5 4 5 1 TO 5 YES 4+5=9 9 5 9
5 9 2 TO 5 YES 5+9=14 14 9 14
9 14 3 TO 5 YES 9+14=23 23 14 23
14 23 4 TO 5 YES 14+23=37 37 23 37
23 37 5 TO 5YES 37+23=60 60 37 60
37 60 6 TO 5 NO
LOOP
EXITS
The output of the program is
4
5
9
14
23
37
60

6. Re-write the given program after correcting the bugs:


REM add some more record on a sequential data file "emp.dat"
CLS
OPEN "emp.dat" FOR INPUT AS #1

UP
INPUT "ENTER NAME:”; N$
INPUT "ENTER DEPARTMENT” ; D$
INPUT "ENTER POST”; P$
INPUT "ENTER SALARY”; SL
WRITE #2, N$, D$, P$, SL
INPUT "DO YOU WANT TO ADD MORE RECORD?(Y/N)”; AN$
IF UCASE$(ANS$)= "Y" THEN GOTO UP
CLOSE
END

Debugged Program

REM add some more record on a sequential data file "emp.dat"


CLS
OPEN "emp.dat" FOR APPEND AS #1

3|P a g e CS SEE MADHESH 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
UP:
INPUT "ENTER NAME: "; N$
INPUT "ENTER DEPARTMENT: "; D$
INPUT "ENTER POST: "; P$
INPUT "ENTER SALARY: "; SL
WRITE #1, N$, D$, P$, SL
INPUT "DO YOU WANT TO ADD MORE RECORD? (Y/N)"; AN$
IF UCASE$(AN$) = "Y" THEN GOTO UP
CLOSE #1
END

7. Study the following program and answer the given questions:


DECLARE FUNCTION TEST$(A$)
CLS
A$= “KATHMANDU”
B$=TEST$(A$)
PRINT B$
END

FUNCTION TEST$ (A$)


FOR I = TO LEN(A$)
DS=MID$(A$, I, 1)
IF I MOD 2=0 THEN
C$=C$+UCASES$(D$)
ELSE
C$=C$+LCASES$(D$)
END IF
NEXT I
TEST$=C$
END FUNCTION

Questions:
a) What is the name of the function procedure? – TEST$( )
b) List the different library functions used in the program. – MID$( ), UCASE$( ), LCASE$( ), MID$( )

Group 'C"
8. Convert/calculate as per the instruction:

a. (511)10 into Binary number

Divide by the base 2 to get the digits from the remainders:


Division Quotient Remainder Bit #
by 2 (Digit)
(511)/2 255 1 0
(255)/2 127 1 1
(127)/2 63 1 2
(63)/2 31 1 3
(31)/2 15 1 4
(15)/2 7 1 5
(7)/2 3 1 6
(3)/2 1 1 7
(1)/2 0 1 8
4|P a g e CS SEE MADHESH 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
= (111111111)2

(511)10 = (111111111)2

b. (756)8 into Hexadecimal number

Convert every octal digit to 3 binary digits, then convert every 4 binary digits to1 hex digit (see conversion
tables):
756
7 = 111
5 = 101
6 = 110
= 111 101 110
Convert binary to hexadecimal

= 1 1110 1110
1=1
1110=E
1110=E
(756)8 =(1EE)16

c. 1001 × 101 – 11

1 0 0 1
x 1 0 1
1 0 0 1
0 0 0 0 x
1 0 0 1 x X
1 0 1 1 0 1
- 1 1
1 0 1 0 1 0

1001 × 101 – 11 = 101010

d. 1001001 11001

11001) 1 0 0 1 0 0 1 (10
- 1 1 0 0 1
1 0 1 1 1
- 0
1 0 1 1 1

5|P a g e CS SEE MADHESH 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
Q=10
R = 10111

9. a. Write a program in ghasic that ask the radius and height of a cylinder then calculate its volume and
Total surface area. Create a user-defined function VLM(r, h) to calculate volume and sub procedure TOTSA
(r, h) to calculate total surface area of a a hemisphere [Hints: TSA=2r(r+h), V=r2h.

DECLARE FUNCTION VLM(r, h)


DECLARE SUB TOTSA(r, h)
INPUT "Enter radius: ", r
INPUT "Enter height: ", h
vol = VLM(r, h)
CALL TOTSA(r, h)
PRINT "Volume of the cylinder: "; vol
END

FUNCTION VLM(r, h)
VLM = 3.1416 * r * r * h
END FUNCTION

SUB TOTSA(r, h)
tsa = 2 * 3.1416 * r * (r + h)
PRINT "Total Surface Area of the cylinder: "; tsa
END SUB

b. A sequential data file called "marks.dat" has stored data under the field heading student's name. Eng, Nep
and Math. Write a program to display all the record whose marks is greater than 35 in all subjects.

OPEN "marks.dat" FOR INPUT AS #1


PRINT "Students with marks > 35 in all subjects:"
DO WHILE NOT EOF(1)
INPUT #1, name$, eng, nep, math
IF eng > 35 AND nep > 35 AND math > 35 THEN
PRINT name$, eng, nep, math
END IF
LOOP
CLOSE #1
END

10. Write a program in C language to ask to enter a number then find out whether it is odd or even number

#include <stdio.h>

int main() {
int num;
printf("Enter a number: ");
scanf("%d", &num);

if (num % 2 == 0) {
printf("%d is even.\n", num);
6|P a g e CS SEE MADHESH 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
} else {
printf("%d is odd.\n", num);
}

return 0;
}

OR

Write a C program to display the sum of first 20 even number.

#include <stdio.h>

int main() {
int sum = 0;
for (int i = 1; i <= 20; i++) {
sum += 2 * i;
}
printf("Sum of the first 20 even numbers: %d\n", sum);
return 0;
}

7|P a g e CS SEE MADHESH 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
Set 3: PABSON 2080 (Bagmati)
Attempt all questions.
Group 'A'
1. Answer the following questions in one sentences.
a) Which connector is used with coaxial cable?
Ans: BNC (Bayonet Neill-Concelman) connector is used with coaxial cable.

b) Why data decryption is necessary?


Ans: Data decryption is necessary to convert encrypted data back into its original form so that it can
be understood by the intended recipient.

c) Which data types are used to store graphics and numeric characters in MS-Access?
Ans: OLE Object is used for graphics, and Number is used for numeric characters in MS-Access.

d) List any two objects of MS-Access.


Ans: Tables and Queries are two objects of MS-Access.

e) What is the function of MOD in Qbasic.


Ans: MOD returns the remainder of a division between two numbers.

f) Write the name of unary operators used in C language.


Ans: Increment (++) and Decrement (--) are unary operators used in C language.
2. Write appropriate technical term for the following:
a) The protection of computer systems and sensitive information from unauthorized access, theft or
damage. Cybersecurity.
b) The Internet tool which is used to upload/download. FTP (File Transfer Protocol).
3. Write the full form of the following:
a) VOIP - Voice Over Internet Protocol
b) ISDN - Integrated Services Digital Network
Group B
4. Answer the following questions:
a) What is topology? Draw the figure of star topology.
Ans: Topology refers to the physical or logical arrangement of a network.

b) What is cyber-ethics? List out any two cybercrimes.


Ans: Cyber ethics is a set of moral principles or code of conducts that regulate the use of computers
systematically without making harm to other users.
Two examples of cybercrimes are identity theft and phishing.

c) What is hardware security? Write any two measures of software security.


Ans: Hardware security refers to the protection of physical devices from unauthorized access and
damage. Two measures of software security are using strong passwords and regularly updating
software.

d) What is E-government? Give any two examples.

1|P a g e CS SEE BAGMATI 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
Ans: E-Governance is a set of services provided by the government to public via electronic media
especially using Internet. Examples: Online tax filing systems, digital voter registration.

e) Define cloud computing with example.


Ans: Cloud computing is the delivery of computing services such as storage, databases, and software
over the internet. Example: Google Drive

f) Differentiate between Database and DBMS.


Ans: The difference between Database and DBMS are:
Database DBMS
A collection of systematically organized inter- Database management system (DBMS) is
related data which store, organize and retrieve a computerized system that stores data,
data is called a database. processes them and provides information
in an organized form
Eg. Dictionary, Marks Ledger, Telephone E.g. MS-Access, Oracle, MS-SQL Server,
Directory, Attendance Register etc. MySQL, PostgreSQL etc

g) What is primary key? Write its importance.


Ans: A primary key is a field or combination of fields in a table that uniquely identifies each record,
and is used to establish relationships between tables and enforce data integrity.
Its importance is :
It sets the relationship between tables.
It reduces and controls duplication of record in a table.

h) What is data type? List any two data types of MS- Access.
Ans: Data type is an attribute for a field that determines the type of data that can be stored in that
field. Two data types in MS-Access are Text and Date/Time.

i) Why update query is necessary in Database system? Give reason.


Ans: An update query is necessary to modify existing data in a database. It helps keep data accurate
and up-to-date.

5. Write down the output of the given program. Show with dry run in table.
DECLARE SUB show ( )
CLS
CALL show
END
SUB show
FOR I = 1 TO 7 STEP 3
S=S+I^3
NEXT I
PRINT S
END SUB

Dry Run

I=1 to 7 step 3 S=S+I^3 PRINT S


1 to 7 step 3 yes 0+1^3 408
=0+1=1
4 to 7 yes 1+4^3
=1+64=65
7 to 7 yes 65+7^3

2|P a g e CS SEE BAGMATI 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
=65+343=408
10 to 7 no loop
exits

The output of the program is


408

6. Re-write the given program after correcting the bugs:


REM display records of students from sequential data file.
OPEN “STUDENT.DAT” FOR INP AS #1
PRINT “SNO”, “NAME”, “ADDRESS”, “CLASS”, “SECTION”
WHILE NOT EOF
INPUT #1, SN, N$, AD$, C, SE$
PRINT SN, N$, AD$, C, SE$
NEXT
CLOSE #1
STOP

Debugged Program

REM display records of students from sequential data file.


OPEN "STUDENT.DAT" FOR INPUT AS #1
PRINT "SNO", "NAME", "ADDRESS", "CLASS", "SECTION"
WHILE NOT EOF(1)
INPUT #1, SN, N$, AD$, C, SE$
PRINT SN, N$, AD$, C, SE$
WEND
CLOSE #1
END

7. Study the following program and answer the gives questions.


DECLARE FUNCTION num (N)
FOR I = 1 TO 5
READ N
Z = num(N)
S=S+Z
NEXT I
PRINT S
DATA 11, 14, 16, 5, 7
END
FUNCTION sum (N)
IFN MOD 2=0 THEN num=N
END FUNCTION
Questions:
a. List the library function used in the above program. No, library function used in above program.
b. Write the name of the function used in the above program. Num( )
Group 'C'

3|P a g e CS SEE BAGMATI 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
8. Convert/calculate as per the instruction:
a. (101110111)2 = (?)8
Convert every 3 binary digits (from bit0) to octal digit (see conversion table below):
101110111
= 101 110 111
101= 5
110=6
111=7
= 567
(101110111)2 = (567)8

b.(248)10 = (?)2
Divide by the base 2 to get the digits from the remainders:
Division Quotient Remainder Bit #
by 2 (Digit)
(248)/2 124 0 0
(124)/2 62 0 1
(62)/2 31 0 2
(31)/2 15 1 3
(15)/2 7 1 4
(7)/2 3 1 5
(3)/2 1 1 6
(1)/2 0 1 7
= (11111000)2
(248)10 = (11111000)2

c. (1101)2 x (110)2 - (1011)2 = (?)2

1 1 0 1
x 1 1 0
0 0 0 0
1 1 0 1 x
1 1 0 1 x x
1 0 0 1 1 1 0
- 1 0 1 1
1 0 0 0 0 1 1

(1101)2 x (110)2 - (1011)2 = (1000011)2

d. (1011101)2  (101)2

101) 1 0 1 1 1 0 1 (10010
- 1 0 1
0 0 0 1 1 0
- 1 0 1
0 0 1 1
0
1 1
4|P a g e CS SEE BAGMATI 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA

Q=10010
R=11
9. a. WAP in QBASIC to print circumference of a circle using SUB and volume of a cylinder using

DECLARE SUB Circumference (R)


DECLARE FUNCTION VolumeCylinder (R, H)
CLS
INPUT "Enter radius of the circle: ", R
INPUT "Enter height of the cylinder: ", H
CALL Circumference(R)
PRINT "Volume of cylinder: "; VolumeCylinder(R, H)
END

SUB Circumference (R)


C = 2 * 22 / 7 * R
PRINT "Circumference of the circle: "; C
END SUB

FUNCTION VolumeCylinder (R, H)


VolumeCylinder = 22 / 7 * R ^ 2 * H
END FUNCTION

b. A sequential data file “Employee.dat” has some records with field's serial number, name. Address,
post and salary for the number of employees. Write a program to display all the records of those
emplovee's whose salary is more than Rs. 50000. [4]

OPEN "Employee.dat" FOR INPUT AS #1


PRINT "SN", "NAME", "ADDRESS", "POST", "SALARY"
WHILE NOT EOF(1)
INPUT #1, SN, N$, AD$, P$, SAL
IF SAL > 50000 THEN
PRINT SN, N$, AD$, P$, SAL
END IF
WEND
CLOSE #1

10. Write a program to read any three integer numbers from the keyboard and find the smallest
number using C language. [4]

#include <stdio.h>
int main() {
int num1, num2, num3;
printf("Enter three integers: ");
scanf("%d %d %d", &num1, &num2, &num3);

if (num1 < num2 && num1 < num3)


printf("Smallest number: %d\n", num1);
else if (num2 < num1 && num2 < num3)
printf("Smallest number: %d\n", num2);
else
printf("Smallest number: %d\n", num3);
5|P a g e CS SEE BAGMATI 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
return 0;
}

OR
Write a program to print first 10 natural number using C language.

#include <stdio.h>
int main() {
int i;
for (i = 1; i <= 10; i++) {
printf("%d\n", i);
}
return 0;
}

6|P a g e CS SEE BAGMATI 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
Set 4: PABSON 2080 (Gandaki)
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.
1|P a g e CS SEE GANDAKI 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
• 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 The processed form of data is known as
entities are known as data. information.
For example, Aaradhya, 1000, For example, Aaradhya has 1000 balance in
account, balance etc. are raw data his bank account. Here Aaradhya, 1000,
individually does not give any account, balance all have their significant
meaning. 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
2|P a g e CS SEE GANDAKI 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
Dry run
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 APPEND 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
3|P a g e CS SEE GANDAKI 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
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
=A4D
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 #
by 8 (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
4|P a g e CS SEE GANDAKI 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
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. [Vc=
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"

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

5|P a g e CS SEE GANDAKI 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
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;
}

6|P a g e CS SEE GANDAKI 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
Set 5: PABSON 2080(Karnali/Sudurpaschim)
Attempt all questions.
Group 'A'
1. Answer the following questions in one sentence:
a) What do you mean by primary key?
Ans: A primary key is a field or combination of fields in a table that uniquely identifies each record,
and is used to establish relationships between tables and enforce data integrity.

b) What is a database? Give example.


Ans: A collection of systematically organized inter-related data which store, organize and retrieve
data is called a database. E.g. Dictionary, Marks Ledger etc.

c) Define cyber ethics.


Ans: Cyber ethics is a set of moral principles or code of conducts that regulate the use of computers
systematically without making harm to other users.

d) Write any two keywords used in C-programming.


Ans: Any two keywords used in C-programming are int, return.

e) What do you mean by B2C model of e-commerce?


Ans: The B2C (Business-to-Consumer) model involves businesses selling products or services
directly to consumers online.

f) What is the function of INT() in QBASIC programming?


Ans: The INT() function in QBASIC returns the integer portion of a number by removing the
decimal part.

2. Write appropriate technical term for the following:


a. The device that is used to connect two networks with different communication protocols. Gateway
b. A person who breaks computer security and uses a computer and file present in it. Hacker
3. Write the full form of the following:
a. VOIP - Voice Over Internet Protocol
b. WLAN - Wireless Local Area Network
Group 'B'
4. Answer the following questions:
a. What is computer network architecture? Mention its types.
Ans: Computer network architecture defines how the computer communicates and interacts with
each other on network. Types include Centralized, Peer-to-Peer (P2P) and Client-Server
architectures.

b. What do you mean by digital signature? Why it is important?


Ans: A digital signature is an encrypted code attached to an electronic document, verifying the
sender's identity. It is important because it ensures the authenticity and integrity of a document.

c. What is a firewall? Enlist the types of firewall.


Ans: A firewall is a security system that monitors and controls incoming and outgoing network
traffic.
Types of firewall
Network-Based Firewall: This type of firewall protects an entire network. It’s like a big wall around
a city, guarding all the computers in that network from outside threats. It is usually placed where the
network connects to the internet.
Host-Based Firewall: This type of firewall protects a single computer. It’s like a personal security
guard for your computer, checking all the data that comes in and out of it.
1|P a g e CS SEE KARNALI 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA

d. Differentiate between computerized and non- computerized databases.


Ans:
Computerized Database Non-Computerized Database
It can store large volume of data. It is limited by physical storage available.
We can search data very easily. It can take a while to manually search through
all of the records.

a. What is Al? Enlist two application areas of Al.


Ans: Artificial intelligence (AI) is an area of computer science that emphasizes the creation of
intelligent machines that work and reacts like humans.
Application areas include Natural Language Processing and Robotics.

e. What is hardware security? Enlist any two measures to protect it.


Ans: Hardware security refers to the protection of physical devices from damage, theft, or
unauthorized access. Measures include regular maintenance and insurance.

f. What is field property in Ms-Access? Enlist any four of them.


Ans: Field properties in MS-Access define the characteristics and behavior of fields in a table.
Examples: Field Size, Format, Default Value, Validation Rule.

g. What is Indexing? Why form and report are used in MS-Access?


Ans: Indexing is a field property which speeds up searching and sorting of records based on a field.
Forms are used to easily enter, view, and edit data in the database. They provide a user-friendly way
to interact with the data.
Reports are used to present data in a structured and printable format. They allow us to create
professional-looking documents that summarize and display the information stored in the database.

h. What is Query ? Write the types of Action 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.
Types of Action Queries include Update, Append, Delete, and Make-Table.
5. Write the output of the given program. (workout with a dry-run table)
DECLARE SUB Show ( )
CLS
CALL Show
END
SUB Show
C=3
B=2
FOR I = 2 TO 8 STEP 2
PRINT C;
SWAP B, C
B=C+1
NEXT I
END SUB

Dry run
C B I=2 TO 8 STEP 2 PRINT C; B=C+1
3 2 2 TO 8 STEP 2 YES 3

2|P a g e CS SEE KARNALI 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
SWAP 2 3 4 TO 8 STEP 2 YES 2 2+1=3
B, C
SWAP 3 2 6 TO 8 STEP 2 YES 3 3+1=4
B, C
SWAP 4 3 8 TO 8 STEP 2 YES 4 4+1=5
B, C
SWAP 5 4 10 TO 8 NO
B, C

The output of the program is


3 2 3 4

6. Rewrite the given program after correcting bugs:


REM To add a few records in the existing data file
CLS
OPEN "emp.dat" FOR OUTPUT AS #2
DO
INPUT "Enter Employee Name, Post, Salar”; :EN$, POST$, SALARY
PRINT #2, EN$, POST$, SALARY
INPUT “ADD MORE RECORDS (Y/N)?”; C
LOOP WHILE LICASE$(C$)=”Y”
CLOSE #1
END

Debugged Program
REM To add a few records in the existing data file
CLS
OPEN "emp.dat" FOR APPEND AS #2
DO
INPUT "Enter Employee Name, Post, Salary: "; EN$, POST$, SALARY
PRINT #2, EN$, POST$, SALARY
INPUT "ADD MORE RECORDS (Y/N)? "; C$
LOOP WHILE UCASE$(C$) = "Y"
CLOSE #2
END

7. Sudy the following program and answer the given questions:


DECLARE FUNCTION SUM(N)
CLS
INPUT “Enter a number"; N
X=SUM(N)
PRINT “The sum of individual digits is"; X
END
FUNCTION SUM(N)
WHILEN<>0
R=N MOD 10
S=S+R
N=INT(N/10)
WEND

3|P a g e CS SEE KARNALI 2080 https://seeqbasicomputer.blogspot.com/


SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
SUM=S
END FUNCTION
a. Name the user defined function in the above program. – SUM ( )
b. How many times the WHILE WEND loop repeats If the value of Nis 1234? – 4 times

Group C
Calculate or convert as per the instructions.

(CA)16 = (?)10

= (12 × 16¹) + (10 × 16⁰)


=12×16 + 10 × 1
=192+10
=202
(CA)16 = (202)10

(652)10 = (?)8

Divide by the base 8 to get the digits from the remainders:


Division Quotient Remainder Digit #
by 8 (Digit)
(652)/8 81 4 0
(81)/8 10 1 1
(10)/8 1 2 2
(1)/8 0 1 3
= (1214)8
(652)10 = (1214)8

(10101)2 x (11)2 - (1110)2

1 0 1 0 1
x 1 1
1 0 1 0 1
1 0 1 0 1 X
1 1 1 1 1 1
1 1 1 0
1 1 0 0 0 1

(10101)2 x (11)2 - (1110)2 = (110001)2

(111011)2 / (100)2

100) 1 1 1 0 1 1 (1110
1 0 0
1 1 0
1 0 0
1 0 1
1 0 0
1 1
4|P a g e CS SEE KARNALI 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA
0
1 1

Q = 1110
R = 11

9 a. Write a program in QBASIC to input a radius, create a user defined function to calculate the volume of
hemisphere and total surface area (TSA) of the sphere using sub procedure.
DECLARE FUNCTION VOL(R)
DECLARE SUB SPHERE(R)
CLS
INPUT "Enter Radius: "; R
PRINT “Volume of hemisphere”; VOL(R)
CALL SPHERE(R)
END

FUNCTION VOL(R)
VOL=(2/3) * 3.14159 * R^3
END FUNCTION

SUB SPHERE(R)
TSA = 4 * 3.14159 * R^2
PRINT "Total Surface Area of Sphere = "; TSA
END SUB

b A sequential data file "record.dat” contains the name, address, salary of employees, and displays the
record of those whose salary is more than 37000 and whose name ends with "DHA.

OPEN "record.dat" FOR INPUT AS #1


DO WHILE NOT EOF(1)
INPUT #1, NAME$, ADDR$, SALARY
IF SALARY > 37000 AND RIGHT$(NAME$, 3) = "DHA" THEN
PRINT NAME$, ADDR$, SALARY
END IF
LOOP
CLOSE #1
END

10. Write a C program to input a character and check whether it is vowel or consonant. (4)
#include <stdio.h>

int main() {
char ch;
printf("Enter a character: ");
scanf("%c", &ch);

if (ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' || ch == 'U' ||


ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u') {
printf("%c is a vowel.\n", ch);
} else {
printf("%c is a consonant.\n", ch);
}
5|P a g e CS SEE KARNALI 2080 https://seeqbasicomputer.blogspot.com/
SEE COMPUTER SCIENCE SET SOLUTIONS 2081 https://deepak2081.com.np/ SOLVED BY: DEEPAK SHRESTHA

return 0;
}

OR
Write a program in C 'language' to input a number and check whether it is a palindrome or not. [4]
#include <stdio.h>

int main() {
int n, reversed = 0, original, remainder;
printf("Enter an integer: ");
scanf("%d", &n);

original = n;

while (n != 0) {
remainder = n % 10;
reversed = reversed * 10 + remainder;
n /= 10;
}

if (original == reversed) {
printf("%d is a palindrome.\n", original);
} else {
printf("%d is not a palindrome.\n", original);
}

return 0;
}

6|P a g e CS SEE KARNALI 2080 https://seeqbasicomputer.blogspot.com/

You might also like