CS - PUC-II - All Chapter'S - Question Bank Final
CS - PUC-II - All Chapter'S - Question Bank Final
LHS=X+XY
= X(1+Y)
=X.1 (1+Y=1)
=X (X.1=X)
=RHS
If X=1, LHS= X.
=1.0
=0
Thus, for every value of X, X.
4. State and prove commutative law. (b) X(YZ)=(XY). Z
These laws state that a) X+Y=Y+X and If Y=0 LHS=X.(Y.Z)=X(0.Z)
b) X.Y=Y.X = X.0=0
a) If X=0 then LHS= X+Y RHS=(X.Y).Z(X.0).Z
=0+Y = 0.Z=0
=Y Therefore LHS-RHS
RHS=Y+X
=Y+0 If Y=1 LHS=X.(Y.Z)X.(1.Z)
=Y = X.Z=XZ
RHS=(X.Y).Z=(X.1).Z
11 | P a g e Dept. of Computer Science| Excellent PU Science College, Vijayapur
=X.Z=XZ complementarity laws.
Therefore LHS=RHS Let us assume that P=X+Y where, P, X, Y are
logical variables.
Then, according to complementation law P+ =1
and P. =0.
Therefore P+ =(X+Y)+
(X+Y)+ Must be equal to 1. (As X+ =1)
6. State and prove Distributive Law. (X+Y). Must be equal to 0(As X =0)
These laws state that (a) X(Y+Z)XY+XZ Let us first prove the first part,(X+Y)+ =1
(b) X+YZ=(X+Y)(X+Z)
(X+Y)+ =((X+Y)+ ).((X+Y)+
(a) X(Y+Z)=XY+XZ
=(X+ +Y). (X+Y+ ) (X+ =1)
If X=0 LHS=X.(Y+Z)
= (1+Y).(X+1) (X+1=1)
=0.(Y+Z)
= 1.1
=0
= 1= RHS
RHS=XY+XZ
Now, let us prove the second part, i.e.,
=0.Y+0.Z
=0 (X+Y). =0
Therefore LHS=RHS (X+Y). = +Y
If X=1 LHS=X.(Y+Z) =0. .0 (X. =0)
= 1.(Y+Z) =0=RHS
= Y+Z Therefore =
RHS=XY+XZ
= 1.Y+1.Z
=Y+Z
Therefore LHS=RHS
Quad-1= m0 m4 m8 m12 CD
Quad-2= m8 m9 m10 m11 AB
Quad-3= m9 m11 m13 m15 AD
Reduced expression= + A +AD
11. Given the Boolean function F(W, X, Y, Z)=
Pair-1=m7+m15=BCD
∑
Quad-1=m12+m13+m14+m15=AB
Reduce it by using K-map.
Quad-2=m13+m15+m9+m11=AD
Quad-3=m15+m11+m14+m10=AC
Reduced expression=BCD+AB+AD+AC.
9. Given the Boolean function F(A, B, C, D) =
∑ Reduce it by using
Karnaugh map.
Quad-1= m0 m1 m2 m3 W X
Map rolling octet=
m0 m2 m4 m6 m8 m10 m12 m14 Z
Reduced expression=
12. Given Boolean function
Pair-1= m0 m1 ABC
F(A, B, C, D)= m0+m1+m2+m3+m4+m5+m8
Pair-2= m14 m10 ACD +m9+m10+m11+m13 Reduce the function F
using K-map.
13 | P a g e Dept. of Computer Science| Excellent PU Science College, Vijayapur
Quad-1= m0 m1 m4 m5 AC Chapter 3.
Quad-2= m1 m5 m9 m13 CD
LOGIC GATES
[1m X 1 & 3m X 1= 4marks]
Map rolling octet=
1 Mark questions:
m0 m1 m2 m3 m8 m9 m10 m11 B 1. What is a logic gate?
Reduced expression= + D+ A: An electronic circuit which operates on one or more
13. Using maps, simplify the following expression signals and always produces an output signal is
called logic gate.
in four variables A, B, C and
2. Mention different types of logic gates.
D: m0+m4+m7+m8+m9+m10+m11+m12+m13
*Basic gates.
*Derived gates.
3. Mention the three basic logic gates?
*NOT gate
* OR gate
*AND gate
4. Which basic gate is named as Inverter?
NOT gate.
5. What is inverter?
A: A gate with only one input signal and one output
signal but the output state is always opposite of the
input state is called inverter or NOT gate.
6. Which are the three logic operations?
Quad-1= m0 m4 m8 m12 CD *NOT operation
Quad-2= m8 m9 m10 m11 AB * OR operation
* AND operation
Quad-3= m8 m9 m12 m13 AC 7. Write the standard symbol for AND gate. (Write
Single term= = BCD the logic circuit for AND gate.)
Reduced expression= + A +A + BCD
14. Given the Boolean function F(A, B, C, D)=
(0, 4, 6, 8, 9, 10, 12, 14). Reduce it by using 8. Write the standard symbol for OR gate. (Write the
K-map. logic circuit for OR gate.)
15. Write the truth table for OR gate. 25. What are the values of the inputs to a three input
NAND gate, if its output is
Truth table for AND gate: 6. Define universal gate. Write the truth table and
standard symbol of NOR gate.
A gate using which all the basic gates can be designed
is called universal gates.
The logic symbol for NOR gate:
NAND to OR gate:
Truth table for XNOR gate:
A B Y=
0 0 1
0 1 0 NOR to NOT gate:
1 0 0
1 1 1
9. Define universal gate. Design basic gates using
NAND gate. A gate using which all the basic gates 12. Draw the logic gate diagram to implement NOT
can be designed is called universal gates. using
AND gate: (a) only NOR gates (b) only NAND gates.
(a) NOT gate using only NOR
OR gate:
NOT gate:
13. Design a circuit to realize the following:
F(A, B, C)= AB+A C
10. Draw the logic gate diagram to implement AND,
OR and NOT gates using NAND gates only
(Realize AND OR and NOT gates using NAND
gate.)
NAND to AND gate:
NAND to OR gate:
14. Draw the diagram of a digital circuit for:
F(A, B,C,D)= AB+BC+CD using NAND-to-NAND
logic.
Object:
24 | P a g e Dept. of Computer Science| Excellent PU Science College, Vijayapur
An object is a collection of data members & There are 2 types of overloading
associated member functions as a single unit.
Each object is real world entity.
Objects are basic building blocks designing Operator overloading: When an existing operator
programs. operates on new data type is called operator
Each object is identified by a unique name. overloading.
Each object must be member of a class. Function overloading: When two or functions
Ex: having same name but differ in the number of
arguments or data type.
9. Mention different types of overloading.
A: Refer answer to Q. No 8
10. Mention any two advantages of object oriented
programming (OOP) over earlier programming
methods.
A: Advantages of OOPs:
4. Explain data encapsulation. 1) The programs are modularized based on the
A way of combining data & associated functions principle of class & objects.
into a single unit is called data encapsulation. 2) Linking code & objects allows related objects to
Data encapsulation will provides the direct access share common code. This reduce the code
to data. duplication & code reusability.
The data can be accessed only through function 3) Easier to develop complex software.
which is present inside the class. 11. Write the disadvantages of object oriented
The data cannot be modified by an external non- programming (OOP).
member function of a class. A: Disadvantages of OOPs:
Data encapsulation enables data hiding or 1. OOP software is not having set standards.
information hiding. 2. The classes are overly generalized.
5. Explain inheritance. 3. To convert a real world problem into an object
The process of forming a new class from an oriented model is difficult.
existing class is called inheritance. 12. Mention any four high level languages that
The existing class is known as base class. The follows object oriented programming (OOP).
new class is known as derived class. A: 1) C++ 2) Java 3) C# 4) Python
The derived class shares some of the properties 5) small talk.
of the base class.
The objects of one class acquire the properties of 5 Marks Questions
another class through inheritance. 1. Write a difference between procedural oriented
In OOP, the concept of inheritance provides the Programming (POP) & object oriented
idea of reusability. programming (OOP).
Types of inheritance:
Single inheritance
Multiple inheritance
Multilevel inheritance
Hierarchical inheritance
Hybrid inheritance
6. Mention different types of inheritance.
A: Refer answer to Q. No 5
7. Write a note on polymorphism.
A: Ability of a function to take multiple forms is called
polymorphism. Polymorphism is a feature of OOP
where a function can take multiple forms based on
the type of arguments, number of arguments & data
type of return value.
8. Write a note on overloading.
Overloading: Overloading allows objects to have
different meaning depending upon context.
25 | P a g e Dept. of Computer Science| Excellent PU Science College, Vijayapur
2.Explain the different characteristics of OOP. associated with a procedure call is known at the time
A: Characteristics of OOPs: of program execution routine.
a) Objects: An object is a collection of data i) Message passing: The processing of data in OOP
members & associated member functions as a single is carried out by sending messages to an object is
unit. Each object is real world entity. Objects are called message passing. A message for an object is
basic building blocks designing programs. Each request for execution of procedure.
object is identified by a unique name. Each object 3. Explain the advantages of object oriented
must be member of a class. programming (OOP).
b) Classes: A class is a way grouping objects A: Advantages of OOPs:
having similar characteristics. Once class is defined The programs are modularized based on the
then any numbers of objects of that class are created. principle of class & objects.
Classes are user defined data types. A class can hold Linking code & objects allows related objects to
both data & functions. share common code. This reduce the code
c) Data abstraction: The representation of essential duplication & code reusability.
features of an object without including background Easier to develop complex software.
details is called as data abstraction. Data abstraction Creation & implementation of OOP code is easy
permits the user to an object without knowing its & reduces software development time.
internal working. Classes use the concept of The concept of data abstraction separates object
abstraction. specification & object implementation.
d) Data encapsulation: A way of combining data & External non-member function cannot access or
associated functions into a single unit is called data modify the data due to data encapsulation.
encapsulation. Data encapsulation will provides the 4. Write the real life applications of object oriented
direct access to data. The data can be accessed only programming (OOP).
through function which is present inside the class.
A: Applications of OOPs:
The data cannot be modified by an external non-
member function of a class. Data encapsulation Computer graphic applications.
enables data hiding or information hiding. CAD/CAM software.
e) Inheritance: The process of forming a new class Object oriented database.
from an existing class is called inheritance. The new User interface design such as windows.
class is known as base class. The new class is known Real time systems.
as derived class. The derived class shares some of the Simulation & modelling.
properties of the base class. The objects of one class Artificial intelligence & experts systems.
acquire the properties of another class through
inheritance. In OOP ,the concept of inheritance
provides the idea of reusability.
f) Polymorphism: Ability of a function to take
multiple forms is called polymorphism.
Polymorphism is a feature of OOP where a function
can take multiple forms based on the type of
arguments, number of arguments & data type of
return value. Function such as abs( ), fabs( )are
compute & return the absolute value of an integer &
floating value.
g) Overloading: Overloading allows objects to have
different meaning depending upon context.
There are 2 types of overloading
Operator overloading
Function overloading
Operator overloading: When an existing operator
operates on new data type is called operator
overloading.
Function overloading: When two or functions
having same name but differ in the number of
arguments or data type.
h) Dynamic binding: The process of connecting one
program to another. Dynamic binding means code
26 | P a g e Dept. of Computer Science| Excellent PU Science College, Vijayapur
Chapter 7. };
CLASSES AND OBJECTS 14. Write the syntax of class declaration.(Write the
syntax to declare an object of a class.)
[1m X 1 & 5m X 1 = 6Marks] A: class user_defined_name
1 Mark Questions {
1. What is a Class? private: Member data, Member functions
A: A way of grouping objects having similar protected: Member data, Member functions
characteristics is called class. public: Member data, Member functions
2. What is an object? };
A: An object is an instance of a class or it represents class_name obeject_name1,object_name2,….;
data & associated functions as a single unit. 15. Is it possible to access data outside a class?
3. What is class instances called as? A: Yes. It is possible to access public data members.
A: An object is an instance of a class. 16. Which type data members are accessible outside a
4. What are the two types of members referenced in class?
a class? A: Public data members are accessible outside a class.
A: Data members 17. Which access specifier is implicitly used in a
Member Functions class?
5. What are data members? A: Private
A: Members which describe the characteristics of a class 18. Which is a default access specifier for members of
or variables declared inside a class are called data a class in C++?
members. A: Private.
6. What is a member function? 19. Define the term public access.
A: Functions which describe the operations that can be A: The data members can be accessed by any function
performed with the data members of the class or outside the class also is called public access.
functions declared inside a class called member 20. What are the different ways of declaring member
functions. functions?
7. Write the differences between class definition and A: Inside a class
class declaration. Outside a class
A: A class definition is a process of naming a class and 21. Mention the operator used to access members of a
data variables, and interface operations of the class. class.
A class declaration specifies the representation of A: Direct member access operator or dot(.) operator is
objects of the class and set of operations that can be used to access members of a class.
applied to such objects. 22. How are member functions of a class defined
8. What does the class definition specify? outside the class declaration?
A: A class definition specifies the naming a class and A: Member functions of a class defined outside the class
data variables, and interface operations of the class. declaration by using scope resolution operator(::).
9. What does the class declaration specify? 23. What is the significance of scope resolution
A: A class declaration specifies the representation of operator (::)?
objects of the class and set of operations that can be A: Scope resolution operator is used when member
applied to such objects. functions are declared outside a class definition.
10. Is memory space allocated for class? 24. Write the syntax for accessing class member.
A: No. A: The syntax for accessing class member is:
11. What is the significance of using access object. Data _member;
specifies?(Why are access specifies used?) object. member_ function(arguments);
A: Access specifiers help in controlling the access of 25. How are objects of a class declared? Give an
data members. They define the scope of data. example.
12. Mention the access specifiers used with a class. A: An object can be declared as:
A: Private, Public and Protected. classname objectname1,objectname2,….;
13. Write the syntax of class definition. Ex: rectangle r;
A: class user_defined_name 26. What is meant by array of objects?
{ A: An array having class type element is called as an
private: Member data Member functions array of objects.
protected: Member data 27. Can an array of objects be created?
Member functions A: Yes.
private: Member data 28. Can object be passed to function as arguments?
Member functions A: Yes.
27 | P a g e Dept. of Computer Science| Excellent PU Science College, Vijayapur
29. What are the ways of passing an object as an void getdata( )
argument to functions? {
A: Copy of entire object is passed to function(pass cout<<”Enter the values of a&b”<<endl;
cin>>a>>b; void main( )
by value).
}
Only address of the object is transferred to the void compute( )
function(pass by reference). {
30. Can functions return objects? c=a+b;
A: Yes. }
31. What is accessor? void display( )
A: A member function of a class that only accesses but {
does not modify the values of data member. cout<<”Sum=”<<c;
32. What is mutator? }
A: A member functions of classes that modify the values };
of data member. void main( )
33. Write an example to show how objects can be {
used as function arguments. Sum s;
A: rectangle r1,r2,r3; s.getdata();
r1.getdata (r2,r3); s.compute();
34. Compare structure and class. s.display();
A: The keyword strict is used to define the structure. getch();
By default its member is public. }
The keyword class is used to define the class. By 2. Explain the different types of access specifiers in a
default its member is private. class.
5 Marks Questions A: Access specifier define the scope of data member &
1. Explain the class definition and declaration with member functions.
syntax and example. There are 3 types in access specifiers:
A: Defining a class: A class definition is a process of A) Private:
naming a class, data variables& interface operation i) private access specifier is used to access data
of the class. members only by the member function.
Syntax of class definition: ii) Members declared under private are accessible
class user_defined_name only within the class.
{ iii) Private access specifier is default access specifier.
private: Member data; Ex: private: int a,b,c;
Member functions; B) Public:
protected: Member data; i) public access specifier is used to access data
Member functions; members by the any function inside or outside the
public: Member data; class.
Member functions; Ex: private: int a,b,c;
}; public: void getdata( );
i) Keyword class is used to define a class. void compute( );
ii) Class body is enclosed in a pair of flower brackets. void display( );
iii) Class body contains the declaration of data C) Protected:
members & member functions. i) The members which are declared as protected can
Declaring a class: be accessed only by the member functions, friend
A class declaration specifies the representation of functions of the class & member functions derived
objects of the class & set of operations. from this class.
Syntax: ii) The members cannot be accessed outside of the
class_name obeject_name1,object_name2,….; class.
Ex: Ex: protected: int a,b,c;
#include<iostream.h> 3. What are the characteristics of member functions
#include<conio.h> outside a class?
class sum A: Characteristics of the member functions:
{ 1) Data type & arguments in member function must
private: int a,b,c; be same as data type & arguments declared in class
public: definition.
3 Marks Questions
1. Mention the applications of database.
A: Applications of database. :
1) Banking: Used to store customer information,
accounts, loans & banking transactions.
2) Colleges: Used to store student information,
course registration & grades. Water meter billing:
Used to store the RR number & all details. It is
18. What is join operation? connected to the server based works.
A: Join operation: 3) Rail & airlines: Used to store reservations &
JOIN is used to combine related tuples from two schedule information.
relations. 4) Finance: Used to store information about holdings
In its simplest form the JOIN operator is just the & sales.
cross product of two relations. 5) Sales: Used to store customer, product & purchase
As the JOIN becomes more complex then tuples information.
are removed within the cross product to make the 6) Human resources: Used to store information
result of the JOIN more meaningful. about employees, salary, payroll taxes & generation
JOIN allows to evaluate a join condition between of pay checks.
the attributes of the relations on which the join is 7) Manufacturing: Used to store information of
undertaken supply chain & tracking production of items in
The notation of JOIN is: R JOIN join condition S factories, inventories of items.
19. What is data warehouse? 8) Credit & transactions: Used to store information
A: Data warehouse: of purchases on credit cards & generating monthly
A repository of an organization‟s electronically statements.
stored data is called data warehouse. 9) Telecommunication: Used to store records of
Data ware house are designed to facilitate calls made, generating monthly bills & information
reporting & supporting data analysis. about the communication networks.
Fundamental stages of data ware house: 2. Explain any three advantages of database
Offline operational database management system.
Offline data warehouse A: Advantages of database management system:
Real time data warehouse a) Controlled data redundancy: During data base
20. List the components of data warehouse. design various files are integrated & each logical data
Components of data warehouse item is stored at central location. This reduces the
Data sources data replication or duplication of data item in
Data transformation different files & saves the storage space.
Reporting b) Enforcing data integrity: In database approach
Metadata enforcing data integrity is much easier. Data integrity
Operations. refers to the validity of data & it can be compromised
21. What are the advantages of data warehouse? in a number of ways. Data integrity can be enforced
A: Advantages of data warehouse: automatically by the DBMS.
It increases data consistency. c) Data sharing: The data stored in the database can
It increases productivity & decreases computing be shared by multiple users or application programs.
costs. Due to shared data it is possible to satisfy the data
Able to combine data from different sources.
55 | P a g e Dept. of Computer Science| Excellent PU Science College, Vijayapur
requirements of the new applications without having
to create any additional data.
3. Give the difference between manual & electronic
file systems. Attributes:
Attributes which specifies properties or
characteristics of entities. The eclipse symbol is used
to represent the attribute in the ER diagram.
Relationship:
Relationship describes relations between entities.
4. Explain Boyce and Codd normal form (BCNF). Relationship is represented using diamonds.
A: Boyce and Codd normal form:
BCNF is a higher version of the third normal
form (3NF).A 3NF table which does not have
multiple overlapping candidate keys is said to be
in BCNF.
When a relation has more than one candidate key
then anomalies may result even though the
relation is in 3NF.
3NF does not deal with the case of a relation with 6. Give the different notations for E-R diagram.
overlapping candidate keys.
BCNF is based on the concept of a determinant.
A determinant is any attribute on which some
other attribute is fully functionally dependent.
A relation is in BCNF then every determinant is a
candidate key.
o Ex:
R(a,b,c,d)
A,cb,d
A,db
Here the first determinant suggests that the
primary key of R could be changed from a,b to
a,c.
5. Explain any three components of E-R diagram.
Entity
A: Entity:
Entity is a real world object or concept about which
data is stored. The symbol use to represent the entity
in the ER diagram is rectangle.
Weak Entity:
Weak entity is an entity that depends on another
entity. Weak entity doesn’t have key attribute of their There are three types of relationship that exist
own. Double rectangle represents weak entity. between Entities.
Many to Many :