2nd puc computer science model question papers with
answers, 2nd puc computer science solved model question papers
PU-II
COMPUTER SCIENCE
SOLVED
MODEL QUESTION PAPER 4
I.
Answer all the questions. Each question carries 1 mark. 10 x 1 = 10
1. What
are expansion slots?
Ans:
an opening in a computer where you can insert a printed circuit board.
2. Define
logic gate.
Ans:
Logic gate
is an electronic circuit which operates on one or more input signals to
produces an output.
3. What
is non-linear data structure?
Ans:
a data structure in which a data item is connected to several other data items.
4. Name
the access specifier implicitly used in a class.
Ans:
private.
5. What
is dynamic memory?
Ans: it is a memory allocated to the variable during execution of a program
6. Define
data independence.
Ans: it is an ability of a database to modify
a schema definition at one level without affecting a schema in the next higher
level.
7. Who
are hackers?
Ans:
hackers are programmers who are more interested in gaining knowledge about
computer systems and possibly use this knowledge for playful pranks.
8. Expand
FTP.
Ans:
File Transfer Protocol.
9. What
is open source software?
Ans:
softwares can be freely used but it does not have to be free of charge. Here
the company constructing the business models around open source software may
receive the payments concerning support, further development.
10. Define web scripting.
Ans:
the process of creating and embedding scripts in a web page is known as
web scripting.
II.
Answer any five of the following. Each question carries 2 marks. 5 x 2 = 10
11. Draw a truth table to show X+XY=X.
Ans:
X
|
Y
|
XY
|
X+XY
|
0
|
0
|
0
|
0
|
0
|
1
|
0
|
0
|
1
|
0
|
0
|
1
|
1
|
1
|
1
|
1
|
12. Show that 0+X=X using properties of
0’s and 1’s.
Ans:
LHS= 0+XIf X=0, then, 0+X
=0+0
=0
=X
=RHS
If X=1, then, 0+X
= 0+1
=1
=X
=RHS
13. Define polymorphism with examples.
Ans:
it is an
ability of the message to process in more than one form.
14. What is a constructor? Give an
example.
Ans:
constructor is a special member function used to initialize data members of the
class.
15. Name any two member functions
belonging to ofstream class.
Ans:
put(),write(),tellp(),seekp().
16. What is normalization? Mention its
types.
Ans:
normalization is a process of organizing data in a database. This includes
creating tables and establishing the realtionships between those tables
according to the rules designed both to protect the data and to make the
database more flexible by eliminating redundancy and inconsistent dependency.
Normalization
divided in to te following normal forms,
-
First Normal Form (1 NF)
-
Second Noraml Form (2 NF)
-
Third Normal Form (3 NF)
-
BCNF
17. List DCL commands.
Ans:
grant and revoke.
18. Explain GPRS.
Ans:
GPRS is the abbreviation for General Packet Radio Service. It is used in
wireless communication using mobile device. With this service you can access
the internet, send emails and large data, real time news, download games and
watch movies.
III.
Answer any five of the following. Each question carries 3 marks. 5 x 3 = 15
19. Mention the types of motherboard.
Ans:
- eXtended Technology (XT)
-
Advanced Technology (AT)
-
Baby Advanced Technology (Baby AT)
-
Advanced Technology eXtended (ATX)
20. Explain NAND gate with logic
diagram and truth table.
Ans: NAND gate produces 0 for all 1 inputs and produces 1 for other input combinations.
21. Write an algorithm to delete an
element from an array.
Ans: Step 1: item=A[P]
Step 2: for I=P to N-1
A[I]=A[I+1]
end of for
step 3: N=N-1
step 4: exit
22. What is new operator in C++? Give
an example.
Ans:
Operator that allocates memory for objects from
a pool called the free store. The new operator calls the special function
operator new.Example, to allocate memory of type integer, int *iptr=new int;
23. Explain opening a file using open
() member function with syntax and example.
Ans:
the syntax for opening a file for output purpose only using an object of
ofstream class and open() member function is as follows:ofstream_object.open(“filename”);
example: ofstream ofile;
ofile.open(“text.txt”);
the syntax for opening a file for input purpose only using an object of ifstream class and open()
member function is as follows:
ifstream_object.open(“filename”);
example: ifstream ifile;
ifile.open(“text.txt”);
24. List the types of data model
explain any one.
Ans:
- hierarchical data model.
-
Network data model.
-
Relational data model.
25. What is proprietary software? Write
its limitations.
Ans:
proprietary software is software that
is neither open nor freely available. Its use is regulated and further
distribution and modification is either forbidden or requires special
permission by the supplier or vendor. Source code of proprietary software in
normally not available.
26. Write HTML program to show the use
of list items.
Ans:
<HTML>
<BODY>
<OL>
<LI>APPPLE</LI>
<LI>MANGO</LI>
<LI>KIWI</LI>
</OL>
</BODY>
IV.
Answer any seven of the following. Each question carries 5 marks. 7 x 5 = 35
27. Using K-map, simplify the following
expressions in four variables, W,X,Y,Z.
m1,m3,m5,m7,m9,m11,m13,m15
Ans:
28. Write an algorithm to PUSH and POP
an element from the stack.
Ans: An algorithm for PUSH() Operation
Step 1: if TOP=N
then
PRINT “stack is full”
Exit
End of if
Step 2: TOP=TOP+1
Step 3: STACK[TOP]=ITEM
An algorithm for
POP() Operation
Step 1: if TOP=o
then
PRINT “Stack is empty”
Exit
Step 2:
ITEM=STACK[TOP]
Step 3:
TOP=TOP-1
29. List the applications of queues.
Ans: -Simulation.- Multi-programming platform systems.
- Various features of operating system.
- Different types of scheduling algorithm.
- Printer server routines
30. Describe the basic concepts of
object oriented programming.
Ans: Following are the major
characteristics of OOPs- Objects
- Classes
- Data abstraction
- Data encapsulation
- Inheritance
- Overloading
- Polymorphism
- Dynamic binding
- Message passing
Ø
Objects:
An object may be a person, place or a table of data. An object is a collection
of data members and function members.
Ex: Apple, Orange, Mango etc are
the objects of the class fruit
Objects take memory and have
addresses
Object-1 (Student)
Object-1 (Student)
Ø
Classes:
A class is a group of objects having similar characteristics. Once a class is
defined, any number of objects of that class are created
Ex 1: man and woman belongs to the same class called Human Being.
Ex 2: planets, sun, moon are members of class solar system.
Ex 1: man and woman belongs to the same class called Human Being.
Ex 2: planets, sun, moon are members of class solar system.
Ø
Data
abstraction: Abstraction is a process of representing essential
features without including background details or explanations.
Ø
Data
encapsulation: data encapsulation combines both data and functions in a
single unit called class. Data encapsulation prevents data from direct access.
The data can be accesses only through functions present inside the class
definition. Data encapsulation enables data hiding or information hiding
Object
Ø
Inheritance:
The concept of inheritance provides the use of reusability. This means that we
can add additional features to the existing class without modifying it. Thus
the process of acquiring properties of one class to another is called
inheritance. The existing class is known as base class and the new class
obtained is called derived class.
The derived class shares some of the properties of the base class. Therefore a code from a base class can be reused by a derived class.
The derived class shares some of the properties of the base class. Therefore a code from a base class can be reused by a derived class.
Ø
Overloading:
There are two types of overloading:
a) Operator overloading: when existing operator operates on new data type is called operator overloading.
b) Function overloading: Two or more functions have same name but different number of arguments or data type of arguments. Function overloading is a process of defining same function name to carry similar types of activities with various data items.
a) Operator overloading: when existing operator operates on new data type is called operator overloading.
b) Function overloading: Two or more functions have same name but different number of arguments or data type of arguments. Function overloading is a process of defining same function name to carry similar types of activities with various data items.
Ø
Polymorphism:
it is a process where a function can take multiple forms based on the type
of arguments, number of arguments and data type of return value
The ability of an operator and function to take multiple forms is known as polymorphism
The ability of an operator and function to take multiple forms is known as polymorphism
Ex: int
addition(int a, int b);
int addition( float a, float b);
Consider the
addition operation. In addition of two numbers the result is the sum of two
numbers.
In addition of two
strings the operation is string concatenation. When an operator behaves
differently based on operands, then it is said that operator is overloaded.
Similarly when same function is used for multiple tasks in the same program by
changing argument type and number, it is known as function overloading
Ø
Dynamic
binding: binding is a process of connecting one program to another.
Dynamic binding is a process of connecting one program to another during
execution (when function is called).
Ø
Message
passing: a message for an object is request for execution of procedure.
Message passing involves specifying the name of object, the name of the
function and the information to be sent
31. Explain
array of objects with programming example.
Ans: An array having class type elements is known as array of objects. An array of objects is declared after class definition and is defined in the same way as any other array.
Ex:
class employee
{
char name[15];
int age;
float salary;
public:
void getdata()
{
cout<<”Enter the name of employee: ”;
cin>>name;
cout<<”Enter the age of an employee: ”;
cin>>age;
cout<<”Enter the salary: ”;
cin>>salary;
}
void putdata()
{
cout<<”Name: ”<<name;
cout<<”Age: ”<<age;
cout<<”Salary: ”<<salary;
}
};
void main()
{
employee emp[3];
for(int i=0;i<3;i++)
{
emp.getdata();
emp.putdata();
getch();
}
Ans: An array having class type elements is known as array of objects. An array of objects is declared after class definition and is defined in the same way as any other array.
Ex:
class employee
{
char name[15];
int age;
float salary;
public:
void getdata()
{
cout<<”Enter the name of employee: ”;
cin>>name;
cout<<”Enter the age of an employee: ”;
cin>>age;
cout<<”Enter the salary: ”;
cin>>salary;
}
void putdata()
{
cout<<”Name: ”<<name;
cout<<”Age: ”<<age;
cout<<”Salary: ”<<salary;
}
};
void main()
{
employee emp[3];
for(int i=0;i<3;i++)
{
emp.getdata();
emp.putdata();
getch();
}
32. Define
inline function. List the reasons for inline function may not work some times.
Ans:
function which is used to replace the function call by function definition is
called inline function.The inline function may not work for some times for one of the following reasons:
- The inline function definition is too long or too complicated.
- The inline function is recursive.
- The inline function has looping constructs.
- The inline function has a switch or goto.
33. Explain
features and disadvantages of default constructor.
Ans: Features
of default constructors are,- Default constructor automatically invokes when object is created
- All objects of the class are to be initialized to same set of values by the default constructor
- If different objects are to be initialized with different values, it cannot be done using default constructor.
Disadvantages of default constructor are,
- When many objects of the same class are created, all objects are initialized to same set of values by default constructor.
- It is not possible to initialize different objects with different initial values using default constructor.
34. Describe
virtual base classes and abstract classes with example.
Ans: consider a situation where the program
design would require one base class call it A and two derived classes namely B
and C, which are inherited from the base class A. further, derived class D is
created from B and C.
When two or more
objects are derived from a common base class, we can prevent multiple copies of
the base class being present in an object derived from those objects by
declaring the base class as virtual when it is being inherited. Such a base
class is known as virtual base class. This can be achieved by preceding the
base class name with the word virtual
Ex: class A
{
__________
__________
};
class B: virtual
public A
{
____________
____________
};
class C: virtual
public A
{
____________
____________
};
class D: public
B, public C
{
____________
____________
};
35. Explain
any five applications of database.
Ans: Following
are the list of database applications- Banking: used in banks for customer, accounts, loans and banking transaction information
- Water meter billing: meter number and all the details of the customer is stored in the database
- Rail and airlines: for reservations and schedule information
- Colleges: used to store students information, course registrations and grades
- Human resources: used to store information about employees, salaries, payroll taxes and benefits etc
36. Describe
any five comparison operators with examples.
Ans: consider a=10 and b=20
Operator
|
Description
|
Example
|
=
|
Checks if the values of two operands are equal or not, if yes then
condition becomes true.
|
(a=b) is not true
|
!=
|
Checks if the values of two operands are equal or not, if values are
not equal then condition becomes true.
|
(a!=b) is true
|
>
|
Checks if the value of left operand is greater than the value of
right operand, if yes then condition becomes true.
|
(a>b) is not true
|
<
|
Checks if the value of left operand is less than the value of right
operand, if yes then condition becomes true.
|
(a<b) is true
|
>=
|
Checks if the value of left operand is greater than or equal to the
value of right operand, if yes then condition becomes true.
|
(a>=b) is not true
|
<=
|
Checks if the value of left operand is less than or equal to the
value of right operand, if yes then condition becomes true.
|
(a<=b) is true
|
37. What
is virus? Explain the types of viruses.
Ans: “computer virus is a malicious program
that disrupts the normal functioning of the computer.”File infectors: these types of viruses either infect executable files or attach themselves to a program file and create duplicate files.
Boot sector viruses: install themselves on the beginning tracks of a hard drive or the Master Boot Record or simply they change the pointer to an active boot sector.
Macro Viruses: infect data files like electronic spread sheets of databases of several software packages.
Network Viruses: these virus use protocols and commands of computer network to spread themselves on the network. Generally they use email or any data transfer files to spread themselves on the network.
2nd puc computer science model 4 question papers and answers
Reviewed by Vision Academy
on
January 17, 2020
Rating:

No comments: