Monday, January 8, 2024

SOLVED SEE MODEL SET 1 2080

 SOLVED SEE MODEL SET 1 2080




Optional II [Computer Science]

Time : 2 hrs.                                                                                          Full Marks: 50

Group ‘A’

1.    Answer the following questions in one sentence:                                         6×1=6

a)    Which device is used to connect PC with telephone line?

Ans: MODEM is used to connect PC with telephone line.

b)   What is the vision of IT Policy of Nepal 2072?

Ans: The vision of IT Policy of Nepal 2072 is “to transform Nepal into information and knowledge-based society and economy”.

c)    Which view is used to modify a record in MS-Access?

Ans: Datasheet view is used to modify a record in MS-Access

d)   What is the default field size of “AutoNumber” data type?

Ans: The default field size of “AutoNumber” data type is 4 bytes.

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

Ans: The modes of operations for opening a sequential file are INPUT, OUTPUT and APPEND mode.

f)     Write the name of two selection statement used in C language.

Ans: The name of two selection statement used in C language are if and select

 

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

a)    The network security systems that monitor and controls the traffic flow between the Internet and private network. Firewall

b)    An intelligent device that has ability to determine the best possible path for data transmission. Router

 

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

a)    PaaS – Platform as a Service       

b)    EFT – Electronic Fund Transfer

 

Group B

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

a)    Mention differences between client/server architecture and peer to peer architecture of the network.

Ans: The difference between client/server architecture and peer to peer architecture of the network are:

Client/server architecture

Peer to peer architecture

Client/ server network is a type of network model where at least one computer is designed as a server and other computers on the network called clients or workstations

Peer-to-Peer network is a type of network model where all the computers have equal responsibilities on the network.

It provides central security administration and the network administrator is responsible for data security and other resources management of the network.

It lacks centralized network administration, where the network administrator needs to manage security on each computer. It provides no reliable security and might put data in higher risks.

b)   What is a digital footprint? Share your thoughts about cyberbullying.

Digital footprint is a trace of data that is created while using the Internet. 

Cyber bullying is a kind of harassment using mobiles or computers. Cyberbullying can cause depression, anxiety, loneliness, and in severe cases, make people want to hurt themselves or think about ending their lives. To stop cyberbullying, we need to teach, support, and help those affected.

c)    What is Online Payment? Write any four forms of e-payment in Nepal.

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

E.g. eSewa Nepal, iPay, Khalti, e-banking, etc.

 

d)   What are security threats? Write down any four possible threats to computer security.

Security threats refers to a risk which can potentially harm computer systems and organization.

Any four possible threats to computer security are:

  Internal: The threats include fire, unstable power supply, humidity in the rooms housing the hardware, etc.

  External: These threats include Lightning, floods, earthquakes, etc.

  Human: These threats include theft, vandalism of the infrastructure and/or hardware, disruption, accidental or intentional errors.

  Unauthorized access to computer systems resources such as data.

 

e)    How can public get benefited from the e-governance services?

Ans: E-Governance refers to the use of the digital technology by government to enhance the delivery of public services and engage with citizens more effectively. Public can access government services and information conveniently from anywhere. It reduces paperwork and manual tasks, which can lead to faster decision-making and service delivery. Public gets cheaper, more effective, and speedy communications. Public can pay their taxes online.

 

f)     What is MS-Access? Give any two examples of DBMS.

Microsoft Access is a relational database management system (RDBMS) that allows users to store, organize, and manage large amounts of data. Examples of DBMS are: MS-Access and Oracle.

 

g)    What is foreign key? Why is it important to specify primary key in database?

A foreign key in MS Access is a field that establishes a relationship between two tables by referencing the primary key of another table. It important to specify primary key in database because it reduces and controls duplication of record in a table. It sets the relationship between tables.

 

h)   What is filtering. List any two advantages of sorting.

Filtering is an option that selects the required records and displays the result.

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)      Differentiate between Select query and Action query.

The difference between Select query and Action query are:

Select Query

Action Query

A select query is a type of query used to retrieve and display data from one or more tables or queries, based on specified criteria or selection rules, such as filtering or sorting.

An action query is a type of query used to perform a specific action on a set of records, such as adding, deleting, updating, or appending records in a table or query based on specified criteria or selection rules

It doesn't modify the data in any way; it only fetches and displays information.

It modifies or manipulates data in a database like add, update, delete.

 

5.    Write the output of the given program. Show with dry run in table.           2

DECLARE SUB SERIES()

CLS

CALL SERIES

END

 

SUB SERIES( )

X#=11111

FOR I= 1 TO 5

PRINT X#^2

X# = (X# - 1) / 10

NEXT I

END SUB

 

Dry Run

X#=11111

I=1 to 5

PRINT X#^2

X#=(X#-1)/10

 

1 to 5 Yes

123454321

(11111-1)/10=1111

1111

2 to 5 Yes

1234321

(1111-1)/10=111

111

3 to 5 Yes

12321

(111-1)/10=11

11

4 to 5 Yes

121

(11-1)/10=1

1

5 to 5 Yes

1

(1-1)/10=0

0

6 to 5 No

Loop Exits

 

 

 

The output of the program is:

123454321

1234321

12321

121

1

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

 

REM To find the sum of even digits of multi digits number

DECLARE FUNCTION SUM (N)

CLS

ACCEPT “ENTER MULTI-DIGITS NUMBER  ”; NUM

PRINT “SUM  = ” ; SUM(N)

END

 

FUNCTION SUM(N)

WHILE N=0

R= N MOD 10

IF R MOD 2 = 0 THEN S=S+R

N = N \ 10

WEND

SUM (N) =S

END FUNCTION

 

Debugged Program

REM To find the sum of even digits of multi digits number

DECLARE FUNCTION SUM (N)

CLS

INPUT “ENTER MULTI-DIGITS NUMBER  ”; NUM

PRINT “SUM  = ” ; SUM(NUM)

END

 

FUNCTION SUM(N)

WHILE N < > 0

R= N MOD 10

IF R MOD 2 = 0 THEN S=S+R

N = N \ 10

WEND

SUM =S

END FUNCTION

 

7.    Study the following program and answer the given questions:           2×1=2

DECLARE  SUB EXAMSEE (A$)

INPUT "Enter any string", B$

CALL EXAMSEE (B$)

END

 

SUB EXAMSEE(A$)

FOR I= LEN (A$) TO 1 STEP-1

PRINT LEFT$(A$,1)

NEXT I

END SUB

 

a) Write the names of two built in functions used in the program.

Ans: The two built in functions used in the program are: LEN( ) and LEFT$( )

b) List the real parameter and formal parameter in the program.

Ans: The real parameter is B$ and formal parameter is A$

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

i) (1011000101)2 = (?)16                        

ii) (4816)10 = (?)8

iii) (1011)2 × (110)2 – (1011)2 = (?)2

iv) (1011010)2 ÷ (111)2

 

9.    a) Write a program in QBASIC that asks radius of a circle and calculate its curved surface area and volume of hemisphere. Create a user - defined function to calculate volume of hemisphere and sub procedure to calculate curved surface area. [CSA=2pr2, Volume=  ]                                   4

 

DECLARE FUNCTION VOL(R)

DECLARE SUB CSA(R)

CLS

INPUT “Enter Radius”; R

PRINT “Volume of hemisphere=”; VOL(R)

CALL SCA(R)

END

FUNCTION VOL(R)

VOL = 2/3*22/7*R^2

END FUNCTION

 

SUB CSA(R)

C=2*22/7*R^2

PRINT “Curved surface area=”; C

END SUB

 

b) A sequential data file called “rec.dat” has several records having fields name, roll and class. Write a program to copy all the records of class 10 into a newly created file “new.dat”.                        4

 

OPEN "rec.dat" FOR INPUT AS #1

OPEN "new.dat" FOR OUTPUT AS #1

CLS

WHILE NOT EOF (1)

  INPUT #1, N$, R, C

IF C = 10 THEN WRITE #2, N$, R, C   

WEND

CLOSE #1, #2

END

 

 

10. Write a program in C language to ask a number and check whether it is a multiple of 5 or not.   4

 

#include <stdio.h>

int main()

{

   int num;

   printf("Enter a number: ");

   scanf("%d", &num);

   if (num % 5 == 0)

{

       printf("%d is a multiple of 5.\n", num);

   } else

{

       printf("%d is not a multiple of 5.\n", num);

   }

 

   return 0;

}

OR

          Write a program in ‘C’ language to display the series 2, 8, 18, 32,……… up to 10th terms.

 

#include <stdio.h>

int main()

{

    int i,a=2,b=6;

    for(i=1;i<=10;i++)

{

printf("%d ", a);

a=a+b;

b=b+4;

}

    return 0;

}

No comments:

Post a Comment