Monday, August 19, 2024

Set 6: SOLVED SOS 2080 SEE COMPUTER SCIENCE

 


Set 6: SOS 2080

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:                                                          [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

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 single items in a database.

A field is a column in a table which contains information about a certain type for all records.

For example, in Table – Book Records, all the information about a book is record. Here, the combination of Code, Book Name, Level, Author, Year of Publication values forms a record.

For example, in Table – Book Records, Code, Book Name, Level, Author, Year of Publication are the fields of book records 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

END SUB

 

 

N

A

B=A MOD 6+3

IS B MOD 4=0?

PRINT B;

A=A-10

LOOP WHILE A>=50

87

87

87 MOD 6+3

3+3=6

6 MOD 4=0?

2=0? NO

6

87-10=67

67>=50 YES

 

 

67 MOD 6+3

1+3=4

4 MOD 4=0?

0=0? YES

 

67-10=57

57>=50 YES

 

 

57 MOD 6+3

3+3=6

6 MOD 4=0?

2=0? NO

6

57-10=47

47>= 50 NO

LOOP EXITS

 

 

 

 

 

 

 

 

The output of the program is:

6  6

 

6. Rewrite the given program after correcting the bugs:

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 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 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 the sub procedure?

Ans: The name of the sub procedure is PC ( )

h List the local variables.

Ans: The local variables are:  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

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
by 8

Quotient

Remainder

(Digit)

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

 

Write 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)

CLS

INPUT "Enter a number: ", N

CALL 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 UCASE$(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() {

    int i, count = 0;

    for(i = 1; count < 10; i += 2) {

        printf("%d\n", i);

        count++;

    }

    return 0;

}

 

 

No comments:

Post a Comment