Students can Download 2nd PUC Computer Science Previous Year Question Paper March 2016, Karnataka 2nd PUC Computer Science Model Question Paper with Answers helps you to revise the complete Karnataka State Board Syllabus and to clear all their doubts, score well in final exams.
Karnataka 2nd PUC Computer Science Previous Year Question Paper March 2016
Time : 3 Hrs. 15 Mins.
Max. Marks : 70
Section – A
I. Answer the following questions in a sentence each: (10 × 1 = 10)
Question 1.
What is DHTML?
Answer:
DHTML refers to Dynamic HTML extensions that will enable a web page to react to user input without sending requesting to the web server.
Question 2.
Define e – commerce.
Answer:
E-Commerce can be defined as using telecommunications and computers to facilitate the trade of goods and services.
Question 3.
Define Local Area Networking.
Answer:
A Local Area Network (LAN) is a computer network confined to a localized area, such as an office, building or a factory. LAN’s serve as resource sharing net¬works to share data, information, programs, printer, harddisks, modems etc.
Question 4.
Define the term ‘topology’ of computer networks.
Answer:
A topology is the actual appearance or layout of network.
Question 5.
Define Data Mining.
Answer:
Data mining is concerned with the analysis and picking out relevant information. It is the computer, which is responsible for finding the patterns by identifing the underling rules of the features in the data.
Question 6.
How do you initialize a pointer variable?
Answer:
int num = 25;
int * iptr;
iptr = & num;
Question 7.
What is the significance of scope resolution operation in C++?
Answer:
The use of scope resolution operator implies that these member functions are defined outside the class.
Question 8.
Name any one non – linear data structure.
Answer:
A non – linear data structure is a data structure in which a data item is connected to several other data items. The TREES and GRAPH are non – linear data structures.
Question 9.
Write the standard symbol for XOR gate.
Answer:
Question 10.
Expand ISA.
Answer:
ISA: Industry Standard Architecture.
Section – B
II. Answer any five questions. Each question carries two marks (5 × 2 = 10)
Question 11.
Prove (X + Y) (X + Z) = X + YZ using algebraic method.
Answer:
LHS = (x+y ) (x+z)
= xx + xz + xy + yz | | x . x = 1
= x + xz + xy + yz
= x (1 + z) + xy + yz
= x + xy + yz
= x (1 + y) + yz | | ∴ 1 + y = 1
= x (l) + yz
= x + yz
= RHS
Question 12.
Give the general syntax for defining classes and objects.
Answer:
The general syntax for defining classes
class user _ defined _ name { Private : Member data Member functions Protected : Member data Member functions Public : Member data Member functions };
Objects of a class:
When a class is defined, it specifies the type information the objects of the class store. Once the class is defined an object is created from the class. The objects of a class are declared is the same manner like any other variable declaration.
Syntax :
Class user _ defined _ name
{
Private : / / Members
Public : / / Methods
};
user _ defined _ name object 1, object 2 …. ;
Question 13.
What are minterms and maxterms?
Answer:
A minterm is a special product of literals, in which each input variable appears exactly once. A maxterm is a sum of literals, in which each input variable appears exactly once.
Question 14.
Mention any two antivirus softwares.
Answer:
Avast and McAfee.
Question 15.
Write the syntax for delete and insert commands in SQL.
Answer:
There are two basic syntaxes of INSERT INTO statement as follows:
INSERT INTO TABLE _ NAME (Column 1, Column 2, Column 3, ………….., Column N)]
VALUES (Value 1, Value 2, Value 3, ………….., Value N);
Syntax For Delete Command:
DELETE Column 1, Column 2, …………., Column N
From table _ name
WHERE [Condition]
Question 16.
Write any two rules for constructors.
Answer:
Two rules for constructors:
- A constructor always has name that is same as the class name of which they are the members. This will help the compiler to identity that they are the constructors.
- A constructor should be declared in public section.
Question 17.
Write any two member functions belonging to off stream class.
Answer:
Put (). write (). seekp(), tellp().
Question 18.
What are the advantages and disadvantages of ISAM?
Answer:
Advantages:
- ISAM permits efficient & economical use of sequential processing techniques when the activity ratio is high.
- Permits direct assess processing of records in a relatively efficient way when the activity ratio is low.
Disadvantages:
- Files must be stored in a direct access storage device. Hence relatively expensive hardware & software resources are required.
- Access to records may be slower may be slower than direct file.
- Less efficient in the use of storage space than some other alternatives.
Section – C
III. Answer any five questions. Each question carries three marks (5 × 3 = 15)
Question 19.
What is web hosting? Mention various web hosting services.
Answer:
Web hosting is a means of hosting web – server application on a computer system through which electronic content on the Internet is readily available to any web – browser client.
Various types of web hosting services:
- Free Hosting
- Virtual or Shared Hosting
- Dedicated Hosting
- Collocation Hosting
Question 20.
What is meant by shareware? Write its limitations.
Answer:
Shareware is software, which is made available with the right to redistribute copies, but it is stipulated that if one intends to use the software, often after a certain period of time, then a license fee should be paid.
- in shareware the source code is not available.
- Modifications to the software are not allowed.
Question 21.
Explain relational data model with an example.
Answer:
The relation data model was developed by E.F Codd in 1970. In the relational data model, unlike the hierarchical and models, there are no physical links all data is maintained in the form of tables [generally known as relations) consisting of rows and columns. Each row (record) represents an entity and a column (field) represents an attribute of the entity.
The relationship between the two tables is implemented through a common attribute in the tables and not by physical links or pointers. This makes the querying much easier in a relational database system than in the hierarchical or network database systams.
Thus the relational model has become more programmer friendly and much more dominant and popular in both industrial and academic scenarios, oracle, Sybase, DBZ, Ingres, informix, ms – server are few of the popular relational DBMSs.
Question 22.
Give the functions of the following.
- get ()
- getline()
- read()
Answer:
1. get ():
The get () member function belongs to the class ifstream and the function get () reads a single character from the associated stream.
Syntax :
ch is character constant or char variable. The funtion reads ch from the file represented by the ifstream_object into the variable ch.
char ch – ‘a’;
ifstream fin (“text.txt”);
fin.get(ch);
Reads a character into the variable ch the current byte position from the file represented by the object fin, i.e., text.txt.
2. getline():
It is used to read a whole line of text. It belongs to the class ifstream.
Syntax: fin.getline (buffer, SIZE);
Reads SIZE characters from the file represented by the object fin or till the new line character is encountered, whichever comes
Example: char book[SIZE];
fstream fin;
fin.getline(book, SIZE);
3. read():
The read () member function belongs to the class ifstream dnd which is used to read binary data from a file.
Syntax: ifstream_object.read((char *) & variable, sizeof(variable));
ifstream_object is an object of type ifstream. The function requires two arguments. The first argument is the address of the variable, the contents of which are read from , the file and the second argument is the sizeof the variable. The address of the variable is type casted to pointer to char type.
It is because the read function does not bother to know the type of variable. It requires data in terms of only bytes. The function reads a record from the file represented by the boject fin to the object std.
Example: students;
ifstream fin(“std.dat”,ios::binary);
fin.read((char*) &s, sizeof(s));
Read a student record from the file std.dat into the object s.
Question 23.
Explain the use of new and delete operators in pointers.
Answer:
new operator in C++:
We can allocate storage for a variable while program is running by using new operator. Dynamic allocation is perhaps the key to pointers. It is used to allocate memory without having to define variable & then make pointers point to them.
delete operator in C++:
- Delete operator is used to free dynamic memory as delete iptr;
- To free dynamic array memory, delete []dptr;
- To free dynamic structure, delete student;
Question 24.
What is stack? Write an algorithm for POP operation.
Answer:
stack:
A stock is an ordered collection of items where the addition of new items and the removal of exisiting items always take place at the same end.
Algorithm for POP operation:
POP [STACK, Top, ITEM)
step 1: IF Top = 0 then [check underflow]
PRINT “stack is empty”
Exit
End of If
step 2: STACK [Top] = ITEM [copy the top element]
step 3: Top =Top -1 [Decrement the top]
step 4: Return
Question 25.
Draw the logic diagram and truth table for 2 input XOR gate.
Answer:
Truth table of 2 – input XOR gate.
The symbols of XOR gates are:
Question 26.
Expand UPS. Explain the types of UPS.
Answer:
UPS: Uninterratable Power Supply.
Types of UPS :
1. Online UPS:
An online UPS avoids those momentary power lapses by continuously providing power from its own inverter, even when the power line is functioning properly. Online UPS is more costly than Standby UPS. For a PC with color monitor 15″, requires an UPS of 500VA and for a PC with color monitor 17″, requires an UPS of 600VA.
2. Standby UPS:
A Standby UPS (or off-line UPS) monitors the power line and switches to battery power as soon as it detects a problem. The switch over to battery, however, can require several milliseconds, during which time the computer is not receiving any power.
Section – D
IV. Answer any Seven of the following questions. Each question carries Five marks (7 × 5 = 35)
Question 27.
Write an algorithm to insert an element into a queue.
Answer:
Let QUEUE is the linear array consisting of N elements. FRONT is the pointer that contains the location of the element to be deleted and REAR contains the location df the inserted element. ITEM is the element to be inserted.
Step 1: If REAR = N Then [ check for over flow]
PRINT “overflow”
Exit
Step 2: If FRONT = NULL Then [check whether QUEUE is empty]
FRONT = 0
REAR =0
Else
REAR = REAR + 1 [Increment REAR pointer]
Step 3: QUEUE = [REAR] = ITEM [Copy ITEM to REAR position]
Step 4: Return
Question 28.
Write an algorithm for insertion sort method.
Answer:
Let A be an array with N unsorted elements. The following algorithm sorts the elements in order.
Step 1: for P = 1 to N – 1
Step 2: temp = A[P]
PTR = P – 1
Step 3: while temp < A [PTR]
A [PTR + 1] = A [ PTR]
PTR = PTR + 1
End of while
Step 4: A [PTR + 1] = temp
End of for
Step 5: End.
Question 29.
Using K – map, simplify the following expression in four variables: F (A, B, C, D) = m2 + m3 + m5 + m7 + m9 + m11 +m13.
Answer:
For four variable A, B, C, D k – map
F (A, B, C, D) = m2 + m3 + m5 + m7 + m9 + m11 +m13
Let the four variables be ABCD. We need 4 variable k – map
Question 30.
Write the rules to be followed in writing constructor function in C++.
Answer:
- A constructor always has name that is same as the class name of which they are the members. This will help the compiler to identity that they are the constructors.
- There is no return type for the constructor (not even void). Since the constructors are called automatically by the system there is no program for it to return anything a return value world not make sense.
- A constructor should be declared in the public section.
- A constructor is invoked automatically when objects are created. Constructors can have default arguments.
- It is not possible to refer to the address of the constructros.
- The constructors make implicit class to the operators new & delete when memory allocation is required.
Question 31.
Describe briefly the use of friend function in C++ with syntax and example.
Answer:
A function is a non – member function that is a friend of a class, The friend function is declared inside the class with the perfix friend.
- A friend function although not a member function, has the full access right to the private & protect members of the classes.
- A friend functions cannot be called using the object of the class. It can be invoked like any normal function.
- A friend function is declared by the class that is granting access. The friend declared can be placed anywhere in the class declaration. It is not affected by the access control keywords (public, private absed protected)
- They are normal external functions that are given special access privileges.
- It cannot access the number variable directly & has to use an object- name member – name [Here is membership operator].
- The function is a declaration with the keyword friend But while defining friend function it does not use either keyword friend or “::” operator.
Question 32.
Explain defining objects of a class with syntax and programming example.
Answer:
When a class is defined, it specifies the type information the objects of the class store. Once the class is defined an object is created from that class. The objects of a class are declared in the same manner like any other variable declaration.
Syntax: class user_defined_name
{
private : / / Members
public : / / Methods
};
User_defined_name objectl, object2, … ;
Example 1:
class num { private : int x; int y; public : int sum(int p, int q); int diff(int p, int q); }; void main () { num s1, s2; sl.sum(200, 300); s2.diff(600, 500); }
Note that an object is an instance of a class template.
Example 2:
A class to create studentname, rollno, sex, age.
class student { int rollno; char name[20]; char sex; int age; public : void get_data(); void display_data(); };
student obj1, obj2; / / Obj1, obj2 are objects of class student.
Question 33.
Define object oriented programming. Write the limitations of object oriented programming.
Answer:
Object oriented programming is a programming paradigm that uses “objects” to design applications and computer programs. The OOP uses several techniques such as inheritance, abstraction, modularity, polymorphism and encapsulation. Limitations of object oriented programming.
- OOP software is not having set standards.
- The adaptability of flow diagrams & object oriented programming using classes and objects is a complex process.
- To convert a real World problem into an object oriented model is difficult.
- The classes are overly generalized.
Question 34.
Explain network securities in detail.
Answer:
Network security, makes sure that only legal authorised user & programs gain access to information resources like databases. Also certain control mechanisms are setup that properly authenticated users to get access only to those resources that they are entitled to use.
Under this type of security, mechansims like authorization, authentication, encrypted smart cards, biometrics &firewalls, etc are implemented. The problems encountered under network securlity can be summarized as follows:
- physical security holes: When individuals gain unauthorized physical access to a computer and tamper with files. Hackers do it by guessing passwords of various users & then gaining access to the network systems.
- Software security holes: When badly written programs or ‘privleged’ software are compromised into doing things that they should not be doing.
- Inconsistent usage holes: When a system admistrator assembles a combination of hardware & software such that the system is seriously from a security point of view.
Question 35.
Describe any five logical operators available in SQL.
Answer:
- ALL: The ALL operator is used to compare a value to all values in another value set.
- AND: The AND operator allows the existence of multiple conditions in an SQL statement’s WHERE clause.
- ANY: The ANY operator is used to compare a value to any applicable value in the list according to the condition.
- BETWEEN: The BETWEEN operator is used to search for values that are within a set of values, given the minimum value and the maximum value.
- EXISTS: The EXISTS operator is used to search for the presence of a row in a specified table that meets certain criteria.
Question 36.
Write the differences between Manual and Electronic Data Processing.
Answer:
Manual file:
- The volume of the data, which can be processed, is limited in a desirable time.
- Manual data processing requires large quantity of paper.
- The speed & accuracy at which the Job is executed is limited.
- Labour cost is high.
- Storage medium is paper.
Ellectronic file:
- The volume of data which can be processed can be very large.
- Reasonable less amount of paper is used
- The Job executed is faster & Accurate.
- Labour cost is economical.
- Storage medium is secondary storage medium.
Question 37.
Explain briefly the types of inheritance.
Answer:
- Single Inheritance
- Multilevel Inheritance
- Multiple Inheritance
- Hierarchical Inheritance
- Hybrid Inheritance
1. Single Inheritance:
If a class is derived from a single base class, it is called as single Inheritance.
ex:
2. Multilevel Inheritance:
The class are derived form the classes that are already derived is called multilevel Inheritance.
ex: