Sunday, 25 August 2024

COMPUTER PABSON


PABSON COMPUTER SET SOLVED                                                                         F.M: 50

Group “A”                                                                                                                         TIME:2 HR

1. Ans the following questions in one sentence: 6*1=6

(a) What is bandwidth?                                                         

Ans: Bandwidth is the maximum rate of data transfer across a given path, typically measured in bits per second (bps).

(b) What is cyber bullying?

Ans: Cyber bullying is the use of electronic communication to bully a person, typically by sending messages of an intimidating or threatening nature, often through social media, emails, or text messages.

 

(c)What is AI?

Ans: AI, or Artificial Intelligence, is the simulation of human intelligence processes by machines, especially computer systems, which include learning, reasoning, and self-correction.

 

(d) What is the storage size of memo and text data type in MS Access?

Ans: In MS Access, the storage size of the Memo data type is up to 1 GB, and the Text data type can store up to 255 characters.

 

(e) What is a local variable?

Ans: A local variable is a variable that is declared within a function or block and is accessible only within that function or block, ensuring that its scope is limited to that specific area of the code.

 

(f) What is an operator in C language?

Ans: An operator in C language is a symbol that tells the compiler to perform specific mathematical or logical functions, such as addition (+), subtraction (-), or logical AND (&&).

 

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

(a) Secret group of characters which helps to protect file from unauthorized person

Ans: Password

 

(b) A type of network in which every computer works as both client and server

Ans: Peer-to-peer network

 

 

 

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

(a) ADSL

Ans: Asymmetric Digital Subscriber Line

(b) TCP/IP

Ans: Transmission Control Protocol/Internet ProtocoL

4. Group “B”

Answer  the following questions: 9*2=18

(a) Differentiate between LAN and WAN

WAN (Wide Area Network): Covers large geographical areas, such as countries or continents.

 

 (Metropolitan Area Network): Covers a metropolitan area, typically a city or a large town.

 

Generally slower speeds and higher latency due to long distances

Higher speeds and lower latency due to smaller coverage area.

 

More complex due to scale and diversity of connections.

 

Less complex compared to WAN.

 

 

(b) Write any four commandments of computer ethics.

   Ans: Four commandments of computer ethics include:

1.     You should not not use a computer to harm other people.

2.     You should not not interfere with other people’s computer work.

3.     You should not not snoop around in other people’s computer files.

4.     You should not not use a computer to steal.

 

(c) What is e-commerce? List any two e-commerce companies in Nepal.

Ans: E-commerce is the buying and selling of goods and services over the internet. Two e-commerce companies in Nepal are Daraz and SastoDeal.

 

(d) What are the advantages of cloud computing?

Ans: Advantages of cloud computing include cost savings, as it reduces the need for physical hardware and maintenance; scalability, allowing businesses to easily adjust resources based on demand; and accessibility, enabling users to access data and applications from anywhere with an internet connection.

 

(e) What is VR? Mention its application areas.

Ans: VR, or Virtual Reality, is a simulated experience that can be similar to or completely different from the real world. Its application areas include gaming, where it provides immersive experiences; education, where it offers interactive learning environments; and medical training, where it allows for realistic simulations of surgical procedures.

 

 (f) What is DBMS? Give any two examples.

 Ans: DBMS, or Database Management System, is software designed to create, manage, and manipulate databases, ensuring data integrity and efficient data retrieval. It supports various operations like data insertion, updating, and querying. Examples include MySQL, Oracle.

 

(g) What is primary key? List any two advantages.

Ans: A primary key is a unique identifier for a record in a database table.

1.     Advantages include ensuring data integrity by preventing duplicate records.

2.     Enabling efficient data retrieval through indexing

(h) What is query?

Ans: In MS Access, a query is a tool used to retrieve specific data by specifying criteria. It allows users to filter, sort, and display data from one or more tables in a database.

(i) What is data sorting? Write its two advantages.

Ans: Data sorting in a database involves organizing data in a specific order based on one or more columns (fields) within a table. This can be done in ascending (A-Z or 0-9) or descending (Z-A or 9-0) order. Sorting helps in easier data retrieval, searching, and reporting by presenting data in a structured and logical sequence.

5. Write down the output of the given program : WITH DRY RUN TABLE [2]

DECLARE SUB DISPLAY(A)

  A=3

  CALL DISPLAY(A)

  END

 

  SUB DISPLAY(A)

  FOR X = 1 TO 6

  PRINT A;

  IF A MOD 2 = 0 THEN

  A = A / 2

  ELSE

  A = ( A * 3 ) + 1

  END IF

  NEXT X

  END SUB

Iteration (X)

Value of A

Printed Value

Calculation

New Value of A

1

3

3

(3 * 3) + 1

10

2

10

10

10 / 2

5

3

5

5

(5 * 3) + 1

16

4

16

16

16 / 2

8

5

8

8

8 / 2

4

6

4

4

4 / 2

2

So, the output of the program will be:

3 10 5 16 8 4

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

REM to add more data in a sequential data 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 to add more record "; M$

  LOOP WHILE UCASE$(M$)="Y"

  END

AFTER DEBUGGING

REM to add more data in a sequential data 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 record "; M$

LOOP WHILE UCASE$(M$) = "Y"

CLOSE #1

END

 7.     Study the following program and Ans the given questions: 2*1=2

DECLARE FUNCTION test$(A$)

CLS

INPUT "Enter any word "; T$

PRINT test$(T$)

END

FUNCTION test$(A$)

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

C$ = C$ + MID$(A$, M, 1)

NEXT M

test$ = C$

END FUNCTION

 

(a) List the formal and actual parameters used in the program given above.

Ans: Formal parameter: A$; Actual parameter: T$

(b) List the library function used in the above program.

Ans: Library functions used: LEN, MID$, UCASE$

 

Group “C”

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

(i) (CCA)₁₆ into Binary

Ans: 110011001010

(ii) (654)₁₀ into Octal

Ans: 1216

(iii) (111011)₂ ÷ (100)₂

Ans: 1110

(iv) (10101 - 1110)₂ × (10)₂

Ans: 11110

 Group “D”

9. Answer the following questions: 4*2=8

(a) Write a program in QBASIC that allows user to enter radius of a circle. Create a user defined function to find area of circle and sub procedure to find volume of a cylinder. Hint: [A=Ï€r², V=Ï€r²h]

Ans:

DECLARE FUNCTION AreaCircle (R)

DECLARE SUB VolumeCylinder (R, H)

INPUT "Enter radius of the circle: ", R

PRINT "Area of the circle: "; AreaCircle(R)

INPUT "Enter height of the cylinder: ", H

CALL VolumeCylinder(R, H)

END

 

FUNCTION AreaCircle (R)

AreaCircle = 3.14159 * R * R

END FUNCTION

 

SUB VolumeCylinder (R, H)

V = 3.14159 * R * R * H

PRINT "Volume of the cylinder: "; V

END SUB

(b) A sequential data file “emp.dat” contains employee’s name, address, gender and salary. Write a program to display all the information of employees whose salary is more than Rs.20,000.

Ans:

OPEN "emp.dat" FOR INPUT AS #1

DO WHILE NOT EOF(1)

INPUT #1, N$, A$, G$, S

IF S > 20000 THEN

PRINT N$, A$, G$,S

END IF

LOOP

CLOSE #1

END

10 . Write a program in C language to input any two numbers and find greatest number.

Ans:

#include <stdio.h>

 

int main() {

    int num1, num2;

    printf("Enter two numbers: ");

    scanf("%d %d", &num1, &num2);

    if (num1 > num2)

        printf("The greatest number is %d\n", num1);

    else

        printf("The greatest number is %d\n", num2);

    return 0;

}

OR

Write a program in C language that asks user to enter any number and check whether the number 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;

}

BY MILAN

http://www.milanbaral123.blogspot.com

 

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 

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