2nd PUC Computer Science Question Bank Chapter 14 SQL Commands

You can Download Chapter 14 SQL Commands Questions and Answers, Notes, 2nd PUC Computer Science Question Bank with Answers Karnataka State Board Solutions help you to revise complete Syllabus and score more marks in your examinations.

Karnataka 2nd PUC Computer Science Question Bank Chapter 14 SQL Commands

2nd PUC Computer Science SQL Commands One Mark Questions and Answers

Question 1.
Expand SQL.
Answer:
The SQL is expanded as ‘Structured Query Language’.

Question 2.
Give the syntax for create command in SQL.
Answer:
Syntax:
CREATE TABLE tablename (columnnamel datatype(size), columnname2 datatype(size) …);

Question 3.
What is drop command in SQL.
Answer:
The drop command is used to remove/delete tables,
syntax:
DROP TABLE tablename;

KSEEB Solutions

Question 4.
Give the command to display all the details in the table.
Answer:
To view All the Columns and all the Rows (Entire Table values)
> SELECT * FROM student;

Question 5.
What is update command?
Answer:
The update command is used to change row values from a table. The SET keyword takes the column in which values needs to be changed or updated

Question 6.
What is commit command?
Answer:
The commit command is used to save the transactions entered into the table.

2nd PUC Computer Science SQL Commands Two Mark Questions and Answers

Question 1.
Classify numeric and character string data types in SQL.
Answer:

  • Numeric data type is classified as exact numeric data types and floating-point numeric data types.
  • Character, string data types is classified as char and varchar data types.

Question 2.
Classify various SQL operators.
Answer:
The various SQL operators are Arithmetic operators, Comparison operators, Logical operators, Operators used to negate conditions.

Question 3.
Which are the logical operators in SQL.
Answer:
The logical operators in SQL are ALL, AND, ANY BETWEEN, EXISTS, IN, LIKE, NOT, OR, IS NULL, UNIQUE.

KSEEB Solutions

Question 4.
How do you modify the column name and width for existing table?
Answer:
Syntax:
ALTER TABLE tablename MODIFY (columnname datatype (size), columnname datatype(size)..);

Question 5.
Write the syntax for distinct command in SQL.
Answer:
Syntax:
SELECT DISTINCT columnname FROM tablename;

Question 6.
What is the use of NULL value?
Answer:
A field with a value of NULL means that the field actually has no value stored in it.

KSEEB Solutions

Question 7.
What is create view command?
Answer:
A view is referred to as a virtual table. Views are created by using the CREATE VIEW statement.

Question 8.
What is the dual table?
Answer:
It is single row and single column dummy table provided by oracle.

2nd PUC Computer Science SQL Commands Three Mark Questions and Answers

Question 1.
Explain the features of SQL.
Answer:
The features of SQL:

  • SQL is ah ANSI and ISO standard computer language for creating and manipulating databases.
  • SQL allows the user to create, update, delete, and retrieve data from a database.
  • SQL is very simple and easy to learn.
  • SQL works with database programs like DB2, Oracle, MS Access, Sybase, MS SQL Server, etc.
  • SQL Queries can be used to retrieve large amounts of records from a database quickly and efficiently.
  • Well, Defined Standards Exist.

Question 2.
List the components of SQL architecture.
Answer:
When executing an SQL command for any RDBMS, the SQL engine interprets the task for execution. There are various components included in the process. These components of SQL architecture are Query Dispatcher, Optimization Engines, Classic Query Engine, and SQL Query Engine, etc.,

Question 3.
Explain DDL commands with example.
Answer:
DDL -Data Definition Language commands create database objects such as tables, views, etc., The various DDL commands are Create Table, Alter Table, Create View, Drop Table.
-Create Table
SYNTAX:
CREATE TABLE table_name
( field1 datatype [ NOT NULL ],
field2 datatype [ NOT NULL ],
field3 datatype [ NOT NULL ]…)
An example of a CREATE TABLE statement follows.
SQL> CREATE TABLE BILLS (
2 NAME CHAR(30),
3 AMOUNT NUMBER,
4 ACCOUNT_ID NUMBER);

The ALTER TABLE command is used to do two things:

  • Add a column to an existing table
  • Modify a column that already exists

SYNTAX:
ALTER TABLE table_name ADD( column_name data_type);
ALTER TABLE table_name MODIFY (column_name data_type);
The following command changes the NAME field of the BILLS table to hold 40 characters:
SQL> ALTER TABLE BILLS MODIFY (NAME CHAR(40));

DROP command is used to remove the entire table from the database.
syntax:
DROP TABLE tablename;
Example:
DROP TABLE student;

KSEEB Solutions

Question 4.
Explain DML commands with example.
Answer:
The data manipulation commands are used for retrieval (view) of data, insertion of new data, modification of data or deletion. The DML commands includes insert, delete and update.
1. INSERT command:
It is used to inserts new rows into the table.
Syntax:
INSERT INTO tablename (columnname1, columnname2, … ) VALUES ( value1, value2, ..);
Example:
INSERT INTO student (regno, name, Combn , fees ) VALUES (1234, ‘Hemanth’, ‘PCMCs’, 15000);

2. UPDATE command:
It can be used to change row values from a table. The SET key word takes the column in which values needs to be changed or updated. The WHERE keyword is used to filter the records on some condition.
Syntax:
UPDATE tablename SET columnname = values WHERE Condition;
Example:
UPDATE student SET combn = ‘PCMCs’ where combn=’pcmc’;

3. DELETE Command:
It is used to delete/remove the tuples/rows from the table. All the rows will be deleted if WHERE clause is not used in the statement otherwise it selects the rows for delete which satisfies the condition.
Syntax:
DELETE from tablename WHERE Condition;
Example:
DELETE from student;
DELETE from student WHERE regno=1234;

Question 5.
Explain with an example boolean expression in SQL.
Answer:
Boolean expressions return rows (results) when a single value is matched. Boolean expressions commonly used in a WHERE clause are made of operands operated on by SQL operators.
For example,
> SELECT * FROM EMPLOYEES WHERE AGE = 45;
The above statement returns all those records (rows) whose age column is having the exact value of 45 from the employees table.

Question 6.
Explain AND operator using where in SQL.
AND operator:
Answer:
The operator AND means that the expressions on both sides must be true to return TRUE. If either expression is false AND returns FALSE.
Syntax:
SELECT column1, column2, columnN FROM table_name
WHERE condition1 AND condition2 … AND conditionN;

Example 1:
It would fetch ID, Name and Salary fields from the CUSTOMERS table where salary is greater than 2000 AND age is less than 25 years:
SQL> SELECT ID, NAME, SALARY FROM CUSTOMERS WHERE SALARY > 2000 AND age < 25;

Example 2:
To find out which employees have been with the company for 5 years or less and have taken more than 20 days leave,:
SQL> SELECT empNAME FROM VACATION WHERE YEARS <= 5 AND LEAVETAKEN > 20;

Question 7.
List the built-in functions associated with Group functions in SQL.
Answer:
The built-in functions associated with GROUP functions in SQL are
1. COUNT function- returns the count of records that satisfies the condition for each group of records.
Example:
SELECT department, COUNT(*)FROM employees WHERE salary > 25000 GROUP BY department;

2. MAX function- returns the maximum values from the column for each group of records.
Example:
SELECT department, MAX(salary) FROM employees GROUP BY department;

3. MIN function – returns the lowest values from the column for each group of records.
Example:
SELECT department, MIN(salary)FROM employees GROUP BY department;

4. AVG function – returns the average values from the column for each group of records.
Example:
SELECT AVG(cost) FROM products WHERE category = ‘Clothing’;

5. SUM function- returns the total values from the column for each group of records.
Example:
SELECT department, SUM(sales)FROM order_details GROUP BY department;

6. DISTINCT function – returns the once occurrence of many repeated values from the column for each group of records.
Example:
SELECT AVG(DISTINCT cost)FROM products WHERE category = ‘Clothing’;

KSEEB Solutions

Question 8.
What is the use of JOIN command?
Answer:
SQL joins are used to combine rows from two or more tables.
There are 4 different types of SQL joins:

  • SQL INNER JOIN (or sometimes called simple join)
  • SQL LEFT JOIN
  • SQL RIGHT JOIN
  • SQL FULL JOIN

1. SQL INNER JOIN (simple join)
SQL INNER JOINS return all rows from multiple tables where the join condition is met.
Syntax:
> SELECT columns FROM table1 INNER JOIN table2 ON table1.column = table2.column;
In this visual diagram, the SQL INNER JOIN returns the shaded area:
2nd PUC Computer Science Question Bank Chapter 14 SQL Commands 1
The SQL INNER JOIN would return the records where table1 and table2 intersect.

2. SQL LEFT JOIN:
This type of join returns all rows from the LEFT-hand table specified in the ON condition and only those rows from the other table where the joined fields are equal (join condi¬tion is met).
Syntax:
> SELECT columns FROM table1 LEFT JOIN table2 ON table1.column = table2.column;
In this visual diagram, the SQL LEFT JOIN returns the shaded area:
2nd PUC Computer Science Question Bank Chapter 14 SQL Commands 2
The SQL LEFT JOIN would return the all records from table1 and only those records from table2 that intersect with table1.

3. SQL RIGHT JOIN:
This type of join returns all rows from the RIGHT-hand table specified in the ON condition and only those rows from the other table where the joined fields are equal (join condition is met).
Syntax:
> SELECT columns FROM table1 RIGHT JOIN table2 ON table1.column = table2.column;
In this visual diagram, the SQL RIGHT JOIN returns the shaded area:

2nd PUC Computer Science Question Bank Chapter 14 SQL Commands 3

The SQL RIGHT JOIN would return the all records from table2 and only those records from table1 that intersect with table2.

4. SQL FULL JOIN:
This type of join returns all rows from the LEFT-hand table and RIGHT-hand table with nulls in place where the join condition is not met.
Syntax:
> SELECT columns FROM table1 FULL JOIN table2 ON table1.column = table2.column;
In this visual diagram, the SQL FULL JOIN returns the shaded area:
2nd PUC Computer Science Question Bank Chapter 14 SQL Commands 4

The SQL FULL JOIN would return the all records from both table1 and table2.

Question 9.
What are privileges and roles?
Answer:
The Privileges defines the access rights given to a user on a database object. There are two types of privileges.

  • System privileges – This allows the user to CREATE, ALTER, or DROP database objects.
  • Object privileges – This allows the user to EXECUTE, SELECT, INSERT, UPDATE, or DELETE data from database objects to which the privileges apply.

Few CREATE system privileges are listed below:

CREATE object – allows users to create the specified object in their own schema.
CREATE ANY object – allows users to create the specified object in any schema.

Few of the object privileges are listed below:

  • INSERT – allows users to insert rows into a table.
  • SELECT – allows users to select data from a database object.
  • UPDATE – allows user to update data in a table.
  • EXECUTE – allows user to execute a stored procedure or a function.

Roles:
Roles are a collection of privileges or access rights. When there are many users in a database it becomes difficult to grant or revoke privileges to users. Therefore, if roles are defined, one can grant or revoke privileges to users, thereby automatically granting or revoking privileges.

Some of the privileges granted to the system roles are as given below:

1. CONNECT – CREATE TABLE, CREATE VIEW, CREATE SYNONYM, CREATE SEQUENCE, CREATE SESSION, etc.

2. RESOURCE – CREATE PROCEDURE, CREATE SEQUENCE, CREATE TABLE, CREATE TRIG-GER, etc.

The primary usage of the RESOURCE role is to restrict access to database objects. DBA- ALL SYSTEM PRIVILEGES.

Question 10.
Classify various built-in functions in SQL.
Answer:
The built-in functions are classified as Single row functions and Group functions.
The single-row functions are of four types. They are numeric functions, character or text functions, date functions, and conversion functions.

1. Numeric functions:
ABS function- The ABS function returns the absolute value of the number you point to.

a. CEIL and FLOOR functions – CEIL returns the smallest integer greater than or equal to its argument. FLOOR does just the reverse, returning the largest integer equal to or less than its argument.

b. POWER function – To raise one number to the power of another, use POWER. In this function the first argument is raised to the power of the second:

c. SQRT function – The function SORT returns the square root of an argument.

2. Character or text functions:
a. CHR function – returns the character equivalent of the number it uses as an argument.

b. CONCAT function – function combines two strings together.

c. INITCAP function – capitalizes the first letter of a word and makes all other characters lowercase.

d. LOWER and UPPER functions – LOWER changes all the characters to lowercase; UPPER does just the reverse.

e. LENGTH function – returns the length of its lone character argument.

3. Date functions:
a. ADD_MONTHS function – This function adds a number of months to a specified date.

b. LAST_DAY – LAST_DAY function- returns the last day of a specified month. MONTHS_BETWEEN function – to know how many months fall between month x and month y,

c. NEXT_DAY function – finds the name of the first day of the week that is equal to or later than another specified date.

d. SYSDATE function – SYS DATE returns the system time and date.

4. Conversion functions:
a. TO_CHAR function – to convert a number into a character.

b. TO_NUMBER function – it converts a string into a number.

The group functions are:

  • AVG() – Returns the average value
  • COUNT() – Returns the number of rows
  • FIRST() – Returns the first value
  • LAST() – Returns the last value
  • MAX() – Returns the largest value
  • MIN() – Returns the smallest value
  • SUM() – Returns the total value of the given column.

2nd PUC Computer Science SQL Commands Five Mark Questions and Answers

Question 1.
Explain SQL constraints with example.
Answer:
SQL Constraints are rules used to limit the type of data that can be stored into a table, to maintain the accuracy and integrity of the data inside table.
Constraints can be divided into two types,

  • Column level constraints: limits only column data
  • Table level constraints: limits whole table data

Constraints are used to make sure that the integrity of data is maintained in the database. The NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK, DEFAULT are the most used constraints that can be applied to a table.

1. NOT NULL Constraint:
NOT NULL constraint restricts a column from having a NULL value. Once *NOT NULL* constraint is applied to a column, you cannot store null value to that column. It enforces a column to contain a proper value.
Example using NOT NULL constraint
CREATE table Student(s_id int NOT NULL, Name varchar(60), Age int);

2. UNIQUE Constraint:
UNIQUE constraint ensures that a field or column will only have unique values. A UNIQUE constraint field will not have duplicate data.
Example using UNIQUE constraint when creating a Table
CREATE table Student(s_id int NOT NULL UNIQUE, Name varchar(60), Age int);

3. Primary Key Constraint:
The primary key constraint uniquely identifies each record in a database. A Primary Key must contain unique value and it must not contain a null value.
Example using PRIMARY KEY constraint
CREATE table Student (s_id int PRIMARY KEY, Name varchar(60) NOT NULL, Age int);

4. Foreign Key Constraint:
FOREIGN KEY is used to relate two tables. A FOREIGN KEY in one table points to a PRIMARY KEY in another table.
Example using FOREIGN KEY constraint at Table Level
CREATE TABLE Orders
(
O-Id int NOT NULL PRIMARY KEY,
OrderNo int NOT NULL,
P_Id int FOREIGN KEY REFERENCES Persons(P_Id)
)

5. CHECK Constraint:
CHECK constraint is used to restrict the value of a column between a range. It performs check on the values, before storing them into the database.
Example using CHECK constraint
create table Student(s_id int NOT NULL CHECK(s_id > 0), Name varchar(60) NOT NULL, Age int);

KSEEB Solutions

Question 2.
Explain with example to create details of employees and give the minimum and maximum in the salary domain.
Answer:
The CHECK constraint is used to limit the value range that can be placed in a column.
If you define a CHECK constraint on a single column it allows only certain values for this column.

Check Constraint at column level:
CREATE TABLE employee
( id number(5) PRIMARY KEY,
name char(20),
dept char(10),
age number(2),
gender char(l),
salary number(lO) CHECK (salary >=5000 AND salary <=40000),
location char(10)
s);
In the above example, the salary column is defined as a number column with a check constraint. It checks constraint checks the value that can be stored in the salary column should be greater than or equal to 5000 which is the minimum value and the value is less than or equal to 40000 which is the maximum value for the column salary.

Question 3.
Write the differences between order by and group by with example.
Answer:
1. SQL ORDER BY Clause:
The SQL ORDER BY Clause is used in a SELECT statement to sort results either in ascending or descending order.

Syntax for using SQL ORDER BY clause to sort data is:
>SELECTcolumn-list FROM table_name ORDER BY column1, column2,.. columnN [DESC]];
For Example:
If you want to sort the employee table by salary of the employee, the SQL query would be.
> SELECT name, salary FROM employee ORDER BY salary;
By default, the ORDER BY Clause sorts data in ascending order. If data to be sorted in descending order, the command would be as given below.
> SELECT name, salary FROM employee ORDER BY name, salary DESC;

2. SQL GROUP BY Clause:
The SQL GROUP BY Clause is used with the group functions to retrieve data grouped according to one or more columns.

The basic syntax of GROUP BY clause is given below. The GROUP BY clause must follow the conditions in the WHERE clause and must precede the ORDER BY clause if one is used.
SELECT column1, column2 FROM table name WHERE [ conditions ]
GROUP BY column1, column2
ORDER BY column1, column2
For Example:
If you want to know the total amount of salary spent on each department, the query would be:
> SELECT dept, SUM (salary) FROM employee GROUP BY dept;
The group by clause should contain all the columns in the select list expect those used along with the group functions.
> SELECT location, dept, SUM (salary) FROM employee GROUP BY location, dept;

Tili Kannada Text Book Class 5 Solutions Gadya Chapter 7 Nari Drakshi Tomato

Students can Download Kannada Lesson 7 Nari Drakshi Tomato Questions and Answers, Summary, Notes Pdf, Tili Kannada Text Book Class 5 Solutions, Karnataka State Board Solutions help you to revise complete Syllabus and score more marks in your examinations.

Tili Kannada Text Book Class 5 Solutions Gadya BhagaChapter 7 Nari Drakshi Tomato

Nari Drakshi Tomato Questions and Answers, Summary, Notes

Tili Kannada Text Book Class 5 Solutions Gadya Chapter 7 Nari Drakshi Tomato 1

Tili Kannada Text Book Class 5 Solutions Gadya Chapter 7 Nari Drakshi Tomato 2
Tili Kannada Text Book Class 5 Solutions Gadya Chapter 7 Nari Drakshi Tomato 3
Tili Kannada Text Book Class 5 Solutions Gadya Chapter 7 Nari Drakshi Tomato 4

Tili Kannada Text Book Class 5 Solutions Gadya Chapter 7 Nari Drakshi Tomato 5
Tili Kannada Text Book Class 5 Solutions Gadya Chapter 7 Nari Drakshi Tomato 6
Tili Kannada Text Book Class 5 Solutions Gadya Chapter 7 Nari Drakshi Tomato 7

Tili Kannada Text Book Class 5 Solutions Gadya Chapter 7 Nari Drakshi Tomato 8
Tili Kannada Text Book Class 5 Solutions Gadya Chapter 7 Nari Drakshi Tomato 9
Tili Kannada Text Book Class 5 Solutions Gadya Chapter 7 Nari Drakshi Tomato 10

Nari Drakshi Tomato Summary in Kannada

Nari Drakshi Tomato Summary in Kannada 11
Nari Drakshi Tomato Summary in Kannada 12

Nari Drakshi Tomato Summary in Kannada 13
Nari Drakshi Tomato Summary in Kannada 14

2nd PUC Computer Science Question Bank Chapter 4 Data Structures

You can Download Chapter 4 Data Structures Questions and Answers, Notes, 2nd PUC Computer Science Question Bank with Answers Karnataka State Board Solutions help you to revise complete Syllabus and score more marks in your examinations.

Karnataka 2nd PUC Computer Science Question Bank Chapter 4 Data Structures

2nd PUC Computer Science Data Structures One Mark Questions and Answers

Question 1.
What are data structures?
Answer:
data structure is a systematic way of organising, storing and accessing data.

Question 2.
Differentiate between one-dimensional and two-dimensional array.
Answer:
One-dimensional array is structured in one dimension and each element is accessed by an index value whereas two-dimensional array is structured in two dimensions and each element is accessed by a pair of index values.

Question 3.
Give any two examples for primitive data structures.
Answer:
The two examples for primitive data structures are int and float data.

Question 4.
Mention any two examples for non-primitive data structures.
Answer:
The two examples for non-primitive data structures are array and lists.

KSEEB Solutions

Question 5.
What are primitive data structures?
Answer:
The data structures that are directly operated upon by machine-level instructions.

Question 6.
What are non-primitive data structures?
Answer:
The non-primitive data structures derived from primitive data types are more complex.

Question 7.
Name the data structure which is called LIFO list.
Answer:
The data structure which is called LIFO list is stacks.

Question 8.
What is the other name of the queue?
Answer:
The FIFO list is the other name of the queue.

KSEEB Solutions

Question 9.
Define an array.
Answer:
Array is a collection of similar elements that share a common name. It is a structured data type and allocates memory contiguously.

Question 10.
What are the lists?
Answer:
Lists are a way to store many different values under a single variable. Every item in this list is numbered with an index.

Question 11.
What is meant by linear data structures?
Answer:
The linear(sequential) data structures is the one which displays the relationship of adjacency between the elements.

Question 12.
What are non-linear data structures?
Answer:
data structure that is possible to derive any relationship other than the adjacency relationship is called non-linear data structures.

KSEEB Solutions

Question 13.
What is a stack?
Answer:
stack is an ordered collection of items in which items may be inserted and deleted at one end.

Question 14.
What is a queue?
Answer:
A queue is a non-primitive data structure where an item is inserted at one end and removed from the other end.

Question 15.
Name the data structure whose relationship between data elements is by means of links.
Answer:
The data structure whose relationship between data elements is by means of links is linked lists.

Question 16.
What is a linked list?
Answer:
Linked list is a data structure in which each element is dynamically allocated and in which elements point to each other to define a linear relationship.

Question 17.
Mention any one application of stack.
Answer:
The one application of stack is recursive function/expression evaluation.

Question 18.
What do you mean by traversal in data structure?
Answer:
The process of accessing each data item only once in group of elements for some operation.

KSEEB Solutions

Question 19.
Define searching in a one-dimensional array.
Answer:
Searching is the process of finding the location of data element in the array.

Question 20.
What is meant by sorting in an array?
Answer:
The sorting is the process of arranging the array elements in ascending or in descending order.

Question 21.
Mention the types of searching in the array.
Answer:
The linear search and binary search techniques are the types of searching in the array.

Question 22.
What are non-linear data structures?
Answer:
The TREES and GRAPH are non-linear data structures.

Question 23.
What is a binary tree?
Answer:
The TREE is a general data structure that describes the relationship between data items or ‘nodes’. The parent node of a binary tree has only two child nodes.

Question 24.
What do you mean by the depth of a tree?
Answer:
It is the number of ancestors of a node excluding itself i.e., the length of the path to its root.

KSEEB Solutions

Question 25.
How do you find the degree of a tree?
Answer:
The degree of the tree is the total number of its children i-e the total number nodes that originate from it. The leaf of the tree does not have any child so its degree is zero.

Question 26.
What are the operations that can be performed on stacks?
Answer:
The stack(), push(item), pop(), peek(), is Empty() and size() are the operations that can be performed on stacks.

Question 27.
What are the operations that can be performed on queues?
Answer:
The queue(), enqueue(item), dequeue(), isEmpty() and size() are the operations that can be performed on queues.

Question 28.
Define the term PUSH and POP operations in stack.
Answer:
The process of adding a new item to the top of the stack is called PUSH and the process of removing the top item from the top of stack is called POP operation.

Question 29.
What is the FIFO list?
Answer:
The data structure queue is called FIFO(First In First Out) which means first inserted data item is removed first.

Question 30.
What is the LIFO list?
Answer:
The data structure stack is called LIFO(Last In First Out) which means the last inserted data item is removed first.

Question 31.
Mention the different types of queues.
Answer:
The different types of queues are simple queue, circular queue, priority queue and dequeue.

Question 32.
Give examples for linear data structures.
Answer:
The examples for linear data structures are stack, queues and linked lists.

Question 33.
Give examples for non-linear data structures.
Answer:
The examples for non-linear data structures are trees and graphs.

KSEEB Solutions

Question 34.
What is meant by traversal operations on data structure?
Answer:
It is the process of accessing each and every data element only once for some task.

Question 35.
What is meant by insertion operations on data structure?
Answer:
It is the process of adding a data element into the existing set of data elements.

Question 36.
What is meant by deletion operations on data structure?
Answer:
It is the process of removing existing data element from the existing set of data elements.

Question 37.
What is meant by merging operations on data structure?
Answer:
It is the process of combining more than one set of similar data elements into one set of elements.

Question 38.
How is each and every element in the array referred?
Answer:
The array elements are referred by subscript or index of an array.

Question 39.
Give the syntax of a one-dimensional array declaration.
Answer:
Datatype arrayname [size] ;

Question 40.
What is the first element index number in an array?
Answer:
The first element index number in an array is 0.

Question 41.
What is the last element index number in an array?
Answer:
The last element index number of array is n-1 where n is the number of elements in an array.

Question 42.
Give the formula to calculate the length of the one-dimensional array.
Answer:
The formula is
Size of the array = UB – LB + 1
Where UB is Upper bound, LB is lower bound

Question 43.
What do you mean by base address in-memory representation of an array?
Answer:
The base address in-memory representation of an array is the memory address of the first element of an array.

Question 44.
Give the formula to calculate the memory address of an array element.
Answer:
The formula to calculate the memory address of an array element is
Base_Address + W ( Position – LB )
Where W is the number of words per memory cell, position is the location of array element for which memory address is calculated, LB is Lower bound of an array.

Question 45.
Mention any one advantage of the linear search method.
Answer:
The linear search method doesn’t require the list should be in order.

KSEEB Solutions

Question 46.
Mention any one dis-advantage of the linear search method.
Answer:
The disadvantage of the linear search method is time-consuming (slow in searching).

Question 47.
Mention any one advantages of the binary search method.
Answer:
The binary search method is very fast.

Question 48.
Mention any one disadvantage of the binary search method.
Answer:
The binary search method requires the list of elements should be in order.

Question 49.
What is the formula to calculate mid element index number in the binary search method?
Answer:
The formula to calculate mid element index number in the binary search method is
Mid-element-index = (low + high) / 2
Where low is beginning index number and high is the last index number of an array.

Question 50.
What are the different types of representation of stacks in memory?
Answer:
The two types of representation of stacks in memory are static representation and dynamic representation.

Question 51.
Give the various elements that are required for stack PUSH operation.
Answer:
The various elements required for PUSH operation are PUS( STACK, TOP, SIZE, ITEM).

2nd PUC Computer Science Data Structures Two Marks Questions and Answers

Question 1.
How are data structure classified?
Answer:
The data structure is classified as primitive data structures and non-primitive data structures.

Question 2.
Justify the need for using arrays.
Answer:
Array is a contiguous memory locations represented by a single name and useful in storing data elements in adjacent memory locations. It can be used to implement data structures like linked lists, stacks, queues, trees, graphs, etc.,

Question 3.
How are arrays classified?
Answer:
Array is classified as one dimensional, two dimensional and multidimensional arrays.

KSEEB Solutions

Question 4.
Mention the various operations performed on arrays.
Answer:
The various operations performed on arrays are traversing, searching, sorting, insertion, deletion, and merging.

Question 5.
How do you find the length of the array?
Answer:
Length of the array = UB – LB + 1
where
UB is the largest index or upper bound index number
LB is the smallest index or lower bound index number.

Question 6.
Mention the types of linked lists.
Answer:
The types of linked lists are Singly linked list, Doubly linked list and a circular linked list.

Question 7.
What is a stack? Mention the types of operations performed on the stacks.
Answer:
A stack is an ordered collection of items in which data item may be inserted and deleted at one end.
The stack(), push(item), pop(), peek(), isEmpty() and size() are the operations that can be performed on stacks.

Question 8.
What is a queue? Mention the various operations performed on the queue.
Answer:
A queue is a non-primitive data structure where an item is inserted at one end and removed from the other end.
The queue(), enqueue(item), dequeue(), isEmpty() and size() are the operations that can be performed on queues.

Question 9.
Give the syntax for a 2-dimensional array declaration.
Answer:
The two dimensional array declaration syntax
Datatype arrayname [rowsize] [columnsize] ;

Question 10.
What do you mean by row-major ordering and column-major ordering in two-dimensional array?
Answer:
In row-major ordering, every row of the 2-dimensional array is stored one after the other in the memory. In column-major ordering, every column of the two-dimensional array is stored one after the other in the memory.

KSEEB Solutions

Question 11.
Give the formula to calculate the memory address of an element using row-major ordering and column-major ordering methods.
Answer:
Row major order method formula
LOC(rowidx, colidx) = BaseAddress + W ( colsize * rowidx + colidx)
Column major order method formula
LOC(rowidx, colidx) = BaseAddress + W (rowidx + rowsize * colidx)

Question 12.
What is an expression? Write the different methods of representing an expression.
Answer:
The expression is a combination of operators and operators. The different methods are infix, prefix and postfix expressions.

Question 13.
Convert the infix expression A + B to prefix and postfix expression.
Answer:
Prefix expression –    +AB
Postfix expression –    AB +

Question 14.
Write the rules for evaluating postfix expressions.
Answer:
Rule 1:
read the expression from left to right.

Rule 2:
each operator follows the previous two operands.

Rule 3:
PUSH when operands are read, and operands will be in the top two-element when operator found.

Rule 4:
evaluate the expression and push the result on the stack.

KSEEB Solutions

Question 15.
What is the significance of variables FRONT and REAR in a queue?
Answer:
The variable FRONT is used to identify the position of the first element in the queue, and variable REAR is used to identify the position of the last element of the queue.

2nd PUC Computer Science Data Structures Three Marks Questions and Answers

Question 1.
Mention the various operations performed on data structures.
Answer:
The various operations performed on primitive data structures are create, destroy, select and update and traversal, insertion-deletion, searching, sorting and merging on non-primitive data structures.

Question 2.
Explain the memory representation of a one-dimensional array.
Answer:
The data elements of array is stored in contiguous memory locations. Let P be the location of the data element. The address of the first element of linear array A is given by Base(A)
To calculate the address of any element of A formula
LOC ( A[P] ) = Base(A) + W ( P – LB )
Where
W is the size of data type (number of words per memory cell)
P – location of the data element
A – Base address of first element of array
LB – Lower bound index number

Question 3.
Explain the memory representation of a stack using a one-dimensional array.
Answer:
The items into the stack are stored in a sequential order from the first location of the memory block. A pointer TOP contains the location of the top element of the stack. A variable MAXSTK contains the maximum number of elements that can be stored in stack.
The stack is full when TOP = MAXSTK
The stack is empty when TOP = 0.

KSEEB Solutions

Question 4.
Explain the memory representation of the queue using a one-dimensional array.
Answer:
Let Q be a linear array of size N
The pointer FRONT contains location of front element of the queue (element to be deleted)
The pointer REAR contains location of rear element of the queue (recently added element)
The queue is empty when FRONT = 0
The queue is full when FRONT = N
To add element, REAR = REAR + 1
To delete element, FRONT = FRONT + 1

Question 5.
Explain the memory representation of single linked list.
Answer:
A linked list maintains the memory location of each item in the list by using a series of ‘pointers’ within the data structure.
Every node of a singly-linked list contains the following information:

  • Data element (user’s data);
  • A link to the next element (auxiliary data).

A number of pointers are required, these are:

  1. The start pointer’ points to the first node in the list.
  2. The last node in the list has a ‘null pointer’ (which is an empty pointer)
  3. Each node has a pointer providing the location of the next node in the list.

Question 6.
Define the following with respect to binary tree

  1. root
  2. subtree
  3. depth
  4. degree

Answer:
1. root:
A topmost node in a tree

2. subtree:
A tree T is a tree consisting of node in T and all of its descendants in T.

3. depth:
It is the number of ancestors of a node excluding itself i.e., the length of the path to its root.

4. degree:
The degree of the tree is the total number of it’s children i.e., the total number nodes that is zero.

KSEEB Solutions

Question 7.
Write an algorithm for traversal in a linear array.
Answer:
Algorithm for traversal of linear array
Traversal (A, N) – A is an array of N elements
Step 1: for i = 0 to N-l repeat step 2
Step 2: print A[i]
[End of for loop]
Step 3: Exit.

Question 8.
Give the memory representation of the two-dimensional array.
Answer:
Let A be two-dimensional array
Let M is rows and N is columns
The A array may be stored in the memory in one of the following methods;
1. Row-major representation:
In this type of method, the first row occupies the first set of memory locations reserved for the array and second-row occupies the next set and so on.

2. Column-major representation:
In this type of method, the first column occupies the first set of memory locations reserved for the array and the second column occupies the next set and so on.

2nd PUC Computer Science Data Structures Five Mark Questions and Answers

Question 1.
Write an algorithm to insert an element in an array.
Answer:
A is an array
N is number of elements (size)
Element is a data element
Pos is the location of the element to be inserted.

Insertion (A, N, Element, Pos)
Step 1: for i = N-1 downto Pos repeat step 2
Step 2: A[i+1] = A[i]
End for
Step 3: A [Pos] = Element
Step 4: N = N + 1

Question 2.
Write an algorithm to delete an element in an array.
Answer:
A is an array
N is number of elements (size)
Element is a deleted data element
Pos is the location of the element to be deleted.
Deletion (A, N, Pos)
Step 1: Element = A [Pos]
Step 2: for i = Pos to N-1 repeat step 3
Step 3: A[ i ] = A[i+1]
End for
Step 4: N = N -1

Question 3.
Write an algorithm to search an element in an array using binary search. Algorithm: Binary_search(A,ele,N)
Answer:
Step 1: low = 0
Step 2: high = n-1
Step 3: while (low <= high) repeat step 4 through step 6
Step 4: mid = (low + high) / 2
Step 5: Is ( ele = = a[mid]) then
Loc = mid
goto step 7
Otherwise
Step 6: is ( ele < a[mid])? then
high = mid – 1
otherwise
low = mid + 1
[end while – step 3]
Step 7: Is ( Loc >= 0 ) ? then
Print “search element found at location “, loc
Otherwise
Print “search element not found”.

KSEEB Solutions

Question 4.
Write an algorithm to sort an array using insertion sort Algorithm: lnsertion_sort (A,N)
Answer:
Step 1: for i = 1 to n-1 Repeat step 2
Step 2: for j = i downto 1 Repeat step 3
Step 3: is ( a[j] < a[j-1])? then
temp = a[j]
A[j] = a[j-1]
A[j-1] = temp [ end of j loop]
[ end of i loop]

Question 5.
Write an algorithm for push and pop operation in stack using array.
Answer:
Algorithm for PUSH operation
PUSH(STACK, TOP, SIZE, ITEM)
Step 1: if TOP >= N-1 then
PRINT “stack is overflow”
Exit
End of if
Step 2: Top = TOP + 1
Step 3: STACK[TOP] = ITEM
Step 4: Return

Algorithm for POP operation
PUSH(STACK, TOP, ITEM)
Step 1: if TOP = 0 then
PRINT “stack is empty”
Exit
End of if
Step 2: ITEM = STACK[POP]
Step 3: TOP = TOP -1
Step 4: Return

Question 6.
Write an algorithm to insert a data element at the rear end of the queue.
Answer:
Step 1: if REAR >= N -1 then
Print “Queue is overflow”
Exit
End of if
Step 2: REAR = REAR+ 1
Step 3: QUEUE [REAR] = element
Step 4: if FRONT =-1 then
FRONT = 0.

KSEEB Solutions

Question 7.
Write an algorithm to delete a data element from the front end of the queue.
Answer:
Step 1: if FRONT = -1 then
Print “Queue is Underflow”
Exit
End of if
Step 2: ITEM = QUEUE [FRONT]
Step 3: if FRONT = REAR then
FRONT = 0
REAR = 0
Else
FRONT = FRONT + 1
Step 4: return

Question 8.
Write an algorithm to insert a data element at the beginning of a linked list.
Answer:
Step 1: if AVAIL = NULL then
Print ” Availability stack is empty”
Else
NEW_NODE = AVAIL
AVAIL = AVAIL → LINK
Step 2: if FIRST = NULL then
NEW_NODE → INFO = ELEMENT
NEW_NODE → LINK = NULL
FIRST = NEW_NODE
Else
NEW_NODE → INFO = ELEMENT
NEW_NODE → LINK = FIRST
FIRST = NEW_NODE
Step 3: return

Question 9.
Write an algorithm to delete a data element at the end of a linked list.
Answer:
Step 1: if FIRST = NULL then
Print “Linked list is empty”
Exit
End of if
Step 2: if FIRST → LINK= NULL then
Return FIRST → data
FIRST = NULL
Else
P2 = FIRST
While P2 → LINK not equal to NULL
P1 = P2
P2 =P2 → UNK
End while
STEP 4: Return p2 → data
STEP 5: P1 → LINK = NULL
STEP 6: EXIT.

KSEEB Solutions

Question 10.
Apply binary search for the following sequence of number. 10,20,30,35,40,45,50,55,60 search for item 35.
Answer:
Low = 0, High = 8 search_ele = 35
Mid_ele_idx = (low + high)/2
= (0+8)/2
= 4
Is 40 = 35? No
The list now is 10 20 30 35
Low =0, high= 3
Mid_ele_idx = (low + high) /2
= (0+3)/2
= 1
Is 20 = 35? No
The list now is 30 35
Low = 2, high = 3
Mid_ele_idx = (low + high)/2
= (2+3)/2
= 2
Is 30 = 35 No
The list now is 35
Low = 3, high = 3
Mid_ele_idx = (low + high) fl
= (3+3)/2
= 3
Is 35 = 35 yes
location = 3
Output:
The search element 35 is found at location 3.

Siri Kannada Text Book Class 6 Solutions Puraka Pathagalu Chapter 5 Iruve

Students can Download Kannada Lesson 5 Iruve Questions and Answers, Summary, Notes Pdf, Siri Kannada Text Book Class 6 Solutions, Karnataka State Board Solutions help you to revise complete Syllabus and score more marks in your examinations.

Siri Kannada Text Book Class 6 Solutions Puraka Pathagalu Chapter 5 Iruve

Iruve Questions and Answers, Summary, Notes

Siri Kannada Text Book Class 6 Solutions Puraka Pathagalu Chapter 5 Iruve 1

Siri Kannada Text Book Class 6 Solutions Puraka Pathagalu Chapter 5 Iruve 2
Siri Kannada Text Book Class 6 Solutions Puraka Pathagalu Chapter 5 Iruve 3

Siri Kannada Text Book Class 6 Solutions Puraka Pathagalu Chapter 4 Huchu Hurulu

Students can Download Kannada Lesson 4 Huchu Hurulu Questions and Answers, Summary, Notes Pdf, Siri Kannada Text Book Class 6 Solutions, Karnataka State Board Solutions help you to revise complete Syllabus and score more marks in your examinations.

Siri Kannada Text Book Class 6 Solutions Puraka Pathagalu Chapter 4 Huchu Hurulu

Huchu Hurulu Questions and Answers, Summary, Notes

Siri Kannada Text Book Class 6 Solutions Puraka Pathagalu Chapter 4 Huchu Hurulu 1

Siri Kannada Text Book Class 6 Solutions Puraka Pathagalu Chapter 4 Huchu Hurulu 2

Huchu Hurulu Summary in Kannada

Huchu Hurulu Summary in Kannada 1

Huchu Hurulu Summary in Kannada 2
Huchu Hurulu Summary in Kannada 3

1st PUC Maths Question Bank Chapter 2 Relations and Functions

Students can Download Maths Chapter 2 Relations and Functions Questions and Answers, Notes Pdf, 1st PUC Maths Question Bank with Answers helps you to revise the complete Karnataka State Board Syllabus and score more marks in your examinations.

Karnataka 1st PUC Maths Question Bank Chapter 2 Relations and Functions

Question 1.
Define ordered pair.
Answer :
Two numbers a and b listed in specific order and enclosed in parentheses form is called an ordered pair (a, b).
Keen Eye: Equality of two ordered pairs:
We have {a, b)-(c,d)⇔a-c and b – d.

Question 2.
Define a Cartesian product of two sets.
Answer :
Let A and B two non-empty sets. Then, the Cartesian product of A and B is the set denoted by Ax B, consisting of all ordered pairs (a, b) such that a e A and be B.
A x B= {(a, b): a ∈ A, b∈B}
Keen Eye:

  • If n(A) = p and n(B) = q, then n (A x B) = pq and n (B x A) = pq
  • If at least one of A and B is infinite then AxB is infinite and B x A is infinite,
  • In general, A x B ≠ B x A
  • A x A x A = {(a, b, c) : a, b, c ∈A}. Here (a, b, c) is called an ordered triplet.

KSEEB Solutions

Question 3.
If (x + 1, y – 2) = (3,1), find the values of x
Answer :
Given (x + 1, y – 2) = (3,1)
⇒ x+1=3  ∴x=2
y-2=1  ∴ y=3

Question 4.
If \( \left(\frac{x}{3}+1, y-\frac{2}{3}\right)=\left(\frac{5}{3}, \frac{1}{3}\right)\)
Answer:
Given \( \left(\frac{x}{3}+1, y-\frac{2}{3}\right)=\left(\frac{5}{3}, \frac{1}{3}\right)\)
1st PUC Maths Question Bank Chapter 2 Relations and Functions 1

Question 5.
If P={a,b,c}and Q={r},from P×Q and Q x P.Are these two products equal?
Answer:
PxQ = {(a,r),(b,r)(c,r)}
QxP = {(r, a), (r, b), (r, c)}
Clearly PxQ≠QxP

Question 6.
If the set A has 3 elements and the set B = {3, 4, 5}, then find the number of elements in
Answer :
Given n(A) = 3; n(B) = 3.
∴ n(AxB) = 3×3 = 9

Question 7.
If G=(7, 8} and H={5, 4, 2), find G x II and
Answer :
GxH = {(7,5),(7,4),(7,2),(8,5),(8,4),(8,2)}
HxG = {(5,7),(5,8),(4,7),(4,8),(2,7),(2,8)}

Question 8.
State whether each of the following statements are true or false. If the statement is false, rewrite the given statement correctly.
(i) If P={m, n} and Q = {n, m}, then P x Q = {(m, n), (n, m)}.
(ii) If A and B are non-empty sets, then A x B is a non-empty set of ordered pairs (at, y) such that x∈B and y∈A
(iii) If A = {1,2}, B = {3,4}, then A x {B∩φ ) = φ
Answer :
(i) Given statement is false:
Correct statement:
PxQ={(m, n), (m, m), (n, n), (n, m)}.

(ii) Given statement is false:
Correct statement:
AxB = {(x, y) :x∈A, y ∈B}.                                 ‘

(iii) True statement,

Question 9.
If A x B = {(a, x), (a, y), (b, x), (b, y)}. Find A and
Answer :
A = {a, b} and B – {x, y}

Question 10.
If A x B = {(p, q), (p, r), (m, q), (m, r)}, find A and
Answer :
A = set of first elements = {p, m}
B = set of second elements = {q, r}

KSEEB Solutions

Question 11.
Let A = (1, 2}, B = [1, 2, 3, 4}, C = { 5, 6} and D = (5,6,7,8}. Verify that
(i) A x (B∩C) = (A x B)∩(A x C).
(ii) A x C is a subset
Answer :
(i) B∩C = { }
∴ Ax(B∩C)=φ ………….. (1)
A x B = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 1), (2, 2), (2, 3), (2,4)}
A x C = {(1, 5), (1,6), (2, 5) (2,6)}
∴ (A x B) ∩ (A x C) = φ ………………. (2)
From (1) and (2), we get
A x (B∩C) = (A x B)∩(A x C)

(ii) A x C = {(1, 5), (1,6), (2, 5), (2, 6)}
B x D = {(1, 5), (1, 6), (1, 7), (1, 8), (2, 5), (2, 6), (2, 7), (2, 8), (3, 5), (3, 6), (3, 7), (3, 8), (4, 5), (4, 6), (4, 7), (4, 8)}.
Clearly every elements of A x C is an element of B x D.
A x C ⊂B x D.

Question 12.
Let A = {1, 2, 3}, B = {3, 4} and C = {4, 5, 6}. Find
(i) A x (B ∩ C)
(ii) (A x B) ∩ (A x C)
(iii) A x (B∪C)
(iv) (A x B)∪(A x C)
Answer :
(i) B∩C={4}
A x (B∩C) = (1,4), (2, 4), (3,4)}

(ii) A x B = {(1, 3), (1,4), (2, 3), (2, 4), (3, 3), (3, 4)}
A x C = {(1, 4), (1, 5) (1, 6), (2, 4), (2, 5), (2, 6), (3, 4), (3, 5), (3, 6)}
(A x B)∩(A x C)= {(1, 4), (2, 4), (3, 4)}

(iii) B ∪ C={3,4, 5, 6}
∴ Ax(B∪C)  = {(1, 3), (1, 4), (1, 5), (1, 6), (2, 3), (2, 4), (2, 5), (2, 6), (3, 3), (3, 4), (3, 5), (3, 6)}

(iv) A x B = {(1, 3), (1, 4), (2, 3), (2, 4), (3, 3), (3, 4)}
A x C = {(1, 4), (1, 5), (1, 6), (2, 4), (2, 5), (2, 6), (3, 4), (3, 5), (3, 6)}
(A x B)∪(A x C) = {(1, 3), (1, 4), (1, 5), (1, 6), (2, 3), (2, 4), (2, 5), (2, 6) (3, 3), (3, 4), (3, 5), (3,6)}.

Question 13.
Let A = {1, 2} and B = {3, 4}. Write A x B. How many subsets will A x B have? List them.
Answer :
Given A = {1, 2} and B = {3,4}
A x B= {(1, 3), (1,4), (2, 3), (2, 4)}
∴n (A x B) = 4
Number of subsets of A x B = 24=16
Subsets of A x B are: A x B, φ, {(1, 3)}, {(1, 4)}, {(2, 3)}, {(2, 4)}, {(1, 3), (1, 4)}, {(1, 3), (2, 3)}, {(1, 3), (2,4)}, {(1,4), (2, 3)}, {(1, 4), (2, 4)} {(2, 3), (2, 4)}, {(1, 3), (1, 4), (2, 3)}, {(1, 3), (1, 4), (2, 4)}, {(1,4), (2, 3), (2, 4)}, {(2, 3), (2,4), (1, 3)}.

Question 14.
Let A and B be two sets such that n(A) = 3 and n(B) = 2. If (x, 1), (y, 2), (z, 1) are in A x B, find A and B, where x, y, z are distinct elements.
Answer :
A = {x, y, z} and B = {1, 2}.

Question 15.
The Cartesian product A x A has 9 elements along which are found (-1, 0) and (0,1). Find the set A and the remaining elements Ax A.
Answer :
Given n(A x A) = 9 = 32
⇒n(A) = 3
But (-1, 0) and (0, 1) are in A x A
∴ A= {-1,0,1}.
Remaining elements of A x A: (-1, -1), (-1, 1),
(0,-1), (0,0), (1,-1), (1,0), (1,1).

Question 16.
If P = {1,2}, form the set
Answer :
P x P x P = {(1, 1, 1), (1, 1, 2), (1, 2, 1),
(1, 2,2), (2, 1,1), (2, 1, 2), (2, 2,1), (2, 2, 2)}

Question 17.
If A = {-1,1}, find A x A x A.
Answer :
A x A x A = {(-1, -1, -1), (-1, -I, 1), (-1, 1, -1), (-1, 1, 1), (1, -1, -1), (1, -1, 1), (1,1,-1), (1,1,1)}

Question 18.
If R is the set of all real numbers, what do the Cartesian products R x R and R x R x R represent?
Answer :
We have R x R = {(x, y) : x, y ∈ R } which represents the coordinates of all the points in two dimensional space and R x R x R = {(x, y, z)  x,y,z ∈ R } which represents the coordinates of all the points in three-dimensional space.

Question 19.
Define a relation.
Answer :
A relation R from a non-empty set A to non empty set B is a subset of the Cartesian product A x B.

KSEEB Solutions

Question 20.
Define domain of a relation.
Answer :
The set of all first elements of the ordered pairs in a relation R from a set A to a set B is called the domain of the relation R.

Question 21.
Define range of a relation.
Answer :
The set of all second elements in a relation R from a set A to a set B is called the range of the relation R. The whole set B is called the co-domain of the relation R.

Question 22.
Let A = {1, 2, 3, 4, 5, 6}. Define a relation R from A to A by R = {(x,y): y = x + 1}
(i) Depict this relation using an arrow diagram
(ii) Write down the domain, condomain and range of
Answer :
Given R = {(x, y): y = x + 1}
= {(1, 2), (2, 3), (3, 4), (4, 5), (5, 6)}
1st PUC Maths Question Bank Chapter 2 Relations and Functions 2
Domain = {1, 2, 3,4, 5,}; Co-domain = A
Range = {2, 3,4, 5, 6}.

Question 23.
Let A = {1, 2, 3, ………….14}. Define a relation R from A to A by R = {(x, y): 3x – y = 0, x,
y ∈ A}. Write down its domain, co-domain and range.
Answer :
Given R = {(x, y): 3x -y = 0, x, y ∈ A}
= {(1, 3), (2, 6), (3, 9), (4,12)}
Domain = {1, 2, 3,4}
Co-domain = A Range = {3, 6, 9,12}

Question 24.
Define a relation R on the set N of natural numbers by R – {(x, y) : y = x + 5, x is a natural number less than 4; x, y ∈ . N}. Depict this relationship using roster form. Write down the domain and the range.
Answer :
Given R = {(x, y): x, y ∈ N and y = x + 5, x < 4}
= {(1,6), (2,7), (3, 8)}
Domain = {1, 2, 3}
Range = {6, 7, 8}
1st PUC Maths Question Bank Chapter 2 Relations and Functions 3

Question 25.
A = {1, 2, 3, 5} and B = (4, 6, 9}. Define a relation R from A to B by R = {(x, y): the difference between x and y is odd; x ∈ A, y∈ B}. Write R in roster form.
Answer :
Given A = {1, 2, 3, 5} and B = {4, 6, 9}
R = {(x, y): the difference between x and y is odd; x∈ A,y∈B}
= {(1,4), (1, 6), (2, 9), (3, 4), (3, 6), (5,4), (5, 6)}

Question 26.
The figure shows a relationship between the sets P and Write this relation
(i) in set- builder-form
(ii) roster form. What is its domain and range?
1st PUC Maths Question Bank Chapter 2 Relations and Functions 4
Answer:
Given P={5,6,7} and Q={3,4,5}
(i) Set builder form
R= {(x,y):x-y = 2; x∈P,y ∈Q)

(ii) Roster form
R = {(5, 3), (6,4), (7, 5)}
Domain of R = P
Range of R = Q.

Question 27.
Let A = {1, 2, 3, 4, 6}. Let R be the relation on A defined by {(a, b): a, b ∈A, b is exactly divisible by a},
(i) Write R in roster form
(ii) Find the domain of R
(iii) Find the range of R
Answer :
Given A = { 1, 2, 3,4, 6}
R- {(a, b),a,b∈A,bis exactly divisible by a}

(i) Roster form:
R = {(1, 1), (1, 2), (1, 3), (1, 4), (1, 6), (2, 2), (2, 4), (2, 6), (3, 3), (3, 6), (4,4), (6, 6)}

(ii) Domain of R = {1, 2, 3,4, 6} = A

(iii) Range of R = {1, 2, 3,4, 6} = A

KSEEB Solutions

Question 28.
Determine the domain and range of the relation R .defined by R = {(x, x + 5): x e {0,1, 2,3,4,5}}.
Answer :
Given R = {(0, 5), (1, 6), (2, 7), (3, 8), (4, 9), (5, 10)}.
Domain of R = {0, 1, 2, 3,4, 5}
Range of R = {5, 6, 7, 8, 9, 10}

Question 29.
Write the relation R = {(x, x3) : x is a prime number less than 10} in roster form.
Answer :
Given R = {(x, x3): x g {2, 3, 5, 7}}
= {(2, 8), (3, 27), (5, 125), (7, 343)}

Question 30.
Let A – {x, y, z} and B = (1, 2}. Find the number of relations from A to
Answer :
Given n(A) = 3 and n(B) = 2
∴ n (A x B) = 3 x 2 = 6
Number of relations from A to B = 2n (A x B) = 26 = 64

Question 31.
Let R be the relation on Z defined by R = {(a, b): a, b ∈ Z, a – b is an integer}. Find the domain and range of
Answer :
Given: R = {(a, b): a, b ∈Z,a-b is an integer} Domain of R-Z Range of R = Z

Question 32.
Let R be a relation from Q to Q defined by R = {(a, b)\ a,b ∈Q and a – b ∈ Z}. Show that (a, a) g R, for all a ∈Q
(ii) (a, b) ∈ R implies that (b, a) ∈R
(iii) (a, b) ∈ R and (b, c) ∈R implies that (a, c) ∈ R.
Answer :
Given R = {{a, b): a,b∈Q and a-b ∈ Z)
(i) ∀ a ∈ Q, a – a = 0 ∈ Z ⇒ (a, a)∈R

(ii) Let (a, b) ∈ R⇒ a- b ∈ Z
b – a ∈ Z ⇒ (b, a) ∈ R

(iii) Let (a, b) and (b, c) g R ⇒ a – b ∈Z and
b – c ∈ Z
a- c = (a-b) + (b – c) ∈Z
∴ (a, c)∈ R

Question 33.
Let R be a relation from A to A defined by R = {(a, b): a,b ∈ N and a = b2} Are the following true?
(i) (a, a) ∈ R for all a ∈ A
(ii) (a, b) ∈ R, implies (b, a) ∈ R
(iii) (a, b) ∈ R, (b, c) ∈ R, implies (a, c) ∈ R.
Justify your answer in each case.
Answer :
Given R= {(a, b): a,b∈N and a = b2}
= {(1,1), (2,4), (3, 9), (4, 16),…}
(i) (a, a)∈ R for all a ∈ N is not true because (2, 2) ∉ R.
(ii) (a, b) ∈ R implies (b, a) ∈ R is not true, because  (2,4) ∈ R but (4,2) ∉ R
(iii) (a, b) ∈ R, (b, c) ∈ R implies (a,c) ∈ R is not true because (2,4) and (4,16) ∈ R but (2,16) ∉ R.

KSEEB Solutions

Question 34.
Define a function.
Answer :
A relation/from a set A to a set B is said to be a function if every element of set A has one and only one image in set B, and
we write f : A → B
1st PUC Maths Question Bank Chapter 2 Relations and Functions 5

Question 35.
Define
(i) a real valued function
(ii) a real function
Answer :
A function which has either R or one of its subsets as its range is called a real valued function. A function f: A → B is said to be a real function if both A and B are subsets of R.

Question 36.
Let N be the set of natural numbers and the relation R be defined on N such that
R = {(x,y):y = 2x,x,y ∈ N} What is the domain, co-domain and range of R? Is this relation a function?
Answer :
Given R = {x, y): y = 2x; x, y ∈ N}
Domain of R = set of natural numbers Co-domain of
R = set of natural number
Range of R = set of even natural numbers
Clearly, every natural number is related to unique image, so this relation is a function.

Question 37.
Examine each of the following relations given below and state in each case, giving reasons whether it is a function or not?
(i) R = {(2,1), (3,1), (4,2)}
(ii) R = {(2,2), (2,4), (3,3), (4,4)}
(iii) R = {(1, 2), (2, 3), (3, 4), (4, 5), (5, 6), (6,7)}
Answer :
(i) Given R= {(2,1), (3,1), (4, 2)}
Here every element of domain is related to unique element of co-domain, so it is a function.

(ii) Given R = {(2, 2), (2,4), (3, 3), (4, 4)}
Since the element 2 has two images namely 2 and 4, so it is not a function.

(iii) Given R = {(1, 2), (2, 3), (3, 4), (4, 5), (5, 6), (6, 7)}
Since every element of domain is related to unique

Question 38.
Let N be the set of natural numbers. Define a real valued function f: N → N by
f(x) = 2x + 1. Using this definition, complete the table given below:

X 1 2 3 4 5 6 7
y F : (1) =  F : ( 2) =  F : (3) =  F : (4) =  F : (5) =  F : (6) =  F : (7) =

Answer:
Given function is f(x) = 2x + 1.

X 1 2 3 4 5 6 7
y F:(1)=3  F:(2)=5  F:(3)=7  F:(4)=9  F:(5)=11  F:(6)=13  F:(7)=15

Question 39.
Which of the following relations are functions? Give reasons. If it is a function, determine its domain and range.
(i) {(2,1), (5,1), (8,1), (11,1), (14,1), (17,1)}
(ii) {(2, 1), (4, 2), (6, 3), (8, 4), (10, 5), (12, 6), (14,7)}
(iii) {(1,3), (1,5), (2,5)}.
Answer :
(i) Clearly, every element of domain is related to unique element of co-domain, so it is a function.
Domain = {2, 5, 8, 11, 14, 17}
Range = {1}

(ii) Clearly, every element of domain is related to unique element of co-domain, so it is a function.
Domain = {2,4, 6, 8,10,12,14}
Range = {1,2, 3,4, 5, 6,7}

(iii) 1 is related to two elements of co-domain, namely 3 and 5, so it is not a function.

KSEEB Solutions

Question 40.
Let A={1,2,3,4), B={1,5,9,11,15,16} and f = {(1,5),(2,9), (3,1), (4,5),(2, 11)). Are the
following true?
(i) f is a relation from A to B
(ii) f is a function from A to B. Justify your answer in each case.
Answer :
(i) Every element off is an element of A x B, so f is a relation.
(ii) ‘f’ is not a function the element 2 has two images.

Question 41.
Let f be the subset of Z x Z defined by f ={(ab,a +b):a,b ∈z) Is f a function from Z to Z? Justify your answer.
Answer :
Given f={(ab,a+b):a,b∈Z)
If a = 1 and b = 4 = ab = 4 and a+b=5
∴ (4,5) ∈ fIf a=2 and b=2⇒ab=4 and a+b=4
∴ (4,4) ∈ f∴ The element 4 has two images, so f is not a function.

Question 42.
The relation f is defined by
\( f(x)=\left\{\begin{array}{ll}{x^{2},} & {0 \leq x \leq 3} \\ {3 x,} & {3 \leq x \leq 10}\end{array}\right.\)
The relation g is defined by
\( g(x)=\left\{\begin{array}{ll}{x^{2},} & {0 \leq x \leq 2} \\ {3 x,} & {2 \leq x \leq 10}\end{array}\right.\) .
Show that/is a function and g is not a function.
Answer :
Since f(x) is unique for 0 ≤ x ≤ 10.
f(x) is a function. g(2) = 22 =4 and g(2) = 3(2) = 6
∴ z has two images under g.
∴ g is not a function.

Question 43.
Let f= {(1,1),(2,3),(0,-1),(-1,-3)} be a linear function from Z into Z. Find f(x) ).
Answer :
Since/is a linear function.
∴f{x) = ax + b
But (0,-1) ∈ f . f(0) ∴ a(0) + b ⇒ -1 = b
Similarly, (1,1) ∈ f ∴ f(1) = a(1) +a(1)+b
⇒ 1=a+b ∴ a=2 ∴ f(x) = 2x -1

Question 44.
A function f is defined by f(x) = 2x-5. Write down the values of (i) f(0) (ii) f(17) (iii) f(-3).
Answer :
Given: f(x) = 2x-5

  • f(0) = 2(0) – 5 = -5
  • f(17) = 2(17)-5 = 29
  • f(-3) = 2(-3) – 5 = -11

Question 45.
The function ‘t’ which maps temperature in degree Celsius into temperature in degree. Fahrenheit is defined by \( t(c)=\frac{9 c}{5}+32 \). Find
(i) t (0)
(ii) t (28)
(iii) t (-10)
(iv) The value of c, when t(c) – 212
Answer:
1st PUC Maths Question Bank Chapter 2 Relations and Functions 6

Question 46.
\(\text { If } f(x)=x^{2}, \text { find } \frac{f(1 \cdot 1)-f(1)}{1 \cdot 1-1}\)
Answer:
1st PUC Maths Question Bank Chapter 2 Relations and Functions 7

Question 47.
Find the range of each of the following functions:
(i) f{x) = 2-3x, x∈R,x>0
(ii) f(x) = x2 + 2, x is a real number
(iii) f(x) = x, x is a real number.
Answer :
(i) Given f(x) = 2-3x, x∈R,x>0
For x > 0,f(x) = 2 – 3x < 2
∴ Range of f= (-∞, 2)

(ii) Given f(x) = x2 + 2, x ∈ R
For x ∈ R, f(x) = x2 + 2 ≥ 2
Range of f = [2, ∞)

(iii) Given f(x) = x, x∈ R For r∈ E, f(x) = x∈R
Range of f = R

KSEEB Solutions

Question 48.
Let A = (9, 10, 11, 12, 13} and let f:A→N be defined by f(n) = the highest prime factor of n. Find the range of f.
Answer :
Given f(n) = the highest prime factor of n.
f(9) = the highest prime factor of 9 = 3
f(10) = the highest prime factor of 10 = 5
f(11) = the highest prime factor of 11 = 11
f(12) = the highest prime factor of 12 = 3
f(13) = the highest prime factor of 13 = 13
Range of f ={3,5,11,13}

Question 49.
\(\text { Let } f=\left\{\left(x, \frac{x^{2}}{1+x^{2}}\right): x \in \mathbb{R}\right\}\) be a function from R to R .Determine the range of f.
Answer:
1st PUC Maths Question Bank Chapter 2 Relations and Functions 8

Question 50.
Find the domain of the function \(f(x)=\frac{x^{2}+3 x+5}{x^{2}-5 x+4}\)
Answer:
Given \(f(x)=\frac{x^{2}+3 x+5}{x^{2}-5 x+4}\)
f(x) is defined for all real numbers except x2 – 5x + 4 = 0
But x2 -5x + 4 = (x-4) (x-1)
Domain of f= R-{1,4}

Question 51.
Find the domain of the function
\( f(x)=\frac{x^{2}+2 x+1}{x^{2}-8 x+12}\)
Answer:
\(f(x)=\frac{x^{2}+2 x+1}{x^{2}-8 x+12} \)
is not defined when
x2 – 8+12 = 0.
∴ (x-6)(x-2) = 0
∴ Domain of f = R-{2,6}

Question 52.
Find the domain and range of the following real functions:
(i) \( f(x)=-|x| \)
(ii) \(f(x)=\sqrt{9-x^{2}}\)
(iii) \(f(x)=\sqrt{x-1}\)
(iv) \(f(x)=|x-1|\)
Answer:
1st PUC Maths Question Bank Chapter 2 Relations and Functions 9

Remark: Operations of functions:
(i) Addition of two real functions:
Let f: X → R and g : X → R Then.
(f + g):X → R; (f + g)(x) = f(x) + g(x) for all x ∈ X

(ii) Difference of two real functions:
Let f : X → R and g : X → R Then.
(f – g): X → R; (f- g)(x) = f(x) – g(x) for all x ∈ X

(iii) Scalar multiplication of a function:
Let f: X → R and let ‘a’ he a scalar. Then,
(αf):X → R; (fg)(x) = f(x) for all x ∈ X

(iv) Multiplication of two real functions:
Let f: X → R and g : X → R .Then
(fg): X → R; (fg)(x)= f(x)g(x), for all x ∈ X

(v) Quotient of two real functions:
Let f: X → R and  g : X → R for all x for which g(x) ≠ 0. Then
\( \left(\frac{f}{g}\right): X \rightarrow \mathbb{R} ;\left(\frac{f}{g}\right)(x)=\frac{f(x)}{g(x)} \)

KSEEB Solutions

Question 53.
Let f(x) = x2 and g(x) = 2x + 1 be two real functions. Find (f+g)(x),(f-g)(x)
\((f g)(x),\left(\frac{f}{g}\right)(x)\)
Answer:
1st PUC Maths Question Bank Chapter 2 Relations and Functions 10

Question 54.
Let \( f(x)=\sqrt{x} \text { and } g(x)=x \) be two functions defined over the set of non-negative real numbers. Find (f+ g)(x), (f – g)(x) \((f g)(x) \text { and }\left(\frac{f}{g}\right)(x)\)
Answer:
1st PUC Maths Question Bank Chapter 2 Relations and Functions 11
1st PUC Maths Question Bank Chapter 2 Relations and Functions 12

Question 55.
Let f,g: R→R be defined, respectively by f(x) = x + 1,g(x) = 2x-3- Find f + g,f-g and \( \frac{f}{g} \)
Answer:
Given: f(x) = x + 1,g(x) = 2x-3
(f + g)(x) = f (x) + g(x) = x + 1 + 2x-3 = 3x-2
(f – g)(x) = fix) – g(x) = x + 1-2x + 3 = -x + 4
\( \left(\frac{f}{g}\right)(x)=\frac{f(x)}{g(x)}=\frac{x+1}{2 x-3}, x \neq \frac{3}{2}\)

Question 56.
Define an identity function and draw its graph also find its domain and range.
Answer :
The function f: M → R; f(x) = x for a II x∈R is called an identity function on R.
1st PUC Maths Question Bank Chapter 2 Relations and Functions 13

Question 57.
Define a constant function and draw its graph also find its domain and range.
Answer :
Let c be a fixed real number. Then, the function f : R→R, f(x) = c for all x∈R is called the constant function.
1st PUC Maths Question Bank Chapter 2 Relations and Functions 14
f(x) is defined for all real number,
∴ Domain = M
Range = { c }
1st PUC Maths Question Bank Chapter 2 Relations and Functions 15

Question 58.
Define a polynomial function.
Answer :
A function f : M → R is said to be polynomial function if for each x in IR,
y = f (x) = a0 + axx + a2x2 + ……………. + anxn
where n is a non-negative integer and a0,a1,a2………………….an ∈ R .

Question 59.
Draw the graph of the function f (x) = x2 and write its domain and range.
Answer:
Given function: f(x)= x2
1st PUC Maths Question Bank Chapter 2 Relations and Functions 16
Domain = R
Range = set of non-negative reals.

KSEEB Solutions

Question 60.
Draw the graph of the function f: R → R defined by f(x) = x3 Find its domain and range.
Answer :
Let f : R → R: f(x) = x3, ∀ ∈ R
Then, domain of f = R and range of f = R . we have
1st PUC Maths Question Bank Chapter 2 Relations and Functions 17

Question 61.
Define a rational function
Answer:
The functions of the type \(\frac{f(x)}{g(x)}\) where f(x) g(x) and g(x) are polynomial functions of x, defined in a domain, where g(x) ≠ 0

Question 62.
Let f : R – {0} → R defined by \( f(x)=\frac{1}{x}, \forall x \in \mathbb{R}-\{0\}\) . Find its domain and x range. Also, draw its graph.
Answer :
Given function is f : R – {0} → R defined by \( f(x)=\frac{1}{x} \)
∴ Domain = R-{0} and range =R-{0}

X -4 -2 -1 -0-5 -0-25 0-25 0-5 1 2
f(x)=1/x -0-25 -0-5 -1 -2 -4 4 2 1 0-5

1st PUC Maths Question Bank Chapter 2 Relations and Functions 18

Question 63.
Define a modulus function. Find its domain and range. Also, draw its graph.
Answer :
Let f: R → R defined by f(x) =1 x I, for each x ∈ R, is called modulus function.
\( \text { i.e., } f(x)=|x|=\left\{\begin{array}{ll}{x,} & {\text { if } x \geq 0} \\ {-x,} & {\text { if } x<0}\end{array}\right.\)
1st PUC Maths Question Bank Chapter 2 Relations and Functions 19
Domain = R
Range = set of non negative real numbers

Question 64.
Define Signum function. Draw its graph and find its domain and range.
Answer :
The function f: R → R defined by
\( f(x)=\left\{\begin{array}{lll}{1,} & {\text { if }} & {x>0} \\ {0,} & {\text { if }} & {x=0} \\ {-1,} & {\text { if }} & {x<0}\end{array}\right.\) is called signum function
We have
1st PUC Maths Question Bank Chapter 2 Relations and Functions 20
Domain = R
Range = {-1,0,1}

Question 65.
Define a greatest integer function. Draw its graph and find its domain and range.
Answer:
1st PUC Maths Question Bank Chapter 2 Relations and Functions 21
The function f : R → R define by f(x) = [x], x∈ R assumes the value of the greatest integer, less than or equal to x. Such a’ function is called the greatest integer function or step function. We have
[x] = -2 for – 2 ≤ x < -1
[x] = -1 for -1≤x<0
[x] = 0 for 0≤x≤1
[x] = 1 for 1 ≤ x < 2
[x] = 2 for 2 ≤ x < 3.
Hence, domain of f = R and range = Z.

Question 66.
Define a linear function.
Answer :
The function f : R → R defined by f(x) = mx + c, x ∈ R is called linear function, where m and c are constant.

KSEEB Solutions

Question 67.
Let R be the set of real numbers. Define the real function f : R →R by f(x) = x + 10 and sketch the graph of this function.
Answer :
Given f(x) = x +10
We have
1st PUC Maths Question Bank Chapter 2 Relations and Functions 22

Question 68.
The function f is defined by
\( f(x)=\left\{\begin{array}{cl}{1-x,} & {x<0} \\ {1,} & {x=0} \\ {x+1,} & {x>0}\end{array}\right.\).
Draw the graph of f(x)
Answer:
We have
1st PUC Maths Question Bank Chapter 2 Relations and Functions 23

Tili Kannada Text Book Class 5 Puraka Odu Bhasha Chatuvatike Galu

Students can Download Bhasha Chatuvatike Galu Questions and Answers, Notes Pdf, Tili Kannada Text Book Class 5 Solutions, Karnataka State Board Solutions help you to revise complete Syllabus and score more marks in your examinations.

Tili Kannada Text Book Class 5 Puraka Odu Bhasha Chatuvatike Galu

Tili Kannada Text Book Class 5 Puraka Odu Bhasha Chatuvatike Galu 1

Tili Kannada Text Book Class 5 Puraka Odu Bhasha Chatuvatike Galu 2
Tili Kannada Text Book Class 5 Puraka Odu Bhasha Chatuvatike Galu 3
Tili Kannada Text Book Class 5 Puraka Odu Bhasha Chatuvatike Galu 4

Tili Kannada Text Book Class 5 Puraka Odu Bhasha Chatuvatike Galu 5
Tili Kannada Text Book Class 5 Puraka Odu Bhasha Chatuvatike Galu 6
Tili Kannada Text Book Class 5 Puraka Odu Bhasha Chatuvatike Galu 7

Tili Kannada Text Book Class 5 Puraka Odu Bhasha Chatuvatike Galu 8
Tili Kannada Text Book Class 5 Puraka Odu Bhasha Chatuvatike Galu 9
Tili Kannada Text Book Class 5 Puraka Odu Bhasha Chatuvatike Galu 10
Tili Kannada Text Book Class 5 Puraka Odu Bhasha Chatuvatike Galu 11

2nd PUC Computer Science Question Bank Chapter 9 Constructors and Destructors

You can Download Chapter 9 Constructors and Destructors Questions and Answers, Notes, 2nd PUC Computer Science Question Bank with Answers Karnataka State Board Solutions help you to revise complete Syllabus and score more marks in your examinations.

Karnataka 2nd PUC Computer Science Question Bank Chapter 9 Constructors and Destructors

2nd PUC Computer Science Constructors and Destructors One Mark Questions and Answers

Question 1.
What is a constructor?
Answer:
It is a special member function that is used to initialize the data members of an object.

Question 2.
Write one reason which defines the need to use a constructor.
Answer:
The constructors are used to initialize the object automatically when an object is created. This reduces a separate function call to a member function used for such purpose. It is called constructor because it constructs the values of data members of the class.

Question 3.
What should be the access parameters for constructor declaration?
Answer:
The constructors should be declared in public section i.e., public is the access parameter for constructor declaration.

Question 4.
Can a constructor return a value to a calling function?
Answer:
No, constructors cannot return value to a calling function.

KSEEB Solutions

Question 5.
How many types of constructors are there?
Answer:
There are three types of constructors.

Question 6.
What is a default constructor?
Answer:
A constructor which does not take any arguments is called a zero argument constructor.

Question 7.
What is the drawback of default constructor?
Answer:
All objects of a class with default constructor are initialized to same set of values.

Question 8.
Is it possible to overload a default constructor?
Answer:
Since no arguments are there, the default constructor cannot be overloaded.

KSEEB Solutions

Question 9.
What is a parameterized constructor?
Answer:
A constructor that takes one or more arguments is called a parameterized constructor.

Question 10.
Write any one feature of parameterized constructor.
Answer:
The parameterized constructor can be overloaded.

Question 11.
Name two methods through which constructors can be invoked.
Answer:
The two methods through which constructors can be invoked are implicit call and explicit call.

Question 12.
What is an explicit call?
Answer:
It is a method of invoking a function where the declaration of object is followed by assignment operator followed by a constructor followed by argument list enclosed within parentheses.

Question 13.
What is an implicit call with reference to constructors?
Answer:
In this method, the declaration of object is followed by the argument list enclosed within parentheses.

Question 14.
When is = used with constructors?
Answer:
The = is used for the parameterized constructor with exactly one argument.

Question 15
What is a copy constructor?
Answer:
It is a parameterized constructor using which one object can be copied into another object.

KSEEB Solutions

Question 16.
Write the syntax for declaration of copy constructor.
Answer:
The syntax for declaration of copy constructor:
Classname :: Classname (Classname &ptr)

Question 17.
Can a copy constructor be invoked explicitly?
Answer:
No, a copy constructor cannot be invoked explicitly.

Question 18.
What is meant by constructor overloading?
Answer:
If many constructors differ by number of arguments or/and by type of arguments in a class is called constructor overloading.

Question 19.
What is a destructor?
Answer:
It is a special member function that destroys the objects that have been created by a constructor, when they no longer required.

Question 20.
Which operator is used with destructor?
Answer:
The operator tilde sign (~) is used with destructor.

2nd PUC Computer Science Constructors and Destructors Two Mark Questions and Answers

Question 1.
What is a constructor? Give an example.
Answer:
It is a special member function that is used to initialize the data members of an object,
2nd PUC Computer Science Question Bank Chapter 9 Constructors and Destructors 1

Question 2.
Why are constructor needed in a program? Justify.
Answer:
The objects are not automatically initialized when created. The explicit call to initialization member function can only initialize the object. This method proves to be inconvenient when large number of objects need to be initialized by giving separate function call. This problem can be overcome by automatically initializing object when they are created using constructor.

KSEEB Solutions

Question 3.
Write the syntax and example for default constructor.
Answer:
2nd PUC Computer Science Question Bank Chapter 9 Constructors and Destructors 2

Question 4.
Mention the features of parameterized constructors.
Answer:
The features of parameterized constructors are

  1. parameterized constructors can be overloaded
  2. parameterized constructors can have default arguments and default values.

Question 5.
Which are the different methods through which constructors are invoked?
Answer:
The different methods through which constructors are invoked are

  • Explicit call
  • Implicit call
  • Using = operator

KSEEB Solutions

Question 6.
Write an example to show the use of parameterized constructor through explicit call.
2nd PUC Computer Science Question Bank Chapter 9 Constructors and Destructors 3
2nd PUC Computer Science Question Bank Chapter 9 Constructors and Destructors 4

Question 7.
When is copy constructor used in a program?
Answer:
The copy constructor takes an object as argument and is used to copy values of data members of one object into other object.

Question 8.
Write syntax and example for copy constructor.
Answer:
2nd PUC Computer Science Question Bank Chapter 9 Constructors and Destructors 5
2nd PUC Computer Science Question Bank Chapter 9 Constructors and Destructors 6

2nd PUC Computer Science Constructors and Destructors Three Mark Questions and Answers

Question 1.
Mention three types of constructors.
Answer:
The three types of constructors are

  1. Default constructor
  2. Parameterized constructor
  3. Copy constructor

Question 2.
What are the features of default constructors?
Answer:
The features of default constructors are

  • All objects of a class are initialized to same set of values
  • These constructors has no arguments
  • These constructors are automatically called when every object is created.

Question 3.
What are the disadvantages of default constructor?
Answer:
The disadvantages of default constructor are

  • Different objects cannot be initialized with different values.
  • Declaring a constructor with arguments, hides default constructor.

KSEEB Solutions

Question 4.
Write short note for constructor overloading.
Answer:
The main use of constructors is to initialize objects. The function of initialization is automatically carried out by the use of a special member function called a constructor. The constructors are no different from other functions. Therefore constructors can also be overloaded.

Overloading a constructor means having many constructors in a class with different types arguments and/or different number of arguments. The compiler decides which version of the constructor to invoke during object creation based on number of arguments and type of arguments passed in a program.

2nd PUC Computer Science Constructors and Destructors Five Mark Questions and Answers

Question 1.
Write the rules for writing a constructor function.
Answer:
The rules for writing a constructor functions are

  • They should be declared in the public section.
  • They are invoked automatically when the objects are created.
  • They should not have return types, therefore they cannot return values.
  • They cannot be inherited.
  • They can have default arguments.
  • Cannot refer to addresses.
  • These cannot be static.
  • An object of a class with a constructor cannot be used as a member of a union.

Question 2.
Explain default constructor with syntax and example.
Answer:
This constructor has no arguments in it. Default Constructor is also called as no argument constructor. They initialize data members with common values for all objects belongs to similar class.
The features of default constructors are

  • All objects of a class are initialized to same set of values
  • These constructors has no arguments
  • These constructors are automatically called when every object is created.

2nd PUC Computer Science Question Bank Chapter 9 Constructors and Destructors 7

KSEEB Solutions

Question 3.
Explain parameterized constructor with syntax and example.
Answer:
The constructors that can take arguments are called parameterized constructors. When a constructor is parameterized, we must pass arguments to the constructor.
When a constructor is parameterized, the object declaration without parameter may not work. We must pass the initial values as arguments to the constructor. This can be done in two ways:

1. By implicit call – The implicit call is implemented as follows:
student mk (1200,19); /””implicit call*/

This method is also called the shorthand method, and is used very often as it is shorter, looks better and easy to implement. In the above example, student is a class name and mk is name of object and passed arguments are 1200, 19. One can notice that function name is not taken to invoke constructor.

2. By Explicit Call – The following statement illustrates the explicit call for the parameterized constructor
Student dushyanth = Student (1201, 20); /””explicit call*/

In the above example, Student is class name and dushyanth is object name.
After the = symbol, the name Student refers to parameterized constructor with argument
1201,20.
The parameterized constructor syntax:
2nd PUC Computer Science Question Bank Chapter 9 Constructors and Destructors 8

KSEEB Solutions

Question 4.
With an example show how constructors are used with = operator.
Answer:
The constructor argument if limited to single argument then = operator can be used to pass the values to these constructors. This is explained in the following example,
2nd PUC Computer Science Question Bank Chapter 9 Constructors and Destructors 9
2nd PUC Computer Science Question Bank Chapter 9 Constructors and Destructors 10

In the above program, c1 and c2 are objects with argument 10 and 20 respectively passed using = operator.

Question 5.
Explain the features of copy constructor.
Answer:
The features of copy constructor are

  1. The copy constructor should have at least one argument of the same class and this argument must be passed as a constant reference type.
  2. If additional arguments are present in the copy constructor, then it must contain default arguments.
  3. Explicit function call of copy constructor is not allowed.
  4. Copy constructor is also called automatically, when an object is passed to a function using pass by value.
  5. If a new object is declared and existing object is passed as a parameter to it in the declaration itself, then also the copy constructor is invoked.

Question 6.
Explain destructors with syntax and example.
Answer:
It is a special function used to release the memory space allocated by the object.
→ Name of the Destructor is similar to the class, which it belongs.
→ It does not have argument(s) and doesn’t return any value (no return type)
→ Destructor is preceded by ~ (tilde) sign.
Following points should be kept in mind while defining and writing the syntax for the destructor:

  • A destructor function must be declared with the same name as that of the class to which it belongs.
  • The first character of the destructor name must begin with a tilde (~).
  • A destructor function is declared with no return types specified (not even void).
  • A destructor function must have public access in the class declaration.

General Syntax of Destructors:
~ classname();
The above is the general syntax of a destructor. In the above, the symbol tilde ~ represents a destructor which precedes the name of the class.
For example,
2nd PUC Computer Science Question Bank Chapter 9 Constructors and Destructors 11

2nd PUC Computer Science Question Bank Chapter 16 Internet and Open Source Concepts

You can Download Chapter 16 Internet and Open Source Concepts Questions and Answers, Notes, 2nd PUC Computer Science Question Bank with Answers Karnataka State Board Solutions help you to revise complete Syllabus and score more marks in your examinations.

Karnataka 2nd PUC Computer Science Question Bank Chapter 16 Internet and Open Source Concepts

2nd PUC Computer Science Internet and Open Source Concepts One Mark Questions and Answers

Question 1.
What is open-source software?
Answer:
It is software with source code freely available to the customer and free to use but doesn’t have to be free of charge.

Question 2.
What is free software?
Answer:
Free software means the software is freely accessible and can be freely used, changed, improved, copied and distributed by all who wish to do so and doesn’t have to be paid.

KSEEB Solutions

Question 3.
What is OSS and FLOSS?
Answer:
OSS means Open Source Software refers to software whose source code is available to customers.
FLOSS refers to Free/Libre/Open Source Software. It is software that is both free software as well as open-source software. Libre means freedom.

Question 4.
What is proprietary software?
Answer:
A software neither open or freely available is called proprietary software.

Question 5.
What is freeware?
Answer:
A software available free of cost to use and distribute, but not for modification and without source code.

KSEEB Solutions

Question 6.
What are the browsers?
Answer:
It is a software application used to locate and display Web pages.

Question 7.
What is the URL?
Answer:
The Uniform Resource Locator (URS) is the global address of documents and other resources on the World Wide Web.

Question 8.
What is telnet?
Answer:
Telnet is a protocol that allows connecting to remote computers (called hosts) over a TCP/ IP network (such as the Internet).

Question 9.
What is a domain name?
Answer:
A domain name is a unique name that identifies a website on the internet.

KSEEB Solutions

Question 10.
What is domain affiliation?
Answer:
A domain affiliation means the type of domain whether it is commercial (.com), education (.edu) or government (.gov) etc.,

Question 11.
Define e-commerce?
Answer:
The e-commerce is defined as buying and selling of products or services over electronic systems such as the Internet and other computer networks.

Question 12.
Expand IPR.
Answer:
The expansion of IPR is Intellectual Property Rights.

2nd PUC Computer Science Internet and Open Source Concepts Two Mark Questions and Answers

Question 1.
List the OSS and FLOSS.
Answer:
List of OSS

  • Apache HTTP Server rhttp://httpd.apache.org/l (webserver)
  • Blender rhttp://www.blerider.orgl (3D graphics and animation package)

List of FLOSS
Mozilla Suite
OpenOffice.org

Question 2.
What is FSF?
Answer:
A Free Software Foundation (FSF) is a non-profit organization created for the purpose of supporting free software movement.

Question 3.
What are OSI and W3C?
Answer:

  • OSI means Open Source Initiative is an organization dedicated to promoting open-source software.
  • W3C is an acronym for World Wide Web Consortium is responsible for producing the software standards for WWW.

Question 4.
What is the URL and HTTP?
Answer:

  • URL- Uniform Resource Locator and
  • HTTP – HyperText Transfer protocol

Question 5.
Name the different protocols used?
Answer:
The different protocol used are HTTP, FTP, SMPT, TCP/IP, UDP, POP, etc.,

KSEEB Solutions

Question 6.
List the services of e-commerce?
Answer:
Few services of eCommerce are:

  • Domain name purchasing
  • Secure hosting
  • Full integration with the payment gateway of your choice
  • Web design
  • Shopping cart system
  • Marketing

Question 7.
Write a note on WIPO.
Answer:
WIPO is the global forum for intellectual property services, policy, information and, cooperation. It is a self-funding agency of the United Nations, with 187 member states. Its mission is to lead the development of a balanced and effective international intellectual property (IP) system that enables innovation and creativity for the benefit of all.

2nd PUC Computer Science Internet and Open Source Concepts Three Mark Questions and Answers

Question 1.
What is Open source?
Answer:
The term “open source” refers to something that can be modified because its design is publicly accessible. Open-source software is software whose source code is available for modification or enhancement by anyone but need not be free of charge.

Its developers make its source code available to others who would like to view that code, copy it, learn from it, alter it, or share it. LibreOffice and the GNU Image Manipulation Program are examples of open-source software.

Open-source software licenses allow other people to make changes to source code and include those changes into their own projects. Some open-source licenses make sure that anyone who alters and then shares a program with others must also share that program’s source code without charging a licensing fee for it.

KSEEB Solutions

Question 2.
Write the advantages of WWW.
Answer:
Advantages of WWW

  • Availability of mainly free information
  • Reduces the costs of information
  • The same protocol of communication can be used for all the services
  • Provide rapid interactive communication
  • Provides the exchange of huge volumes of data
  • Provides access to different sources of information, which is continuously updated
  • Provides management of companies information systems.
  • It is accessible from anywhere, any time.
  • It has become the global media for information exchange.

Question 3.
What is Telnet?
Answer:
TELNET (TELecommunication NETwork) is a network protocol developed in 1969, used on the Internet or local area network (LAN).
The telnet provides access to a command-line, interface on a remote host by means of a virtual terminal. The network terminal protocol (TELNET) allows a user to log in on any other computer on the network. We can start a remote session by specifying a computer to connect to. From that time until we finish the session, anything we type is sent to the other computer.

The Telnet program runs on the computer and connects your PC to a server on the network. , We can then enter commands through the Telnet program and they will be executed as if we were entering them directly on the server-side.

This enables to control the server and communicate with other servers on the network. To start a Telnet session, we must log in to a server by entering a valid username and password. Telnet is a common way to remotely control Web servers.

KSEEB Solutions

Question 4.
Write web servers.
Answer:
1. A web is a computer on which a web site is hosted and a program that runs on such a computer. So the term web server refers to both hardware and software.

2. A web site is a collection of web pages generally written using HyperText Markup Language (HTML). For a web site to be available to everyone in the world at all times, it needs to be stored or “hosted” on a computer that is connected to the internet. Such a computer is known as a Web Server.

3. A web server program is software that runs on the web site hosting Server computer. Its main purpose is serving web pages for requests from web browsers.

4. The Server machine hosts (stores) the web site on its hard disk while the server program helps deliver the web pages and their associated files like images, flash movies, etc. to clients (browsers).

5.  There are many web server programs available. The most famous and popular of them all is Apache developed by the Apache Foundation. It is free and also available for several operating systems including Windows, Macintosh, and Linux/Unix.

Question 5.
Write a note on open source.
Answer:
The term “open source” refers to something that can be modified because its design is 1 publicly accessible. Open-source software is software whose source code is available for modification or enhancement by anyone but need not be free of charge.

Its developers make its source code available to others who would like to view that code, copy it, learn from it, alter it, or share it. Libre Office and the GNU Image Manipulation Program are examples of open-source software.

Open-source software licenses allow other people to make changes to source code and include those changes into their own projects. Some open-source licenses make sure that anyone who alters and then shares a program with others must also share that program’s source code without charging a licensing fee for it.

KSEEB Solutions

Question 6.
Explain free software.
Answer:
Free software means the software is freely accessible and can be freely used, changed, improved, copied and distributed by all who wish to do so and doesn’t have to be paid. Free in Free Software is referring to freedom, not price. In particular, four freedoms define Free Software:

  1. The freedom to run the program, for any purpose.
  2. The freedom to study how the program works, and adapt it to your needs.
  3. The freedom to redistribute copies so you can help your neighbor.
  4. The freedom to improve the program, and release your improvements to the public, so that the whole community benefits.

Question 7.
Explain URLs.
Answer:
It is the global address of documents and other resources on the World Wide Web. URLs have the following format:
protocol://hostname/other_information for
example, http:// www.vpuc.com /
The protocol specifies how information from the link is transferred. The protocol used for web resources is HyperText Transfer Protocol (HTTP). The protocol is followed by a colon, two slashes, and then the domain name. The domain name is the computer on which the resource is located. Links to particular files or subdirectories may be further specified after the domain name.
For example, the two URLs below point to two different files at the domain vpuc.com. The first specifies an executable file that should be fetched using the FTP protocol; the second specifies a Web page that should be fetched using the HTTP protocol:

  • ftp://www.vpuc.com/timetable.exe
  • http://www.vpuc.com/index.html

Question 8.
How e-commerce Works?
Answer:
The e-commerce is defined as buying and selling of products or services over electronic systems such as the Internet and other computer networks.

The working of e-commerce:
There are five major components of eCommerce, the Merchant Account, the Shopping System, the Payment Gateway (for real-time-processing), the Hosting Service and the Security System.
1. The Merchant Account:
Any type of real eCommerce requires a Merchant Account. A merchant account comes with a merchant identification number. In order to process transactions require either a terminal (the little box that you swipe your credit card through at retail outlets) or software that runs on your PC and will dial up the merchant via your modem/and then process the transaction and deposit the money into your bank account.

2. The Shopping System:
A site with a variety of products should use the shopping cart system because it’s the easiest way for customers to choose items during the shop. There are many choices when selecting a Shopping System but some of the most important should be. functionality, ease of use, and compatibility. Shopping systems like anything else now days can be purchased or leased.

3. SSL Certificate:
This Certificate provides security for the credit card information from the user’s browser through the trader website and then into the Gateway. Certificates can be purchased from companies like Geo Trust, VeriSign and a handful of others.

4. Gateway Account:
Once the user sends his order it is transferred from his machine to the Shop-Cart and is protected by the Secure Socket Layer (SSL), the server then sends data to the Payment Gateway. Gateways are services linked between the e-commerce website and the banking networks. The Gateway is simply the door into the ATM banking network. The processor accepts the data from the shop-cart and brings it into the ATM network.

If the order is accepted, it will then charge the order amount to the customer’s account and sends the Gateway an authorization code. The Customers Bank will then settle the remainder of the transaction at a later time.
Payment Diagram:
1. Consumer places an order with the merchant through any number of sales channels: Web Site, Call Center, Retail, Wireless or Broadband.

2. Authorize.Net detects an order has been placed, securely encrypts and forwards the Authorization Request to the Consumer’s Credit Card Issuer to verify the consumer’s credit card account and funds availability.

3. The Authorization (or Decline) Response is returned via Authorize.Net to the Merchant. Round trip this process averages less than 3 seconds.

4. Upon approval, the Merchant fulfills the consumer’s order.

5. Authorize.Net sends the settlement request to the Merchant Account Provider.

6. The Merchant Account Provider deposits transaction funds into the Merchant’s Checking Account.

KSEEB Solutions

Question 9.
Explain types of e-commerce.
Answer:
1. B2B – Business to business:
Electronic commerce that is conducted between business organizations is referred to as business-to-business or B2B. for example, transactions between the manufacturing industry with suppliers of raw materials.

2. B2C- Business to Consumer:
Electronic commerce that is conducted between traders and consumers is referred to as business-to-consumer or B2C. This is the type of electronic commerce conducted by . companies such as Amazon.com, ebay.com, etc.,

3. C2B – Consumer to Business:
It is an electronic commerce business model in which consumers (individuals) offer products and services to companies and the companies pay them.

4. C2C – Consumer to Consumer:
Customer to Customer (C2C) markets are new ways to allow customers to interact with each other. In customers to customer markets, customers can sell goods and or services to each other. There are many sites offering free classifieds, auctions, and forums. Eg. Quickr.com etc.,

Question 10.
Explain the IPR in India.
Answer:
Intellectual Property Rights (IPR), very broadly, are rights granted to creators and owners of works that are results of human intellectual creativity. These works can be in the industrial, scientific, literary and artistic domains, which can be in the form of an invention, a manuscript, a suite of software, or a business name.

India has set up an Intellectual Property Right (IPR) regime, which is WTO compatible and is well established at all levels whether statutory, administrative or judicial. In the Ministry of Commerce and Industry, the office of the ‘Controller General of Patents, Designs and Trade Marks (CGPDTM)’ has been set up under the Department of Industrial Policy and Promotion.

It administers all matters relating to patents, designs, trademarks, and geographical indications and also directs and supervises the functioning of:

  • The Patent Office (including Designs Wing)
  • The Patent Information System (PIS)
  • The Trade Marks Registry (TMR), and
  • The Geographical Indications Registry (GIR)

Besides, a ‘Copyright Office’ has been set up in the Department of Education of the Ministry of Human Resource Development, to provide all facilities including registration of copyrights and its neighbouring rights.

The issues relating to the layout design of integrated circuits, the ‘Department of Information Technology’ in the Ministry of Information Technology is the nodal organisation. While ‘Protection of Plant Varieties and Farmers’ Rights Authority’ in the Ministry of Agriculture administers all measures and policies relating to plant varieties.
Legislations Covering IPRS in INDIA
1. Patents:

  • The Patents Act, 1970.
  • The act was last amended in March 1999.

2. Design:

  • The Designs Act, 1911.
  • A new Design Act 2000 has been enacted superseding the earlier Designs Act 1911.

3. Trade Mark:

  • The Trade and Merchandise Marks Act, 1958.
  • A new Trademarks Act, 1999 has been enacted superseding the earlier Trade and Merchandise Marks Act, 1958. (Enforcement pending)

4. Copyright:
The Copyright Act, 1957 as amended in 1983,1984 and 1992,1994,1999 and the Copyright Rules, 1958.

5. Layout Design of Integrated Circuits:
The Semiconductor Integrated Circuit Layout Design Act 2000. (Enforcement pending)

6. Protection of Undisclosed Information:
No exclusive legislation exists but the matter would be generally covered under the Contract Act, 1872.

7. Geographical Indications:
The Geographical Indication of Goods (Registration and Protection) Act 1999. (Enforcement pending).

2nd PUC Kannada Previous Year Question Paper March 2017

Students can Download 2nd PUC Kannada Previous Year Question Paper March 2017, Karnataka 2nd PUC Kannada Model Question Papers with Answers help you to revise complete Syllabus and score more marks in your examinations.

Karnataka 2nd PUC Kannada Previous Year Question Paper March 2017

2nd PUC Kannada Previous Year Question Paper March 2017 1
2nd PUC Kannada Previous Year Question Paper March 2017 2
2nd PUC Kannada Previous Year Question Paper March 2017 3
2nd PUC Kannada Previous Year Question Paper March 2017 4
2nd PUC Kannada Previous Year Question Paper March 2017 5

2nd PUC Kannada Previous Year Question Paper March 2017 6
2nd PUC Kannada Previous Year Question Paper March 2017 7
2nd PUC Kannada Previous Year Question Paper March 2017 8
2nd PUC Kannada Previous Year Question Paper March 2017 9
2nd PUC Kannada Previous Year Question Paper March 2017 10
2nd PUC Kannada Previous Year Question Paper March 2017 11

error: Content is protected !!