Saturday, 24 August 2024

COMPUTER 2081 SOLVED SET

 KMC SECONDARY SCHOOL SOLVED SET

F.M:50                                                                                                                                                         

                                                                                    TIME:2HRS 

SUBJECT: COMPUTER SCIENCE 

1. Answer the following questions in one sentence                                [6X1=6]

a. What is server computer?

A server computer is a powerful machine designed to provide services, data, or resources to other computers over a network.

 

b. What is database? Give examples of it. 

A database is an organized collection of data that can be easily accessed, managed, and updated. Examples 

1. Dictionary 

2. Marks ledger

 3. Telephone Directory

c. Write the importance of the query. 

A query is crucial because it allows users to retrieve and manipulate data from a database efficiently.

d. How can data redundancy be reduced in the database?

 Data redundancy can be reduced in database by normalization of database 

 

e. What are parameters in modular programming? 

In modular programming, parameters are variables passed to functions or modules to provide them with input data.

1. Formal parameter 

2. Real parameter 

 

f. What is 'char' and why is it used in C programming?
  In C programming, char is a data type used to store a single character, such as a letter, digit, or symbol.

 

2. Write appropriate technical term for the following:    [2X1=2]

 a. Protocol used to receive email from the mail server: Post office protocol 

 b. A computer program that has been created to do damage to your computer system. Malware. 

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

a. MODEM: Modulator and Demodulator.

b. WAP: Wireless Access Point. 

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

   a) What is digital citizenship? Write its importance. 

     Digital citizenship is the responsible and ethical use of technology to engage in societal, political, and governmental activities.

     Importance:

1.     It Protects personal information and mitigates cyber threats.

2.     It Promotes courteous communication and prevents cyberbullying.

3.  By practicing digital citizenship, individuals can engage in meaningful online discussions, participate in digital activism, and contribute to social causes responsibly.

  b) What is network topology? Enlist its types 

   Network topology is the physical or logical arrangement of nodes and connections in a computer network. It defines how different devices and components are interconnected and communicate with each other, influencing the network’s performance, scalability, and fault tolerance.

1.     Bus Topology: All devices are connected to a single central cable.

2.     Star Topology: All devices are connected to a central hub.

3.     Ring Topology: Each device is connected to two other devices, forming a ring.

 

2. Define encryption and decryption.

The process of converting plain text into a coded format (ciphertext) to prevent unauthorized access is called encryption.

The process of converting ciphertext back into its original format (plain text) so it can be understood is called decryption.

 

3. What is e-commerce? Give examples of e-commerce websites.

E-commerce (electronic commerce) refers to buying and selling goods or services using the internet. Examples of e-commerce websites include:

1.     WWW.AMAZON.COM 

2.     WWW.DARAZ.COM.NP 

     3.    WWW.ALIBABA.COM 

4. Write down the difference between primary key and foreign key.

Primary key

Foreign Key

A unique identifier for each record in a table.

 A field in one table that uniquely identifies a row of another table

 It cannot contain NULL values.

It can contain NULL values and duplicates.

Only one primary key is allowed per table.

A table can have multiple foreign keys.



 

5. What is RDBMS? Give examples of RDBMS software.

RDBMS (Relational Database Management System) is a type of database management system that stores data in tables and allows for relationships between tables. Examples include:

1. MySQL

2. PostgreSQL

3.Oracle

4.Microsoft SQL Server

SQLite

6. List the different objects of MS Access. Define any one.

MS Access includes several objects, such as:

1.     Tables

2.     Queries

3.     Forms

4.     Reports

5.     Macros

6.     Modules

Tables: These are used to store data in rows and columns. Each table contains data about a specific topic, such as customers or orders.

 

7. What is e-governance? List its benefits.

E-governance refers to the use of information and communication technology (ICT) to deliver government services, exchange information, and integrate various stand-alone systems and services. Benefits include:

1.     Increased transparency

2.     Improved efficiency

3.     Enhanced accessibility of services

4.     Cost reduction

5.     Better citizen engagement

 

8. What is computer ethics? Write the ethical points that the computer user should remember.

Computer ethics refers to the set of moral principles that regulate the use of computers and related technology. Ethical points that computer users should remember including:

1.     Do not use the computer to harm other people’s data.

2.     Do not interfere with other people’s computer work.

3.     Do not use a computer to steal 

 

5. Write the output of the given program (workout with dry- run table) 

   

DRY RUN OUTPUT

DECLARE SUB skill()

CLS

CALL skill

END

LET N=5

LET A=4

FOR J= 1 TO 5 STEP 1

PRINT N;

N=N*10+A

A=A+1

NEXT J

END SUB

DRY RUN OUTPUT 

ITERATION

PTINTED VALUE N

N=N*10+A

UPDATED N

UPDATED A

1

5

5*10+4

54

5

2

54

54*10+5

545

6

3

545

545*10+6

5456

7

4

5456

5456*10+7

54567

8

5

54567

54567*10+8

545678

9

 LOOP EXISTS

The output after each iteration (all printed on the same line due to the semicolon PRINT N;) is: 5 54 545 5456 54567 545678n

 

6.  Rewrite the program after correcting the bugs.

Rem to store name and age in an 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"; A1

INPUT " Enter employee's gender ";G$

INPUT " Enter employee's salary";S 

WRITE#1, A$,A1, G$,S 

INPUT " Add more records(Y/N)'';A

LOOP WHILE UCASE(A$)="Y"

CLOSE 1 

END 

 

AFTER DEBUGGING 

 

REM to store name, age, adress, gender and salary in a sequential data file  Employee.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 ";A1

INPUT " Enter employee's gender";G$

INPUT " Enter employee's salary ":S

WRITE#1, N$, A$, A1, G$, S 

INPUT " Add more records (Y/N)";A$

LOOP WHILE UCASE$(A$)= ''Y''

CLOSE#1 

END 

 

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

DECLARE FUNCTION CHK$(N)

CLS 

N=57

N=ABS(N)

PRINT " THE NUMBER IS";CHK$(N)

END 

FUNCTION CHK$(N)

FOR I= 1 TO  N 

IF N MOD I= 0 THEN C= C+1 

NEXT I 

IF C>2 THEN 

CHK$="COMPOSITE"

ELSE 

CHK$="PRIME"

END IF 

END FUNCTION 

A. Why is the $ sign used in the name of the above function?

It  is used to indicate that the function returns a string value. In this case, CHK$ is a function that returns either the string “COMPOSITE” or “PRIME”.

B. List the conditional statements used in the above program

The conditional statements used in the program are:

IF N MOD I = 0 THEN C = C + 1

IF C > 2 THEN CHK$ = "COMPOSITE" ELSE CHK$ = "PRIME"

 

9. Write a program in  QBASIC to input length of three sides of a traingle, create a user defined function procedure to calculate and display its area and create a user defined sub procedure to calculate perimeter. Hints 1/2*b*h and perimeter= a+b+h]  [4] 

  

DECLARE FUNCTION Area(b, h)

DECLARE SUB Perimeter(a, b, h)

 

CLS

 

INPUT "Enter the length of side a: "; a

INPUT "Enter the length of side b: "; b

INPUT "Enter the length of side c (treated as height h): "; h

 

INPUT "Enter the base of the triangle: "; B

INPUT "Enter the height of the triangle: "; H

 

PRINT "The area of the triangle is: "; Area(B, H)

 

CALL Perimeter(a, b, h)

 

END

 

FUNCTION Area(b, b)

    Area = 0.5 * b * h

END FUNCTION

 

SUB Perimeter(a, b, h)

    p = a + b + h

    PRINT "The perimeter of the triangle is: "; p

END SUB

 

10. A data file "lib.txt" consists of the book's name author's name and price of books.

Write a program to display all the content of a file as well as count and display the total number of records present in the file. [4]

 

CLS

OPEN "lib.txt" FOR INPUT AS #1

count = 0

WHILE NOT EOF(1)

    INPUT #1, bookName$, authorName$, price

    PRINT "Book Name: "; bookName$

    PRINT "Author Name: "; authorName$

    PRINT "Price: "; price

    PRINT

    count = count + 1

    WEND

PRINT "Total number of records: "; count

CLOSE #1

END

 

11. Write a c program to input any three numbers and display the smallest among three numbers [4]

#include <stdio.h>

int main() {

    int a, b, c, smallest;


    printf("Enter three numbers: ");

    scanf("%d %d %d", &a, &b, &c);


    if (a <= b && a <= c) {

        smallest = a;

    } else if (b <= a && b <= c) {

        smallest = b;

    } else {

        smallest = c;

    }

  printf("The smallest number is: %d\n", smallest);


    return 0;

}


Write a program in c to display only odd numbers between 50 to 100 

 

#include <stdio.h>

int main() {

    int i;

    for (i = 51; i < 100; i += 2) {

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

    }

 

    return 0;

}

NOTE: BINARY CALCULATIONS HAVE NOT BEEN INCLUDED IN THIS BLOG. 

 

BY MILAN BARAL 


WWW. MILANBARAL123BLOGSPOT.COM 

No comments:

Post a Comment

SEE IMP QUESTIONS C LANGUAGE

  Write a C program to calculate simple interest . The program should accept the principal amount , rate of interest , and time period as ...