Wednesday, January 3, 2024

SOLVED KAVRE PABSON - SEE PRE QUALIFYING EXAMINATION 2080 - COMPUTER SCIENCE

 





SOLVED KAVRE PABSON - SEE PRE QUALIFYING EXAMINATION 2080 - COMPUTER SCIENCE

Subject :Computer Science

Time: 1 hr. 30 min

Full Marks:50

Class: X

Group-A

1. Very short answer questions:

 

a) What is communication?

Ans: Communication is sending and receiving information between two or more persons.

 

b) Which data type is used to store picture in Ms-Access?

Ans: The data type which is used to store picture in Ms-Access is OLE.

 

c) Define computer security.

Ans: Computer security means protecting computer and its content from damage, theft or misuse and action to prevent such incidents

 

d) What is E-commerce?

Ans: E-commerce refers to the buying and selling of goods or services using the internet.

 

e) What is formal parameter?

Ans: Parameters are variables that will receive data (arguments value) sent to the procedures (SUB program and FUNCTION).

 

f) Define C-programming.

Ans: C language is a structured programming language that divides program into many functions.

 

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

 

a) The mode of data communication in which data can be transferred in both directions at a time.

Full Duplex Mode

 

b) A unique numerical identifier for every device or network that connects to the internet. IP Address

 

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

 

a) SMTP - Simple Mail Transfer Protocol.

b) MODEM - Modulator-Demodulator.

 

Group-B

 

4. Short Answer Questions: 9×2=18

 

a) Distinguish between STP and UTP.

Ans: The difference between shielded and unshielded twisted pair cables are:

STP

UTP

UTP cable is a twisted pair cable with wires that are twisted together

It is enclosed within a foil or mesh shield.

the UTP cable is used to establish the connection within a short distance, like a home or small industry.

Generally, it is used to establish the connection for enterprises over a long distance.

b) Explain about star topology with the help of diagram.

Ans:

The network topology which connects all nodes to central device called hub/switch through a cable is called star topology. It provides fast performance and low network traffic. The failure of one node does not affect the rest of the nodes.

Diagram

Image result for star topology

 

c) Write about opportunities and threats in social media.

Ans:

Opportunities of using social media

a)     It creates awareness and innovate the way people live

b)     Social media let us share anything with others around the world.

c)     It keeps us informed about the world.

d)     It creates brand exposure for business to the largest audience.

Threats of using social media

a)     Personal data and privacy can be easily hacked and shared on the internet.

b)     More chances of creating fake accounts.

c)     Negative impact on the health.

d)     Decrease the working efficiency of people.

e)     Spreading false or unreliable information.

 

d) Define table in a database? Explain why it is important.

Ans: Table is a database object that stores a collection of related data organized in rows and columns, where each row represents a record and each column represents a field or attribute of that record.

It is important because entire data is managed and kept in a table for the future retrieval process. It makes sure that the information stays accurate and consistent.

 

e) Distinguish between validation rule and validation text.

Ans: The difference between validation rule and validation text is

Validation Rule

Validation Text

A rule that specifies the valid values or ranges of values that can be entered in the field.

A message that appears if a user enters invalid data in the field.

 

 

f) What is an online payment (electronic payment)? Make a list most common payment platforms used in Nepal.

Ans; Online payment refers to the payment for buying goods or services through the Internet using different online payment gateway. E.g. e-Sewa Nepal, i-Pay, Khalti, e-banking, etc.

 

g) "Artificial Intelligence is threat to humans". Give your opinion.

Ans: AI can be a threats to human. AI could become uncontrollable and pose a threat to humanity. This could happen if AI systems become more intelligent than humans and begin to act on their own, without human guidance or control. AI could be used for bad things like cyber attacks or making weapons that can decide on their own who to attack, causing a lot of harm. It's like giving a sharp knife to a toddler - bad idea

 

h) What is global variable? How it is declared?

Ans: Variables which are declared outside the procedure and whose values can be accessed from any procedure or module are called global variables.  It is declared by using  DIM SHARED or COMMON SHARED statement.

 

i) Define built in function? Explain about the use of LEN() function in QBASIC.

Ans: Built-in functions are  readymade functions provided by QBASIC. LEN ( ) function returns the number of characters in a string or the number of bytes required to store a variable.


5. Write down the output of the following program with dry run table.

DECLARE SUB REG(M,N$,T)

CLS

A=1

X$=”PABSON”

CALL REG(A,X$,T)

END

SUB REG(M,N$,T)

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

PRINT MID$(N$,I,M)

M=M+1

NEXT I

END SUB

 

Dry Run

A

X$

M

T

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

 PRINT MID$(N$,I,M)

1

PABSON

1

0

6 TO 1 STEP-1 Yes

MID$(PABSON,6,1)

N

 

 

2

 

5 TO 1 STEP -1 Yes

MID$(PABSON,5,1)

ON

 

 

3

 

4 TO 1 STEP -1 Yes

MID$(PABSON,4,1)

SON

 

 

4

 

3 TO 1 STEP -1 Yes

MID$(PABSON,3,1)

BSON

 

 

5

 

2 TO 1 STEP -1 Yes

MID$(PABSON,2,1)

ABSON

 

 

6

 

1 TO 1 STEP -1 Yes

MID$(PABSON,1,1)

PABSON

 

 

7

 

0 TO 1 STEP -1 No

 Loop Exits

 

The output of the program is :

N

ON

SON

BSON

ABSON

PABSON

 

 

 

 

 

6. Re-Write the given program after correcting the bugs:

 

DECLARE FUNCTION RESULT$(X,Y)

CLS

INPUT “Enter marks in math:”, M

R$=RESULT$(X,N)

PRINT M$

END FUNCTION

 

FUNCTION RESULT$(X,Y)

IF X>=40 AND Y>=40 THEN

RESULT$ = "Pass"

ELSE

RESULT$ = "Fail"

END IF

END SUB

 

Debugged Program

DECLARE FUNCTION RESULT$(X,Y)

CLS

INPUT “Enter marks in math and science:”, M, N

R$=RESULT$(M,N)

PRINT R$

END

 

FUNCTION RESULT$(X,Y)

IF X>=40 AND Y>=40 THEN

RESULT$ = "Pass"

ELSE

RESULT$ = "Fail"

END IF

END FUNCTION

 

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

 

DECLARE FUNCTION MATH$(R)

CLS

DIM SHARED P

INPUT "Enter first number:"; P

INPUT "Enter second number:"; C

Y$ = MATH$(C)

PRINT Y$

END

 

FUNCTION MATH$(R)

F=100 MOD R

IF 20 MOD P > 3 AND F < P THEN

MATH$=”True”

ELSE

MATH$=”False”

END IF

END FUNCTION

a) Variable P remained uncalled in the main module. Why?

Ans: Variable P remained uncalled in the main module because P is declared as global variable and its value can be accessed by MATHS$ ( ) function without passing the value.

 

b) Find the output if the user supplies P=9 and c=4 running the program.

Ans: The output of the program if the user supplies P=9 and c=4 running the program is:

False

 

Dry Run

P

C

R

F=100 MOD R

20 MOD P > 3 AND

F < P

PRINT Y$

9

4

4

100 MOD 4

=0

20 MOD 9 >3

2>3 AND 0<9

Yes AND No

No

False

 

Group-C

 

8. Convert as instructed:

 

a) (B7D)16=(?)8

b) (645)10=(?)16

c) (10101)2 ×(110)2

d) (1110101)2 × (110)2

 

9. a) Write a program in QBASIC to input length and breadth of a rectangle and calculate area using function-procedure and perimeter using sub-procedure.[4]

 

DECLARE FUNCTION AREA (L, B)

DECLARE SUB PER (L, B)

 

CLS

INPUT “ENTER LENGTH”; L

INPUT “ENTER BREADTH”; B

PRINT “AREA OF RECTANGLE=”; AREA(L,B)

CALL PER(L,B)

END

 

FUNCTION AREA (L, B)

AREA = L * B

END FUNCTION

 

 

SUB PER (L, B)

P = 2 * (L + B)

PRINT “PERIMETER OF RECTANGLE=”;P

END SUB

 

 

 

 

 

b) A sequential data file named “user.dat” has data under the fields [ Name, Age, Sex, Contact No and Address ]. Write a program that displays the record of those users whose age is more than 35.   [4]

 

OPEN “user.dat” FOR INPUT AS #1

CLS

PRINT “Name”, “Age”, “Sex”, “Contact No.”, “Address”

WHILE NOT EOF(1)

INPUT #1, N$, A, S$, C, D$

IF A>35 THEN PRINT N$, A, S$, C, D$

WEND

CLOSE #1

END

 

 

 

10. Write a C program to find sum of the numbers from 22 to 32 using FOR loop.

 

#include <stdio.h>

int main ( )

{

   int i, sum = 0;

   for (i = 22; i <= 32; i++) {

       sum += i; 

   }

   printf("The sum of the numbers from 22 to 32 is: %d\n", sum);

   return 0;

}

 

 

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

 

#include <stdio.h>

int main()

{

    int number;

    printf("Enter a number: ");

    scanf("%d", &number);

    if (number > 0)

{

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

    }

else if (number < 0)

{

        printf("%d is negative\n", number);

    }

else

{

        printf("%d is zero\n", number);

    }

 

    return 0;

}

Wednesday, December 27, 2023

SOLVED National PABSON Kathmandu SEE PRE-QUALIFYING EXAMINATION-2080





 SOLVED National PABSON Kathmandu SEE PRE-QUALIFYING EXAMINATION-2080


Sub-Computer Science

 

Group A (10 Marks)

 

1. Answer the following questions in One sentence:

 

a)     What is web server?

Ans: A web server is a computer that serves requested HTML web pages, files or data to users or client computers over the internet or local network.

 

b)    List out any two applications of internet.

Ans: Any two applications of internet are E-mail and E-Commerce

 

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 an object of Ms-Access which is 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 used to divide program into many small, manageable, logical and functional modules or blocks.

 

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

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

 

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 cabling structure of interconnected computers in LAN.

Advantages of bus topology are:

It is cost effective and cable required is least compared to other network topology.

It is easy to expand network.

 

 

 

b. What is cyber-crime? Explain with example.

Ans: Cybercrime refers to criminal activities or illegal actions that are conducted or facilitated through the use of digital technology or the internet.

Eg. Hacking. Computer hacking means stealing and destroying other data, information, files and program.

 

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

Ans: Password secures the data by protecting the data from unauthorized access. By implementing and enforcing a robust password policy, organizations and software systems can significantly reduce the risk of unauthorized access, data breaches, and cyberattacks. It's an essential element in safeguarding sensitive information and maintaining the security and integrity of computer software and data.

 

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

Ans: The advantages and disadvantages of e- commerce are:

Advantages of E-commerce

It makes buying/selling possible 24/7.

There are no geographical boundaries for e-business. Anyone can order anything from anywhere at any time.

Disadvantages of E-commerce

Lack of personal touch. We cannot touch the goods physically.

Technical failure may affect the business system.

 

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

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.

The advantages of e- governance are:

Citizens 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. 

 

f. What is DBMS? Give Example

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

E.g., MS-Access, Oracle, Fox pro, dBase etc.

 

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

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. 

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 form? Explain.

Ans: Form is a database object that provides a graphical interface for users to view, enter, and edit data from one or more tables, queries, or other data sources. Forms provide an easy-to-use interface for data entry and manipulation, improving data accuracy and completeness. Forms can be linked to other objects, such as tables or queries, to simplify data management

 

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:

Studnent Name  Text

Student’s Roll Number – Autonumber

Address – Memo,                               Fee Paid - Currency

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$(MIDS(S$,I,1))

ELSE

EE$=EE$+UCASE$(MIDS(S$,I,1))

END IF

NEXT i

PRINT EE$

END SUB

 

Dry Run

E$

S$

i=1 to LEN(S$)

i MOD 2 <>0

E$

NPABSON

NPABSON

1 to 7

1 MOD 2 <>0

1<>0 Yes

n

 

 

2 to 7

2 MOD 2 <>0

0<>0 No

n+P=nP

 

 

3 to 7

3 MOD 2 <>0

1<>0 Yes

nP+a

nPa

 

 

4 to 7

4 MOD 2 <>0

0<>0 No

nPa+B

nPaB

 

 

5 to 7

5 MOD 2 <>0

1<>0 Yes

nPaB+s

nPaBs

 

 

6 to 7

6 MOD 2 <>0

0<>0 No

nPaBs+O

nPaBsO

 

 

7 to 7

7 MOD 2 <>0

1<>0 Yes

nPaBsO+n

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, NS, ADS, CL, S$

NEXT

STOP #1

END

 

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:

 

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: the names of two built in functions used in the above program are LEN ( ) and RIGHT$ ( )

 

b. List the real parameters of the above program

Ans: The real parameters of the above program is W$

 

GROUP C (16 Marks)

 

8. Convert/Calculate as per the instruction: 4x14

 

1) (315)→(7)2

ii) (A4B)16 – ( ? )8

(1011) × (101) + (1001)

(10111) ¸ (101)

 

9. Answer the following

 

a. WAP to calculate area of rectangle using SUB...END SUB and arca 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 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, r, 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>

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;

}