Thursday, May 25, 2023

MODULAR PROGRAMMING 2080 [SEQUENTIAL STRUCTURE] – SEE COMPUTER SCIENCE 2080

  1. Write a program in QBASIC that asks any three numbers and display average and product. Create a user defined function to calculate average and sub program to calculate product.
  2. Write a program in QBASIC that asks any two numbers and display sum and difference. Create a user defined function to calculate sum and sub program to calculate difference.
  3. Write a program in QBASIC that asks any number and display square and cube root of a given number. Create a user defined function to calculate cube and sub program to calculate square root.
  4. Write a program in QBASIC that asks any number and display square and cube root of a given number. Create a user defined function to calculate cube root and sub program to calculate square.
  5. Create a user defined function to calculate simple interest. [I = P* T * R / 100]
  6. Write a sub procedure to calculate distance. DISTANCE = U * T + 1 / 2 * A * T ^ 2
  7. Create a user defined function to calculate area of four walls. A = 2 * H * (L + B)
  8. Write a sub program cost (l,b,h,c) to find the cost of painting the four walls of a room.
  9. Write a sub procedure to calculate area of triangle. A = 1 / 2 * (B * H)
  10. Write a program in QBASIC that asks radius of a circle to calculate its area and circumference. Create a user defined function to calculate area and sub program to calculate circumference.[Hint A=Pr2, C= 2Pr] – SEE 2079
  11. Write a QBASIC Program to read the side of a cube. Calculate its volume using function procedure and calculate surface area using sub procedure. (Hint: vol=side3 and sa=6 side2]
  12. Write a program in QBASIC that ask the radius of circle. Write a program to calculate the area and circumference of a circle. Create a user defined function first (r) to calculate area and sub procedure second (r) to calculate circumference of a circle.
  13. Write a QBASIC program that asks length, breadth, height and calculate volume of Cuboid and Total Surface Area. Create a USER DEFINED FUNCTION to calculate Volume of Cuboid and SUB-PROGRAM to calculate Total Surface of Area. TSA=2*(L*B+B*H+L*H) , VOL=L*B*H
  14. Write a program in QBASIC that asks length, breadth and height of room and calculates its area and volume. Create a user-defined function to calculate area and sub-program to calculate volume. A=L×B, V=L×B×H
  15. Write a program in QBasic that ask the radius and height of a cylinder and calculate the volume and curve surface area. Create a user-defined function to calculate volume and sub-procedure to calculate curve surface area of a cylinder. [Hints: V=πr2h, CSA=2πrh]
  16. Write a program in QBasic that ask the radius and calculate the volume and total surface area. Create a user-defined function to calculate volume and sub-procedure to calculate total surface area of a sphere. [Hints: V=4/3πr2, TSA=4πr2]
  17. Write a program in QBasic that ask the radius and calculate the volume and total surface area. Create a user-defined function to calculate total surface area and sub-procedure to calculate volume of a hemisphere. [Hints: V=2/3πr2, TSA=3πr2]
  18. Write a program in QBASIC to input length and breadth of room and calculate its area using function and perimeter using sub procedure. [Hint: Area = L2. Perimeter = 4×L]
  19. Write a program in QBASIC to input length and breadth and calculate area of square using sub and perimeter using function procedure. [Hint: Area = lxb. Perimeter = 2(l+b)]
  20. Write a program to calculate total surface area of a cylinder using function procedure and volume using sub procedure. [Hint: Total surface area-2pr(r+h), Volume=pr2h] 
  21. Write a program in QBASIC that will asks the user to input length, breadth and height of a room then use SUB procedure calculate its volume and FUNCTION procedure to calculate its area of four walls.
  22. Write a program using Function…..End Function to get temperature in Celsius from the user and then print the temperature in Fahrenheit.(hint: F=9C/5+32)
  23. Write a program to input Fahrenheit and convert it into Celsius using SUB - END SUB. C = (F – 32) * (5 / 9)
  24. Write a program to convert USD(dollar) into NC (NEPALI currency) using DECLARE FUNCTION.
  25. Write a program to convert NC (NEPALI currency) into IC (Indian Currency) using DECLARE SUB and convert NC into Dollar using DECLARE FUNCTION.
  26. WRITE A PROGRAM to ask a number as paisa and convert them into corresponding rupees only solve it using SUB Procedure.
  27. Write a program to input distance in kilometer and convert into meter using function procedure.
  28.   Using FUNCTION……END FUNCTION, write a program to input cost price and selling price from the keyboard to calculate profit and using sub procedure to calculate profit percentage.
  29. Write a qbasic program to calculate loss using sub procedure and loss percentage using function procedure.
  30. Write a program to calculate the area of triangle by using SUB…..END SUB. [Hints: Area= 





Friday, April 14, 2023

Solved SEE 2079 Computer Science

  

Solved SEE 2079 Computer Science

SEE 2079

Opt II. [Computer Science]

1. Answer the following questions in one sentence.

a) What is network protocol?

Ans: A network protocol refers to a set of rules and standards that govern the communication between devices or computers on a network.

b) What is e-commerce?

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

c) What is the default size of text field in MS-Access?

Ans: The default size of a text field is 50 characters in MS-Access.

d) Which data type is used to store photo in MS-Access?

Ans: The data type used to store photos is called an OLE Object data type.

e) What is looping?

Ans: Looping is a programming concept that allows a set of instructions to be repeated multiple times in a program.

f) List any two data types used in C-programming language.

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

2. Write appropriate technical term for the following:

a) A program that can disinfect a file from virus. Antivirus software.

b) Learning through the electronic media. E-Learning.

3. Write the full form of the following:

a) G2G – Government to Government

b) ISP – Internet Service Provider

4. Answer the following questions:

a) What is network topology? List any two types of network topology.

Ans: Network topology refers to the physical or logical layout of a computer network. Any two types of network topology are bus topology and star topology.

b) What is antivirus software? Name any two popular antivirus software.

Ans: Antivirus software is a type of program designed to detect, prevent, and remove malicious software (malware) from computers and other devices. Any two popular antivirus software are Kaspersky and Norton Antivirus.

c) Define cyber law and cyber crime.

Ans: Cyber law is a type of law that governs the use of the internet, computers, and related technologies. Cyber crime refers to criminal activities that are committed using computers or the internet.

d) Define virtual reality. Write any two areas where virtual reality is used.

Ans: Virtual reality is a technology that creates a computer-generated environment that users can experience and interact with using specialized hardware such as head-mounted displays. Any two areas where virtual reality is used are Gaming and Education and Training.

e) What is password? Write any two importance of password protection.

Ans: A password is a secret code that you use to verify your identity and access your accounts or devices. Any two importance of password protection are:

- to protect your passwords because it helps to keep your personal information and accounts safe from unauthorized access.

- to ensure security and privacy, as well as prevent hacking, identity theft, and other cybercrimes.

f) What is DBMS? Write four objects of MS-Access.

Ans: DBMS is a software system that helps users to store, retrieve, and manage data in an efficient and organized way. Any four objects of MS-Access are Table, Form, Query and Report.

g) What are validation text and validation rule?

Ans: Validation text is the message that appears when a user enters invalid data into a field. Validation rule is a condition that must be met in order for data to be accepted into a field.

h) What is form? Write any two advantages of it.

Ans: A form is an object of MS-Access which provides a graphical interface that allows users to interact with the data in a database. Any two advantages of form are:

- It provide a user-friendly interface for users to input and display data.

- It can include validation rules that help ensure that data entered into fields meets specific requirements.

i) What is record? Why is primary key necessary in record?

Ans: A record refers to a collection of related data fields that are organized and stored together. A primary key is necessary in a database record because it helps to ensure the accuracy and integrity of data in a database by ensuring that each record is unique and identifiable.

5. Write down the output of the given program:

DECLARE SUB Series(A)

CLS
A=20

CALL Series(A)

END

SUB Series(A)

FOR K=1 to 5

PRINT A;

A=A+10

NEXT K

END SUB

Dry Run

Variable

Variable

Loop Check

Output

A

K

1 to 5

20 30 40 50 60

20

1

1 to 5 yes

 

30

2

2 to 5 yes

 

40

3

3 to 5 yes

 

50

4

4 to 5 yes

 

60

5

5 to 5 yes

 

70

6

6 to 5 no

Loop exits

 

 Output

20 30 40 50 60

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

REM program to make a word reverse

DECLARE FUNCTION Rev$(N$)

CLS

LNPUT “Enter a word”; N$

DISPLAY “Reversed is”; Rev$(N$)

END

EUNCTION Rev$(N$)

FOR K=LEN$(N$) To 1 STEP-1

B$=B$+MID$(N$,1,K)

NEXT K

B$=Rev$

END FUNCTION

Debugged Program

REM program to make a word reverse

DECLARE FUNCTION Rev$(N$)

CLS

INPUT “Enter a word”; N$

PRINT “Reversed is”; Rev$(N$)

END

FUNCTION Rev$(N$)

FOR K=LEN (N$) To 1 STEP-1

B$=B$+MID$(N$,K,1)

NEXT K

Rev$=B$

END FUNCTION

Study the following program and answer the given questions:

DECLARE FUNCTION SUM(N)
CLS
INPUT “Enter any number”; N

X=SUM(N)

PRINT “The sum of individual digit is “; X

END

FUNCTION SUM(N)

WHILE N<>0

R=N MOD 10

S=S+R

N=INT(N/10)

WEND

SUM=S
END FUNCTION

a) Write the function of INT.

Ans: The INT function is used to round down a number to the nearest integer value.

b) How many times does the WHILE ….WEND loop repeat if the value of N is 123?

Ans: The WHILE ….WEND loop repeats 3 times if the value of N is 123.

8. Convert/Calculate as per the instruction:

a) (10110011)2 – (?)16

b) (410)10 = (?)2

c) (1001 + 110)2 – (1000)2

d) (10110)2 ¸ (101)2

9. a) Write a program in QBASIC that asks radius of a circle to calculate its area and circumference. Create a user defined function to calculate area and sub program to calculate circumference.

[Hint A= Pr2, C= 2Pr]

b) A sequential data file called “Record.dat” has stored data under the field headings: Roll No., Name, Gender, English, Nepali, Maths and Computer. Write a program to display all the information of those students whose marks in English is more than 40.

c) Write a program in C language that asks any two numbers and displays the greatest among them.

Write a program in C-Langauge to display the series with their sum. 1,2,3,4….upto 10th terms.

 

 

 

 

 

Saturday, February 25, 2023

Database Management System (DBMS) [ SEE COMPUTER SCIENCE 2079 ]

 SEE COMPUTER SCIENCE 2079                                                Database Management System (DBMS)            

 





Database

A database is an organized collection of data that is designed to efficiently store, manage, and retrieve information.

E.g. Dictionary, Marks Ledger, Telephone Directory etc.

 

DBMS (Database Management System)
A 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.

RDBMS (Relational Database Management System)
RDBMS is a type of DBMS that uses a relational model to organize and manage data, allowing users to easily retrieve and manipulate it.
E.g.: MySQL, Oracle, MS Access etc.

Advantages of DBMS

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

 

MS-Access

Microsoft Access is a relational database management system (RDBMS) that allows users to store, organize, and manage large amounts of data.

 

Features of MS-Access

a)     It provides the flexible ways to add, edit, delete and display the related data.

b)     Queries help to view, change and analyse the data indifferent ways.

c)     Forms are used for viewing and editing the information.

d)     Reports are used for summarizing and printing the data.

 

Objects of MS-Access

·       Tables: Used to store data in a structured format with columns and rows.

·       Queries: Used to retrieve and manipulate data from one or more tables based on specified criteria.

·       Forms: Used to create user-friendly interfaces for entering and viewing data in tables.

·       Reports: Used to generate formatted and organized views of data from tables or queries.

 

Computerized Database vs Non-Computerized Database

Computerized Database

Non-Computerized Database

It can store large volume of data. It is very fast to find a specific record.

It is limited by physical storage available.

The database can be kept secure by use of passwords.

The only security would be locking up the records.

We can search data very easily.

It can take a while to manually search through all of the records.

Data can be sorted into ascending or descending order on multiple criteria.

Difficult to sort data on more than one criteria.

 

 

 

Data

·       Data refers to any collection of raw facts, figures, or other information that can be processed or analyzed.

·       Data measured in bits and bytes.

·       Data never depends on information.

·       E.g.: Ram, student, 20, etc.

 

Information

·       Information is processed or organized data that has meaning and context for its users.

·       Information is measured in meaningful units like time, quantity, etc.

·       Information is dependent on data

·       E.g. “Ram is a student. He is 20 years old.”, is information that gives a complete sense.

 

Table.

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.
The different ways to create table are:

·       Table Design View

·       Table Wizard

Importance of table

·       Tables store and organize data efficiently, reducing data redundancy and inconsistencies.

·       Tables enable the use of data validation rules to ensure data accuracy and completeness.

·       Tables are essential for creating forms, queries, and reports that extract useful insights and information from data.

·       Tables provide security features to restrict access to sensitive data and ensure data privacy.

 

Form

Form is a database object that provides a graphical user interface for users to view, enter, and edit data from one or more tables, queries, or other data sources.

Methods to create a form are:
Form Design View

·       Form Wizard

Importance of form

·       Forms provide 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.

·       Forms enable users to customize the look and feel of data input screens.

·       Forms can be linked to other objects, such as tables or queries, to simplify data management.

 

Query

Query is a request for information from a database, used to retrieve and display data based on specified criteria, such as filtering, sorting, or calculating values.
Methods to create a query are:
Query Design View

Query Wizard

 

The different types of query are:
i) Select query
ii) Action query
In action query, we have update query, append query, delete query and make-table query.

 

Advantages of query

·       Queries enable users to retrieve specific data from tables or other data sources, based on specified criteria.

·       Queries allow users to filter, sort, and group data in meaningful ways.

·       Queries enable users to perform calculations and aggregate functions on data to extract useful insights.

·       Queries can be used to create reports and forms that extract meaningful information from data.

 

Select query

A select query is a type of query used to retrieve and display data from one or more tables or queries, based on specified criteria or selection rules, such as filtering or sorting.

Action query

An action query is a type of query used to perform a specific action on a set of records, such as adding, deleting, updating, or appending records in a table or query based on specified criteria or selection rules.

 

Update query

An update query is a type of action query used to modify or update existing data in a table or query based on specified criteria, such as changing values in a field or updating multiple records at once.

 

Append query

An append query is a type of action query used to add records from one or more tables or queries to another table, based on specified criteria or selection rules.

 

Delete query

A delete query is a type of action query that removes specific records or all records from a table.

 

Make table query

A make-table query is a type of query used to create a new table based on the results of a select query.

 

Report

Report is a formatted presentation of data from one or more tables or queries, designed for printing or sharing.

The data sources for report are table and query.
The methods of creating report are:
Methods to create a form are:
Report Design View

Report Wizard

Why is Report created?

Reports are created in MS Access to present data from one or more tables in a formatted and organized manner, allowing users to easily view and analyze the information.

 

Importance of report

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

·       Reports can be exported or printed for sharing with others.

·       Reports can be based on tables, queries, or other reports, providing flexibility and ease of use.

Data type  

Data type is an attribute for a field that determines the type of data that can be stored in that field.

 

·       Text: Used for storing alphanumeric text values such as names, addresses, and descriptions.

·       Memo: Used for storing large blocks of text or lengthy descriptions.

·       Number: Used for storing numeric data such as integers, decimals, or currency values.

·       Auto number: Unique value generated by Access for each new record. (4 bytes)

·       Date/Time: Used for storing dates and times. (8 bytes)

·       Yes/No: Used for storing boolean (true/false) values. (1 bit)

·       Attachment: Used for storing files, such as documents or images, within the database.

·       Hyperlink: Used for storing URLs or links to other documents or web pages.

·       Lookup: Used for storing a value from a predefined list of values.

·       OLE Object: Used for storing objects from other applications, such as Excel spreadsheets or Word documents. (1 GB)

 

What happens when we enter text in a numeric field?
Ans: an error message is usually displayed, indicating that the data type does not match the expected format.

Text

Text data type is used for storing alphanumeric text values with a maximum size of 255 characters.

The default size of text field is 50.

Memo

Memo data type is used for storing large blocks of text or lengthy descriptions up to 65,536 characters.

 

Field properties

·       Field Name: The name of the field, which should be unique within the table.

·       Field Size: The maximum size of the data that can be stored in the field.

·       Format: The format for displaying the data in the field, such as currency, date/time, or text.

·       Input Mask: A pattern that controls the format of the data as it is entered into the field, such as a phone number or ZIP code.

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

·       Validation Text: A message that appears if a user enters invalid data in the field.

·       Default Value: The default value that is entered into the field if no other value is specified.

·       Indexed: Specifies whether the field is indexed for faster searching and sorting.

·       AutoNumber: Specifies whether the field automatically generates a unique number for each record.

·       Caption: Specifies a descriptive label for the field, which can be displayed in forms and reports instead of the field name. It can contain up to 2048 characters.

Relationship

Relationship is a connection between two tables that is established using a common field or fields, such as a primary key and a foreign key. Its types are:
i)One to one relationship
ii)One to many relationship
iii)Many to many relationship

Record

Record is complete set of information. Record is a complete set of information that contains data values for all the fields in a table, represented by a row in the table. E.g.: Ram Chabahil 4468790

Field

Field is a small unit of information. Field is a column in a table that stores specific information, such as a name, date, or number. E.g.: Name, Address, Telephone

Sorting
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.  Sorted data is easier to handle than unsorted data.

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

 

Filtering

Filtering is an option that selects the required records and displays the result.

 

Primary key

A primary key is a field or combination of fields in a table that uniquely identifies each record, and is used to establish relationships between tables and enforce data integrity.

 

Uses of Primary key
i) To reduce and control duplication of record in a table.
ii) To set the relationship between tables.

 

Composite key

The group of primary key that consists of two or more attributes is called composite key.

 

Foreign Key

A foreign key in MS Access is a field that establishes a relationship between two tables by referencing the primary key of another table.

 

Data Redundancy

Data redundancy is the duplication of data within a database.

Data redundancy can be controlled by normalizing the database, eliminating duplicate data and storing it in separate tables, and using foreign keys to establish relationships between the tables.

 

While designing table structure which data types are suitable to store information about teacher’s name, address, salary and date of birth.
Teacher’s name - Text
Address – Text
Salary – Currency
Date of birth – Date/Time

Identify a record, field and value from the following table structure. [SQE 2074]

Roll        Name               Marks

1             Kopila                 87

2             Rabin Rana         56  

Ans: Record = 1  Kopila  87, 2     Prabin Rana    56

Field = Roll, Name, Marks

Value = 1, 2, Kopila, Prabin Rana, 87, 56

List the field name from the following table structure.

Symbol No.

Name

Marks

00100200Q

Surya Gurung

85

00100201R

Birendra Sharma

91

Field names are : Symbol No., Name and Marks

 

1.     Which data type is used to store date of birth of an employee in MS Access?

2.     Which data type of MS Access is used for data that can store only one of two possible values?

3.     Which data type is also known as logical data type in MS-Access?

4.     Which data type consumes the least storage space?

5.     Which of the following data type is appropriate to store gender of person in terms M or F?

6.     Which data type of MS-ACCESS is used to store photo, video?

7.     Which data type used for lengthy text and numbers?

8.     What is the default extension of MS-Access?

9.     What is the memory space consumed by a currency data type?

10.  What is the memory space consumed by  auto number data type?

11.  What is the memory space consumed by date/time data type?

12.  What is the field size of logical field data type?

13.  What is the maximum size of text field in MS-Access?

14.  What is the default size of text data type in MS Access?

15.  What is the default data type of MS-Access?

16.  Which  data type is appropriate to store salary

17.  Which key uniquely identifies each record?

18.  Which view is to used to modify a table structure in Ms-Access?

19.  Which object of MS-Access is used to retrieve date from the table?

20.  Which query changes value in main table?

21.  Which query is used to view the data stored in database?

22.  Which object of MS-Access that is used to generate hard copy of records?

23.  Which object of MS-Access that is used to store  records in MS Access?

24.  List any four components of database management.

25.  Name any four objects of Ms-Access.

26.  Name any four data types of Ms Access

27.  Write any two examples of database

28.  Write any two examples of DBMS.

29.  In how many ways we can create a table?

30.  List the types of query.

 

31.  What is database?

32.  Define DBMS.

33.  Define RDBMS.

34.  Define MS Access.

35.  List any two advantages of DBMS.

36.  What are validation text and validation rule in MS-Access?

37.  What is table in MS Access?

38.  Why table is called primary object of Ms -Access?

39.  What is query?

40.  List any two advantages of query.

41.  What is action query?

42.  Define form.

43.  Write the importance of form.

44.  What is report?

45.  Mention the uses of report.

46.  Why is report created?

47.  What is primary key?

48.  List any two of its advantages of primary key.

49.  What is data redundancy? How can it be reduced in database?

50.  Differentiate between Primary key and foreign with example.

51.  What is data sorting?

52.  List any two advantages of sorting.

53.  Differentiate between fields and records with example

1.     While designing table structure which data types are suitable to store information about teacher’s name, address, salary and date of birth.

2.     Identify a record, field and value from the following table structure.

Roll        Name               Marks

1             Kopila                 87

2             Rabin Rana         56  

 

Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will spend its whole life believing that it is stupid.” ― Albert Einstein