Wednesday, October 1, 2025

SOLVED PABSON Kathmandu MID Term Exam 2082 Computer Science – SET A

 

SOLVED PABSON Kathmandu MID Term Exam 2082 Computer Science – SET A

 

Attempt all questions.

 

Group 'A'(10 Marks)

 

1. Answer the following questions in one sentence:                      (6x1=6)

a)   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.

 

b)   What do you mean by computer security?

Computer security refers to the protection of computer systems, networks, and data from unauthorized access, theft, damage, or disruption.

 

c)   What is M-Commerce?

M-commerce refers to the buying and selling of goods and services through mobile devices like smartphones and tablets.

 

d)   What is caption in MS-Access?

Caption is a field property which gives alternative name given for any field.

 

e)   Which data type is suitable for storing date of birth in MS-Access?

Date/Time is suitable for storing date of birth in MS-Access.

 

 

f)   Which command is used to call function module in modular programming approach?

Function module is called inside an expression or assign its result to a variable.

       

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

a)   A wireless technology that connects electronics devices while they are close to each other.  Bluetooth

b)   The process of sending data from your device to the internet or a remote server. Uploading

 

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

     

a) VOIP – Voice Over Internet Protocol
b) G2B – Government to Business

  

 

Group 'B' (24 Marks)

 

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

a)   Differentiate between hub and switch.

Hub

Switch

It transmits data slower than switch.

It transmits data faster than hub.

It broadcasts the information packets to all computer connected network.

It transfers packets to only those selected computers connected in network.

 

b)   What is ICT? Write any two application of ICT.

ICT (Information and Communication Technology) refers to the use of computers, the internet, and other digital tools to manage, communicate, and share information.


 

Any two application of ICT are:

Education (E-learning): ICT is used for online classes, digital libraries, and virtual learning.

Health (Telemedicine): ICT is applied in remote health services, online consultation, and sharing medical records.

 

 

 

c)   What is Internet of Things (IoT) and how does it impact in everyday life?

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.

In daily life, IoT helps in smart homes (automatic lights and security), healthcare (wearable health trackers), and transportation (GPS-enabled smart vehicles). Thus, IoT makes life easier, safer, and more efficient.

 

d)   Write any two safety measures for online payment.

      Any two safety measures for online payment are:

      Use strong and unique passwords for online accounts.

      Avoid making payments on public Wi-Fi networks.

 

e)   What is cloud computing? Write its types.

Cloud computing is a technology that allows users to access and manage computing resources such as servers, storage, and applications over the internet.

Its types are:

Private cloud, public cloud and hybrid cloud.

 

f)   What is RDBMS? List few examples of it.

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

Examples of RDBMS:

·        MySQL

·        Oracle Database

·        PostgreSQL

·        MS Access

 

g)   Define validation rule and validation text in MS-Access?

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)   What are the differences between a SELECT query and UPDATE query?

 

Select Query

Update Query

- A select query is the most common category which is used to extract specific information from one or more tables in a database.

- The Select query is used to select data from a database.

- Update query is a type of action query which makes global changes to a group of records in one or more tables.

- The Update query is used to update existing records in a table.

 

i)    What is form? Why it is important?

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.

It is important because it provides 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).                                           (2)

DECLARE SUB PATT(S$)

 CLS

S$=”DEVELOPER”

CALL PATT(S$)

END

SUB PATT(S$)

C=LEN(S$)

I=10

FOR J=1 TO I STEP 2

PRINT TAB (I); MID$ (S$,J,C)

 C=C-2

I=I+1

NEXT J

END SUB

 

Dry Run Table

J

C (before print)

I (tab position)

MID$(S$, J, C)

Printed Output

1

9

10

DEVELOPER

(tab 10) DEVELOPER

3

7

11

VELOPER

(tab 11) VELOPER

5

5

12

LOPE

(tab 12) LOPE

7

3

13

PER

(tab 13) PER

9

1

14

R

(tab 14) R


The output of the program is

          DEVELOPER

           VELOPER

            LOPE

             PER

              R

 

 

 

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

            REM To check the greatest number.

      DECLARE GREAT SUB (a, b, c)

      ACCEPT a, b, c

      CALL GREAT (a, b, c)

      TERMINATE

      SUB 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

      END IF

      PRINT G; “The greatest number is:”; G

      END SUB

 


 

Debugged Program

REM To check the greatest number

DECLARE SUB GREAT (a, b, c)

CLS

INPUT a, b, c

CALL GREAT (a, b, c)

END

 

SUB 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

    PRINT "The greatest number is: "; G

END SUB

 

 

7.   Study the following program and answer the given questions:         (2)

DECLARE FUNCTION count(B$)

INPUT "Enter a word; W$

C=count(W$)

PRINT C

END

FUNCTION count(B$)

            FOR I =1 To LEN (B$)

                        X$=MID$(B$,I,1)

                        IF UCASE$(X$)="A" THEN

                        X=X+1

                        ENDIF

            NEXT I

            count=X

END FUNCTION

      Questions:

a)     What are the library functions used in the above program?

The library functions are: LEN() , MID$() and UCASE$() \

 

b) Write the use of variable "C" in line 3 in above program.

Variable C stores the number of occurrences of the letter ‘A’ in the given word, which is returned by the function.

[i.e. C=count(W$)]

 

Group 'C' (16 Marks)

 

8.   Convert / Calculate as per the instruction:                  (4 x 1=4)

i) (251)8 = (?)10                                                                              ii) (5D3)16 = (?)2 

iii) (111001 - 111) + 111001              iv) (101111 ÷ 111)     

 

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

    a)   WAP in QBASIC that ask length, breadth and height of room and calculate its perimeter and volume. Create using SUB…. END SUB to calculate volume and perimeter using FUNCTION…. END

          Function.         [Hint: Volume=LxBxH and perimeter=2[LxB]

 

REM Program to calculate Volume and Perimeter of a Room

DECLARE SUB Volume(L, B, H)

DECLARE FUNCTION Perimeter(L, B)

 

CLS

INPUT "Enter Length of room: ", L

INPUT "Enter Breadth of room: ", B

INPUT "Enter Height of room: ", H

 

CALL Volume(L, B, H)

PRINT "Perimeter of room = "; Perimeter(L, B)

 

END

 

SUB Volume(L, B, H)

    V = L * B * H

    PRINT "Volume of room = "; V

END SUB

 

FUNCTION Perimeter(L, B)

    Perimeter = 2 * (L + B)

END FUNCTION

 

 

      b)   Write a program to ask a number and check it is exactly

             divisible by 3 and 5 or not using SUB……END SUB.

 

REM Program to check divisibility by 3 and 5

DECLARE SUB CheckDiv(N)

 

CLS

INPUT "Enter a number: ", N

CALL CheckDiv(N)

END

 

SUB CheckDiv(N)

    IF N MOD 3 = 0 AND N MOD 5 = 0 THEN

        PRINT N; " is divisible by both 3 and 5."

    ELSE

        PRINT N; " is NOT divisible by both 3 and 5."

    END IF

END SUB

 

 

10.       WAP to find sum of digits of a number using SUB….END SUB.  (4)                                                                 [Hint: 123: 1+2+3=6]

 

REM Program to find sum of digits of a number

DECLARE SUB SumDigits(N)

 

CLS

INPUT "Enter a number: ", N

CALL SumDigits(N)

END

 

SUB SumDigits(N)

    S = 0

    WHILE N > 0

        R = N MOD 10

        S = S + R

        N = N \ 10

    WEND

    PRINT "Sum of digits = "; S

END SUB

 

                                                or

Write a program using function module to get the name of a user and print it in reverse order.

 

REM Program to reverse a name using FUNCTION

DECLARE FUNCTION RevName$(N$)

 

CLS

INPUT "Enter your name: ", N$

PRINT "Name in reverse: "; RevName$(N$)

END

 

FUNCTION RevName$(N$)

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

        R$ = R$ + MID$(N$, I, 1)

    NEXT I

    RevName$ = R$

END FUNCTION

 

 

?ÿ@

No comments:

Post a Comment