II PU Computer Science.
Prof. K. Adisesha Page 1
II PUC COMPUTER SCIENCE VIVA-VOCE QUESTIONS
Data structure
1. What is data structure ?
Ans. Data structures are a specialized format for organizing and storing data in memory such that
CPU can perform operation on these data in an effective way.
2. What is an array.
Ans:- An Array is a order collection of Homogeneous element.
3. How are arrays classified?
Classification: There are 3 types of arrays.
 One-dimensional Array
 Two-dimensional Array
 Multi-dimensional Array
4. What is meant be primitive data structure ? Give one example .
Ans. Data structures that are directly operated upon by machine-level instructions are known as
primitive data structures
Ex:- The integers, real (float) ,logical data etc …..
5. What are non-primitive data structures?
Ans. The Data structures that are derived from the primitive data structures are called Non-primitive
data structure.
6. Mention any two examples for non- primitive data structures?
Ans. Array, stack, queues, linked list, tree and graph are non- primitive data structures
7. What is meant by non-linear data structure ?
Ans. A data structure in which a data item is connected to several other data items. It has the
possibility to reach one or more data items. The data items are not arranged in a sequential
structure .
Ex :- Trees, graphs
8. What do you mean by traversal in data structure ?
II PU Computer Science.
Prof. K. Adisesha Page 2
A) The process of accessing each data item exactly once to perform some operations into a data
structure is called “traversal in data structure “ .
9. Mention the types of searching in the Array ?
Ans: i) Linear search ii) Binary search
10.What is meant by sorting in an array ?
Ans. Sorting is the arrangement of elements of the array in some order like bubble sort, selection
sort, quick sort ,heap sort, shell sort e.t.c…..
11.Name any one non-linear data structure ?
Ans:Trees ,graphs
12.What is a stack?
Ans. A stack is an ordered collection of items in which an element may be inserted or deleted only at
same end.
13. Name the data structure which is called LIFO.
Ans. A LIFO (Last In First Out) data structure is also called as stack.
14. What are the operations that can be performed on stacks?
Ans. Stack( ), push(item), pop( ), peek( ), isEmpty( ), size( ) are the operations of stack.
15. Define the term PUSH and POP operation in stack.
Ans. .The process of adding one element or item to the stack is represented by an operation called as
the PUSH operation.
 The process of deleting one element or item from the stack is represented by an operation called as
the POP operation.
16. Mention any one application of stacks.
Ans. It is used to reverse a word.
 “Undo” mechanism in text editor.
 Polish Notation
17.What is queue? Mention different operation performed on queue?
Ans: A queue is an order collection of items where an item is inserted at one end called the
“rear” and existing item is at the other end called the “front”.
The Queue operation
 Queue( ): creates a new queue that is empty
II PU Computer Science.
Prof. K. Adisesha Page 3
 Enqueue( ): Adds a new item to the “rear” of the queue
 Dequeue( ): Deletes or removes the “front” item from the queue
 Isempty( ): Tests to see whether the queue is empty
 Size ( ) : returns the number of items in the queue.
18.Explain any five basic operations performed on arrays ?
Ans. In An arrays performed five basic operations are
1. Traversing ,2. Searching, 3. Sorting , 4. Insertion, 5.Deletion , 6. Merging
 Traversing : Accessing each element of the array exactly once to do some operations
 Searching : Finding the location of an element in the array
 Sorting : Arranging the elements of the array in some order
 Insertion : Inserting an element into the array
 Deletion : Removing an element from the array
 Merging : Combining one or more arrays to form a single array
19. What is a linked list?
Ans. A linked list is a linear collection of data elements called nodes.
20. Which data structure creates relationship between data elements through links?
Ans. Linked List creates relationship between data elements through links.
21. What is binary tree?
Ans. A binary tree is an ordered tree in which each internal node can have maximum of two child
nodes connected to it.
22. What do you mean by depth of a tree?
Ans. The height or depth of a tree is defined to be the maximum number of nodes in a branch of tree.
23. How do you find the degree of tree?
II PU Computer Science.
Prof. K. Adisesha Page 4
Ans. The degree of tree is the maximum degree of nodes in the tree. The degree of node is the
maximum number of children that can exist for a node.
24.What are primitive data structures? Explain the operations performed on primitive data
structures:
Ans:-Data structures that are directly operated upon by machine –level instructions are known as
primitive data structures.
Different operations:
 Create : Create operation is used to create a new data structure.
 Destroy : Destroy operation is used to destroy or remove the data structures from the
memory space.
 Select : Select operation is used by programmers to access the data within data structure.
 Update : Update operation is used to change data of data structures.
II PU Computer Science.
Prof. K. Adisesha Page 5
CHAPTER 6:- OOPS CONCEPTS
1. What is polymorphism?
Ans:- Polymorphism: It is ability of a function to have same name and multiple forms.
2. What is the fundamental idea of OOP? Mention any two Object Oriented Programming
languages.
Ans :- Object Oriented Programming is a programming paradigm that uses “objects” to design
applications and computer programs.
Example :- C++, Java, .Net, Objective C
3. Mention any two advantages of object oriented programming over earlier programming
methods.
Ans:- The programs are modularized based on the principle of classes and objects.
Creation and implementation of OOP code is easy and reduces software development time.
4. Mention different types of inheritance
Ans:-Single Inheritance, Multilevel Inheritance, Multiple Inheritance, Hierarchical Inheritance,
Hybrid Inheritance.
5. Explain data abstraction.
Ans:- Abstraction refers to the representation of essential features of an object as a program object.
An abstract class defines an interface, but does not provide implementation details.
6. List different characteristics of OOPS:
Ans:- Object, Class, Abstraction, Encapsulation, Inheritance, Polymorphism, Message passing
7. Write any two applications of OOPS:
Ans: Computer Graphic Applications, CAD/CAM software, Object-Oriented Database, Real-time
Systems
II PU Computer Science.
Prof. K. Adisesha Page 6
8. Explain characteristics of OOPs
Ans:-
o Object: Object represents data and associated functions as a single unit.
o Class: A class is a way of grouping objects having similar characteristics.
o Abstraction: Abstraction refers to the representation of essential features of an object as
a program object. An abstract class defines an interface, but does not provide
implementation details.
o Encapsulation: It is a way of combining data and associated functions into a single unit.
 Encapsulation implements abstraction.
o Inheritance: Acquisition of properties of one class by another class is called Inheritance.
o Polymorphism: It is ability of a function to have same name and multiple forms.
o Message Passing: The processing of data in object oriented programming is carried out
by sending messages to objects.
II PU Computer Science.
Prof. K. Adisesha Page 7
CHAPTER -7:-CLASSES AND OBJECTS
1. Define a Class.
Ans:- A class is a collection of objects that have identical properties, common behavior and shared
Relationship under a single name.
2. Is it possible to access data outside a class?
Ans. Yes, public data members can be accessed outside a class.
3. Mention the operator used to access members of a class.
Ans: Class member can be accessed by using dot (.) operator
4. What is significance of scope resolution operator (: : ) ?
Ans: scope resolution operator identifies the function as an member of particular class.
5. Write the syntax to declare objects of a class?
Ans Class _ name object _ name;
6. What is an object?
Ans: Real word entity with attribute and function
7. Mention the access specifiers used with a class.
Ans. Different access specifiers such as private, public, and protected.
8. Which type of data members are accessible outside the class?
Ans:-Public and protected..
9. What is the significance of scope resolution operator(::)?
Ans. Scope resolution operator is used to define the method of side of the class.
10.Write the syntax to declare objects of a class?
Ans.Object of a class are declared in the same manner like any other variable declaration.
Ex-: class student
{ //data members
}; Student obj1,iobj2;//obj1,obj2 are objects of class student
II PU Computer Science.
Prof. K. Adisesha Page 8
11.What is an object?
Ans:-An object is an instance of a class or physical entity.
12.Mention the operator used to access members of a class?
Ans.:-Class members are used to access by dot(.) operator.
13.Which type of data members are accessible outside of a class?
Ans:-Public members can be accessed outside a class.
14.Define a class?
Ans.:-A class is a collection of related data and relevant functions.
15.What is a member data?
Ans.:-Data members are different data variables similar to structure members.
16.What is a member function?
Ans:-Member function also known as method acts on data members in the class.
17.Is it possible to access the data outside of the class?
Ans.:-No, we can not access the data outside of the class.
18.What is meant by an array of objects?
Ans:-An array having class type array elements is known as an array of objects.
19.Which access specifier is implicitly used in a class?
Ans. Private access specifier is implicitly used in a class.
20.How are the objects of a class declared? Give an example.
Ans:-Object of a class are declared in the same manner like any other variable declaration.
II PU Computer Science.
Prof. K. Adisesha Page 9
EX-:-
Class student
{
private:
int Reg;
char Sname:
public:
void getdata();
void displaydata();
};
Student obj1,iobj2;//obj1,obj2 are objects of class student
19.What is the significance of scope resolution operator(::)?
Ans. Scope resolution operator is used to define the method of side of the class.
20.Give the general syntax for defining classes and objects? Ans. Syntax for class declaration
class class_name
{
//Class doby
};
Syntax for object declaration
Class_name object_name;
21.Explain member functions
a) Inside class function
b) Outside class function
II PU Computer Science.
Prof. K. Adisesha Page 10
CHAPTER 8:-FUNCTION OVERLOADING
1. Explain inline function with syntax and example.
Ans:- The inline function short function compiler replaces the function call statement with the
function code itself.
Syntax with example:
Inline int square (int a)
{
Return (a*a);
}
Advantages of inline functions
1. The inline member functions are compact functions calls.
2. Therefore the size of the object code is considerably reduced.
3. The speed of execution of a program increase
4. Very efficient code can be generated
5. The readability of the program increases
Disadvantages
As the body of inline function is substituted in place of a function call the size of the executable
file increase and more memory is needed.
2. Explain friend function and their characteristics:
Ans A friend function is a non member function that is a friend of a class. The friend function is
declared within a class with the prefix friend. But is should be defined outside the class like a
normal function without the prefix friend. It can access public data members like non-member
friend function.
Syntax:
Class class _ name
{
Public;
II PU Computer Science.
Prof. K. Adisesha Page 11
Friend voids function (void);
};
Characteristics:
1. A friend function although not a member function, has full access right to the private and
protected members of the class.
2. A friend function cannot be called using the object of that class. If can be invoked like any
normal function.
3. A friend function is declared by the class that is granting access.
4. They are normal external functions that are given special access privileges
5. The function is declared with keyword friend. But while defining friend function it does not
either keyword friend or :: operator.
II PU Computer Science.
Prof. K. Adisesha Page 12
CHAPTER 8:-Pointers
1. What do you mean by pointer?
Ans:- A pointer is a variable that holds a memory address of another variable.
2. Mention any two advantage of pointer:
Ans Pointers save memory space.
Dynamically allocate and de-allocate memory
3. What is address operator?
Ans. The ‘&’ is the address operator and it represents address of the variable.
4. What is pointer operator?
Ans. The ‘*’ is a pointer operator, which is also called indirection operator or dereference
operator.
5. How to declare pointer?
Ans. The general syntax of pointer declaration is given below.
Syntax: Data_Type *Ptr_Variablename;
Example: int *iptr;
6. How to initialize pointer?
Ans. By using the & operator as follows:
int *X, Y=10;
X = &Y;
7. What is static memory?
Ans. Static memory allocation refers to the process of allocating memory during the compilation
of the program i.e. before the program is executed.
8. What is dynamic memory?
Ans. Dynamic memory allocation refers to the process of allocating memory during the execution
of the program or at run time.
9. What is free store?
Ans. Free store is a pool of memory available to allocated and de-allocated storage for the objects
during the execution of the memory.
10. What is new operator in C++?
Ans. The new operator is used to create a heap memory space for variables.
II PU Computer Science.
Prof. K. Adisesha Page 13
CHAPTER- 9:- CONSTRUCTORS AND DESTRUCTORS
1. What is destructor? Which operator is used with destructor?
Ans:-Destructor is special member function that will be executed automatically when an object is
destroyed is the operator which is used for destructor.
2. Write syntax and example for copy constructor
Ans:-
The syntax for copy constructor is
Class name :: (class_name &ptr)
Example:
x::x(x &ptr) Where x is the class name.
3. Write the syntax and example for default constructor Ans:-syntax:
Class name:: class_name( )
{
} // constructor without argunents
Example:
student ( )
{------------------ }
4. What is a constructor? Give an example
Ans: It is a special member function that is used in classes to initialize the object of the class
automatically. The constructor is a member function of a class with the same name as that of the
class. The constructor is invoked when we create the object of the class.
5. Mention the features of parameterized constructors.
Ans:- i) Parameterized constructors can be overloaded
ii) Parameterized constructor can have default arguments and default vales
6. List the different types of Constructors.
Ans:-a. Default constructor
II PU Computer Science.
Prof. K. Adisesha Page 14
b. Parameterized constructor
c. Copy Constructor
7. Which are the different methods through which constructors are invoked?
Ans:- a)Explicit call b)Implicit call c)initializing at the time of declaration with = operator
8. Mention three types of constructors.
As. Three types of constructors are there
1) Default constructor
2) Parameterized constructor
3) Copy constructor
9. What is default constructor ? and write the drawback of default constructor.
Ans:-A constructor which does not accept any arguments is called default constructor.
The main drawback of default constructor when many objects for the classes are created all objects
are initialized to same set of values by default constructor.
10.What is a copy constructor? Give an example
Ans:- Copy constructor is a parameterized constructor using which one object can be copied to
another object.
11.What are constructor and destructor? Write the rules for writing a constructor function
Ans:-constructor: A constructor is a special member function that is used in classes to initialize
objects of class automatically.
Destructor: Destructors are member functions that destroy an object automatically.
Rules for constructor:
II PU Computer Science.
Prof. K. Adisesha Page 15
 A constructor always have name, that is the same a the class name of which they are
members. There is no return type for constructors (not even void).
 Constructors should be declared in public section.
 A constructor is invoked automatically when objects are created. Constructor can have
default arguments.
 It is not possible to refer to the address of the constructors.
II PU Computer Science.
Prof. K. Adisesha Page 16
CHAPTER -10:- INHERITANCE
1. What is Virtual base class?
Ans: When two or more objects are derived from a common base class, we can prevent multiple copies of the
base class 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 word Virtual.
2. What are the advantages of inheritance?
Ans:-Advantages of inheritance
 Reusing existing code
 Easy to maintain
 Easy to extend
 Memory utilization
 Faster development time
3. What is inheritance? Explain the types of inheritance?
Or
Explain briefly the types of inheritance.
Ans: Inheritance is the capability of one class to inherit the properties from another class.
Types of inheritance:
1. Single inheritance
2. Multilevel inheritance
3. Multiple inheritance
4. Hierarchical inheritance
5. Hybrid inheritance
1) Single inheritance:
If a class derived from a single base class, it is called as single inheritance.
II PU Computer Science.
Prof. K. Adisesha Page 17
2) Multilevel inheritance: The classes can also be derived from the classes that are already derived, it is
called as multilevel inheritance.
3) Multiple inheritance:
It is the inheritance hierarchy where in one derived class inherits from multiple base classes.
4) Hierarchical inheritance:
It is the inheritance hierarchy where in multiple subclasses inherits from one base class.
II PU Computer Science.
Prof. K. Adisesha Page 18
5) Hybrid inheritance: The inheritance hierarchy that reflects any legal combination of other four pes of
inheritance.
4. What is virtual base class? Give example
Ans: To avoid the multiple copies of base class object, virtually can be inherited from base class by
using a keyword “virtual”.
5. What is visibility mode? What is its role?
Or
What is the difference between public, private and protected access specifier?
Ans: The visibility mode basically controls the access specifies to be used for inheritable member of base class
in the derived class.
II PU Computer Science.
Prof. K. Adisesha Page 19
CHAPTER -11:- POINTERS
ONE MARK QUESTIONS
1. How do you declare a pointer?
Ans:- data type *variable name;
Eg: int * ptr;
2. Write the difference between the statements i) X=&Y ; ii) X=*Y; Ans:-(i) X = & Y; the address of
variable Y is assigned to pointer variable X.
(ii) X = *Y; the value of variable Y is assigned to X.
3. What is free store?
Ans:-It is a pool of unallocated memory heap given to a program that is used by the program for dynamic
allocation during execution
4. Mention any one advantage of pointers.
 It is possible to write efficient programs
 Memory utilized properly etc'
5. Define a Pointer.
Ans:-Pointer is a variable which holds a memory address.
6. what are address operator and pointer operator?
Ans. The symbol ‘&’ (ampersand ) is a address operator.
The symbol ‘*’ (asterick) is a pointer operator.
7. . what are new and delete operators in c++?
Ans. The new operator in c++ , allocate memory dynamically.
The delete operator in c++, releases dynamically allocated memory.
8. How to initialize pointer?
Ans. Ex: int *ptr;
int a=10;
ptr= &a;
II PU Computer Science.
Prof. K. Adisesha Page 20
9. What is dynamic allocation of memory?
Ans:-Memory is allocated during the execution of the program. Dynamic allocation and deallocation of
objects is done using new and delete operators. The new operator allocate memory for objects form pool
called the free store. Delete aperator is used to delete dynamic memory
10. Explain the use of new operator in c++ with syntax and example.
Ans:-Dynamic allocation of space in a C++ program can be done with the help of new and delete operators.
11. How dynamic memory allocation is different from static memory allocation?
Ans:- Static allocation of memory Dynamic allocation of memory
Memory is allocated during compilation Memory is allocated during the execution
No memory allocation or de-allocation
actions are performed during execution.
Memory bindings are established and
destroyed during the execution
Variable remain permanently allocated Allocated only when program unit is active
Implemented using stocks and heaps Implemented using data segments
12. What are the advantages of pointers?
Ans: a. It is possible to write efficient programs
b. Memory is utilized properly
c. Dynamically allocate & de-allocate memory.
d. Establishes communication between program and data.
II PU Computer Science.
Prof. K. Adisesha Page 21
SQL Commands
a Define Database.
Ans:- Database is a collection of logically related data.
b What is Data model?
Ans:- Data model is an abstract model that describes how data is stored, represented and used.
c What is DDL ?
Ans:- Data Definition Language
d What is DML?
Ans:-Data Manipulation Language.
e What is DCL ?
Ans:-Data Control Language.
f What is DQL ?
Ans:-Data Query Language
g Write the syntax and example for delete command in SQL:
Ans: syntax:
delete from table_name [where condition];
Example:
h delete from employees where id=3;
i What is the use of NULL value? Give example.
A:SQL NULL is the term used to represent a missing value.
Ex: Select * from employees where salary is null;
j What is a dual table?
Ans: Dual table is a single row single column dummy table provided by oracle.
select 423*123 from dual;
k Classify various SQL operators. Ans: SQL operators are classified as a) Arithmetic operators
i Comparison operators
ii Logical operators
II PU Computer Science.
Prof. K. Adisesha Page 22
iii Operators used to negate conditions
l Write the classification of SQL commands:
Ans: a) Data Definition Language(DDL)
i Data Manipulation Language(DML)
ii Data Control Language(DCL)
iii Data Query Language(DQL)
II PU Computer Science.
Prof. K. Adisesha Page 23
Web designing
1. What is DHTML?
Ans:-Dynamic HTML is a collective term for a combination of Hypertext Markup Language tags and
options that can make web pages more animated and interactive than previous versions of HTML.
2. Mention the use of HTML
Ans:-HTML is used to make websites.
3. What is web scripting?
Ans:-The process of creating and embedding scripts in a web page is known as web scripting.
4. What do you mean by Domain?
Ans:-Domain names are used in URLs to identify particular Web pages.
For example, in the URL http://www.google.com
5. What do you mean by hosting?
Ans:-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.
6. Expand ARPANET?
Ans:-Advanced Research Project s Agency Network.
7. Give the features/ merits of DHTML.
a) An object oriented view of a web page and its elements
b) Cascading style sheets and the layering content
c) programming that can address all or most page elements
d) Dynamic fonts
8. What is the use of PHP files?
a)Password protection
b) Form processing
c) Browser customization
d) Dynamically editing or adding content to web page
e) Building and displaying pages created from a database.
II PU Computer Science.
Prof. K. Adisesha Page 24
9. Explain Hosting of a Website.
Web hosting is a type of internet hosting service that makes web sites and web pages available to many
users via the world wide web(WWW).
10.What is the use of PHP file?
a) PHP file are used in server side scripting
b) PHP can generate dynamic page content.
c) PHP can send and receive the cookies.
d) PHP can encrypt the data.
11.Write the advantage of WWW
a) Free availability of information
b) Provides easy communication facility
c) Accessible from anywhere
d) Easy to exchange large amount of data
e) Helps in managing information
Viva Voce questions should be asked based on the given C++ program, SQL assignment and HTML
assignment.
Program 1,6,7 - Basic concepts of OOP and Classes and Objects
Program 2,3,4,5 - Data structures [Up to two -Dimensional array]
Program 8,9 - Function overloading
Program 10 -Constrictor and destructor
Program 11 - Inheritance
Program 12 - Pointers
SQL assignments 1,2 - SQL[DDL, DML, DQL, DCL, TCL statements with their purpose, operators,
Data types , functions ]
HTML assignment 1,2, - HTML tags with their purpose , DHTML and XML features.

Ii pu cs practical viva voce questions

  • 1.
    II PU ComputerScience. Prof. K. Adisesha Page 1 II PUC COMPUTER SCIENCE VIVA-VOCE QUESTIONS Data structure 1. What is data structure ? Ans. Data structures are a specialized format for organizing and storing data in memory such that CPU can perform operation on these data in an effective way. 2. What is an array. Ans:- An Array is a order collection of Homogeneous element. 3. How are arrays classified? Classification: There are 3 types of arrays.  One-dimensional Array  Two-dimensional Array  Multi-dimensional Array 4. What is meant be primitive data structure ? Give one example . Ans. Data structures that are directly operated upon by machine-level instructions are known as primitive data structures Ex:- The integers, real (float) ,logical data etc ….. 5. What are non-primitive data structures? Ans. The Data structures that are derived from the primitive data structures are called Non-primitive data structure. 6. Mention any two examples for non- primitive data structures? Ans. Array, stack, queues, linked list, tree and graph are non- primitive data structures 7. What is meant by non-linear data structure ? Ans. A data structure in which a data item is connected to several other data items. It has the possibility to reach one or more data items. The data items are not arranged in a sequential structure . Ex :- Trees, graphs 8. What do you mean by traversal in data structure ?
  • 2.
    II PU ComputerScience. Prof. K. Adisesha Page 2 A) The process of accessing each data item exactly once to perform some operations into a data structure is called “traversal in data structure “ . 9. Mention the types of searching in the Array ? Ans: i) Linear search ii) Binary search 10.What is meant by sorting in an array ? Ans. Sorting is the arrangement of elements of the array in some order like bubble sort, selection sort, quick sort ,heap sort, shell sort e.t.c….. 11.Name any one non-linear data structure ? Ans:Trees ,graphs 12.What is a stack? Ans. A stack is an ordered collection of items in which an element may be inserted or deleted only at same end. 13. Name the data structure which is called LIFO. Ans. A LIFO (Last In First Out) data structure is also called as stack. 14. What are the operations that can be performed on stacks? Ans. Stack( ), push(item), pop( ), peek( ), isEmpty( ), size( ) are the operations of stack. 15. Define the term PUSH and POP operation in stack. Ans. .The process of adding one element or item to the stack is represented by an operation called as the PUSH operation.  The process of deleting one element or item from the stack is represented by an operation called as the POP operation. 16. Mention any one application of stacks. Ans. It is used to reverse a word.  “Undo” mechanism in text editor.  Polish Notation 17.What is queue? Mention different operation performed on queue? Ans: A queue is an order collection of items where an item is inserted at one end called the “rear” and existing item is at the other end called the “front”. The Queue operation  Queue( ): creates a new queue that is empty
  • 3.
    II PU ComputerScience. Prof. K. Adisesha Page 3  Enqueue( ): Adds a new item to the “rear” of the queue  Dequeue( ): Deletes or removes the “front” item from the queue  Isempty( ): Tests to see whether the queue is empty  Size ( ) : returns the number of items in the queue. 18.Explain any five basic operations performed on arrays ? Ans. In An arrays performed five basic operations are 1. Traversing ,2. Searching, 3. Sorting , 4. Insertion, 5.Deletion , 6. Merging  Traversing : Accessing each element of the array exactly once to do some operations  Searching : Finding the location of an element in the array  Sorting : Arranging the elements of the array in some order  Insertion : Inserting an element into the array  Deletion : Removing an element from the array  Merging : Combining one or more arrays to form a single array 19. What is a linked list? Ans. A linked list is a linear collection of data elements called nodes. 20. Which data structure creates relationship between data elements through links? Ans. Linked List creates relationship between data elements through links. 21. What is binary tree? Ans. A binary tree is an ordered tree in which each internal node can have maximum of two child nodes connected to it. 22. What do you mean by depth of a tree? Ans. The height or depth of a tree is defined to be the maximum number of nodes in a branch of tree. 23. How do you find the degree of tree?
  • 4.
    II PU ComputerScience. Prof. K. Adisesha Page 4 Ans. The degree of tree is the maximum degree of nodes in the tree. The degree of node is the maximum number of children that can exist for a node. 24.What are primitive data structures? Explain the operations performed on primitive data structures: Ans:-Data structures that are directly operated upon by machine –level instructions are known as primitive data structures. Different operations:  Create : Create operation is used to create a new data structure.  Destroy : Destroy operation is used to destroy or remove the data structures from the memory space.  Select : Select operation is used by programmers to access the data within data structure.  Update : Update operation is used to change data of data structures.
  • 5.
    II PU ComputerScience. Prof. K. Adisesha Page 5 CHAPTER 6:- OOPS CONCEPTS 1. What is polymorphism? Ans:- Polymorphism: It is ability of a function to have same name and multiple forms. 2. What is the fundamental idea of OOP? Mention any two Object Oriented Programming languages. Ans :- Object Oriented Programming is a programming paradigm that uses “objects” to design applications and computer programs. Example :- C++, Java, .Net, Objective C 3. Mention any two advantages of object oriented programming over earlier programming methods. Ans:- The programs are modularized based on the principle of classes and objects. Creation and implementation of OOP code is easy and reduces software development time. 4. Mention different types of inheritance Ans:-Single Inheritance, Multilevel Inheritance, Multiple Inheritance, Hierarchical Inheritance, Hybrid Inheritance. 5. Explain data abstraction. Ans:- Abstraction refers to the representation of essential features of an object as a program object. An abstract class defines an interface, but does not provide implementation details. 6. List different characteristics of OOPS: Ans:- Object, Class, Abstraction, Encapsulation, Inheritance, Polymorphism, Message passing 7. Write any two applications of OOPS: Ans: Computer Graphic Applications, CAD/CAM software, Object-Oriented Database, Real-time Systems
  • 6.
    II PU ComputerScience. Prof. K. Adisesha Page 6 8. Explain characteristics of OOPs Ans:- o Object: Object represents data and associated functions as a single unit. o Class: A class is a way of grouping objects having similar characteristics. o Abstraction: Abstraction refers to the representation of essential features of an object as a program object. An abstract class defines an interface, but does not provide implementation details. o Encapsulation: It is a way of combining data and associated functions into a single unit.  Encapsulation implements abstraction. o Inheritance: Acquisition of properties of one class by another class is called Inheritance. o Polymorphism: It is ability of a function to have same name and multiple forms. o Message Passing: The processing of data in object oriented programming is carried out by sending messages to objects.
  • 7.
    II PU ComputerScience. Prof. K. Adisesha Page 7 CHAPTER -7:-CLASSES AND OBJECTS 1. Define a Class. Ans:- A class is a collection of objects that have identical properties, common behavior and shared Relationship under a single name. 2. Is it possible to access data outside a class? Ans. Yes, public data members can be accessed outside a class. 3. Mention the operator used to access members of a class. Ans: Class member can be accessed by using dot (.) operator 4. What is significance of scope resolution operator (: : ) ? Ans: scope resolution operator identifies the function as an member of particular class. 5. Write the syntax to declare objects of a class? Ans Class _ name object _ name; 6. What is an object? Ans: Real word entity with attribute and function 7. Mention the access specifiers used with a class. Ans. Different access specifiers such as private, public, and protected. 8. Which type of data members are accessible outside the class? Ans:-Public and protected.. 9. What is the significance of scope resolution operator(::)? Ans. Scope resolution operator is used to define the method of side of the class. 10.Write the syntax to declare objects of a class? Ans.Object of a class are declared in the same manner like any other variable declaration. Ex-: class student { //data members }; Student obj1,iobj2;//obj1,obj2 are objects of class student
  • 8.
    II PU ComputerScience. Prof. K. Adisesha Page 8 11.What is an object? Ans:-An object is an instance of a class or physical entity. 12.Mention the operator used to access members of a class? Ans.:-Class members are used to access by dot(.) operator. 13.Which type of data members are accessible outside of a class? Ans:-Public members can be accessed outside a class. 14.Define a class? Ans.:-A class is a collection of related data and relevant functions. 15.What is a member data? Ans.:-Data members are different data variables similar to structure members. 16.What is a member function? Ans:-Member function also known as method acts on data members in the class. 17.Is it possible to access the data outside of the class? Ans.:-No, we can not access the data outside of the class. 18.What is meant by an array of objects? Ans:-An array having class type array elements is known as an array of objects. 19.Which access specifier is implicitly used in a class? Ans. Private access specifier is implicitly used in a class. 20.How are the objects of a class declared? Give an example. Ans:-Object of a class are declared in the same manner like any other variable declaration.
  • 9.
    II PU ComputerScience. Prof. K. Adisesha Page 9 EX-:- Class student { private: int Reg; char Sname: public: void getdata(); void displaydata(); }; Student obj1,iobj2;//obj1,obj2 are objects of class student 19.What is the significance of scope resolution operator(::)? Ans. Scope resolution operator is used to define the method of side of the class. 20.Give the general syntax for defining classes and objects? Ans. Syntax for class declaration class class_name { //Class doby }; Syntax for object declaration Class_name object_name; 21.Explain member functions a) Inside class function b) Outside class function
  • 10.
    II PU ComputerScience. Prof. K. Adisesha Page 10 CHAPTER 8:-FUNCTION OVERLOADING 1. Explain inline function with syntax and example. Ans:- The inline function short function compiler replaces the function call statement with the function code itself. Syntax with example: Inline int square (int a) { Return (a*a); } Advantages of inline functions 1. The inline member functions are compact functions calls. 2. Therefore the size of the object code is considerably reduced. 3. The speed of execution of a program increase 4. Very efficient code can be generated 5. The readability of the program increases Disadvantages As the body of inline function is substituted in place of a function call the size of the executable file increase and more memory is needed. 2. Explain friend function and their characteristics: Ans A friend function is a non member function that is a friend of a class. The friend function is declared within a class with the prefix friend. But is should be defined outside the class like a normal function without the prefix friend. It can access public data members like non-member friend function. Syntax: Class class _ name { Public;
  • 11.
    II PU ComputerScience. Prof. K. Adisesha Page 11 Friend voids function (void); }; Characteristics: 1. A friend function although not a member function, has full access right to the private and protected members of the class. 2. A friend function cannot be called using the object of that class. If can be invoked like any normal function. 3. A friend function is declared by the class that is granting access. 4. They are normal external functions that are given special access privileges 5. The function is declared with keyword friend. But while defining friend function it does not either keyword friend or :: operator.
  • 12.
    II PU ComputerScience. Prof. K. Adisesha Page 12 CHAPTER 8:-Pointers 1. What do you mean by pointer? Ans:- A pointer is a variable that holds a memory address of another variable. 2. Mention any two advantage of pointer: Ans Pointers save memory space. Dynamically allocate and de-allocate memory 3. What is address operator? Ans. The ‘&’ is the address operator and it represents address of the variable. 4. What is pointer operator? Ans. The ‘*’ is a pointer operator, which is also called indirection operator or dereference operator. 5. How to declare pointer? Ans. The general syntax of pointer declaration is given below. Syntax: Data_Type *Ptr_Variablename; Example: int *iptr; 6. How to initialize pointer? Ans. By using the & operator as follows: int *X, Y=10; X = &Y; 7. What is static memory? Ans. Static memory allocation refers to the process of allocating memory during the compilation of the program i.e. before the program is executed. 8. What is dynamic memory? Ans. Dynamic memory allocation refers to the process of allocating memory during the execution of the program or at run time. 9. What is free store? Ans. Free store is a pool of memory available to allocated and de-allocated storage for the objects during the execution of the memory. 10. What is new operator in C++? Ans. The new operator is used to create a heap memory space for variables.
  • 13.
    II PU ComputerScience. Prof. K. Adisesha Page 13 CHAPTER- 9:- CONSTRUCTORS AND DESTRUCTORS 1. What is destructor? Which operator is used with destructor? Ans:-Destructor is special member function that will be executed automatically when an object is destroyed is the operator which is used for destructor. 2. Write syntax and example for copy constructor Ans:- The syntax for copy constructor is Class name :: (class_name &ptr) Example: x::x(x &ptr) Where x is the class name. 3. Write the syntax and example for default constructor Ans:-syntax: Class name:: class_name( ) { } // constructor without argunents Example: student ( ) {------------------ } 4. What is a constructor? Give an example Ans: It is a special member function that is used in classes to initialize the object of the class automatically. The constructor is a member function of a class with the same name as that of the class. The constructor is invoked when we create the object of the class. 5. Mention the features of parameterized constructors. Ans:- i) Parameterized constructors can be overloaded ii) Parameterized constructor can have default arguments and default vales 6. List the different types of Constructors. Ans:-a. Default constructor
  • 14.
    II PU ComputerScience. Prof. K. Adisesha Page 14 b. Parameterized constructor c. Copy Constructor 7. Which are the different methods through which constructors are invoked? Ans:- a)Explicit call b)Implicit call c)initializing at the time of declaration with = operator 8. Mention three types of constructors. As. Three types of constructors are there 1) Default constructor 2) Parameterized constructor 3) Copy constructor 9. What is default constructor ? and write the drawback of default constructor. Ans:-A constructor which does not accept any arguments is called default constructor. The main drawback of default constructor when many objects for the classes are created all objects are initialized to same set of values by default constructor. 10.What is a copy constructor? Give an example Ans:- Copy constructor is a parameterized constructor using which one object can be copied to another object. 11.What are constructor and destructor? Write the rules for writing a constructor function Ans:-constructor: A constructor is a special member function that is used in classes to initialize objects of class automatically. Destructor: Destructors are member functions that destroy an object automatically. Rules for constructor:
  • 15.
    II PU ComputerScience. Prof. K. Adisesha Page 15  A constructor always have name, that is the same a the class name of which they are members. There is no return type for constructors (not even void).  Constructors should be declared in public section.  A constructor is invoked automatically when objects are created. Constructor can have default arguments.  It is not possible to refer to the address of the constructors.
  • 16.
    II PU ComputerScience. Prof. K. Adisesha Page 16 CHAPTER -10:- INHERITANCE 1. What is Virtual base class? Ans: When two or more objects are derived from a common base class, we can prevent multiple copies of the base class 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 word Virtual. 2. What are the advantages of inheritance? Ans:-Advantages of inheritance  Reusing existing code  Easy to maintain  Easy to extend  Memory utilization  Faster development time 3. What is inheritance? Explain the types of inheritance? Or Explain briefly the types of inheritance. Ans: Inheritance is the capability of one class to inherit the properties from another class. Types of inheritance: 1. Single inheritance 2. Multilevel inheritance 3. Multiple inheritance 4. Hierarchical inheritance 5. Hybrid inheritance 1) Single inheritance: If a class derived from a single base class, it is called as single inheritance.
  • 17.
    II PU ComputerScience. Prof. K. Adisesha Page 17 2) Multilevel inheritance: The classes can also be derived from the classes that are already derived, it is called as multilevel inheritance. 3) Multiple inheritance: It is the inheritance hierarchy where in one derived class inherits from multiple base classes. 4) Hierarchical inheritance: It is the inheritance hierarchy where in multiple subclasses inherits from one base class.
  • 18.
    II PU ComputerScience. Prof. K. Adisesha Page 18 5) Hybrid inheritance: The inheritance hierarchy that reflects any legal combination of other four pes of inheritance. 4. What is virtual base class? Give example Ans: To avoid the multiple copies of base class object, virtually can be inherited from base class by using a keyword “virtual”. 5. What is visibility mode? What is its role? Or What is the difference between public, private and protected access specifier? Ans: The visibility mode basically controls the access specifies to be used for inheritable member of base class in the derived class.
  • 19.
    II PU ComputerScience. Prof. K. Adisesha Page 19 CHAPTER -11:- POINTERS ONE MARK QUESTIONS 1. How do you declare a pointer? Ans:- data type *variable name; Eg: int * ptr; 2. Write the difference between the statements i) X=&Y ; ii) X=*Y; Ans:-(i) X = & Y; the address of variable Y is assigned to pointer variable X. (ii) X = *Y; the value of variable Y is assigned to X. 3. What is free store? Ans:-It is a pool of unallocated memory heap given to a program that is used by the program for dynamic allocation during execution 4. Mention any one advantage of pointers.  It is possible to write efficient programs  Memory utilized properly etc' 5. Define a Pointer. Ans:-Pointer is a variable which holds a memory address. 6. what are address operator and pointer operator? Ans. The symbol ‘&’ (ampersand ) is a address operator. The symbol ‘*’ (asterick) is a pointer operator. 7. . what are new and delete operators in c++? Ans. The new operator in c++ , allocate memory dynamically. The delete operator in c++, releases dynamically allocated memory. 8. How to initialize pointer? Ans. Ex: int *ptr; int a=10; ptr= &a;
  • 20.
    II PU ComputerScience. Prof. K. Adisesha Page 20 9. What is dynamic allocation of memory? Ans:-Memory is allocated during the execution of the program. Dynamic allocation and deallocation of objects is done using new and delete operators. The new operator allocate memory for objects form pool called the free store. Delete aperator is used to delete dynamic memory 10. Explain the use of new operator in c++ with syntax and example. Ans:-Dynamic allocation of space in a C++ program can be done with the help of new and delete operators. 11. How dynamic memory allocation is different from static memory allocation? Ans:- Static allocation of memory Dynamic allocation of memory Memory is allocated during compilation Memory is allocated during the execution No memory allocation or de-allocation actions are performed during execution. Memory bindings are established and destroyed during the execution Variable remain permanently allocated Allocated only when program unit is active Implemented using stocks and heaps Implemented using data segments 12. What are the advantages of pointers? Ans: a. It is possible to write efficient programs b. Memory is utilized properly c. Dynamically allocate & de-allocate memory. d. Establishes communication between program and data.
  • 21.
    II PU ComputerScience. Prof. K. Adisesha Page 21 SQL Commands a Define Database. Ans:- Database is a collection of logically related data. b What is Data model? Ans:- Data model is an abstract model that describes how data is stored, represented and used. c What is DDL ? Ans:- Data Definition Language d What is DML? Ans:-Data Manipulation Language. e What is DCL ? Ans:-Data Control Language. f What is DQL ? Ans:-Data Query Language g Write the syntax and example for delete command in SQL: Ans: syntax: delete from table_name [where condition]; Example: h delete from employees where id=3; i What is the use of NULL value? Give example. A:SQL NULL is the term used to represent a missing value. Ex: Select * from employees where salary is null; j What is a dual table? Ans: Dual table is a single row single column dummy table provided by oracle. select 423*123 from dual; k Classify various SQL operators. Ans: SQL operators are classified as a) Arithmetic operators i Comparison operators ii Logical operators
  • 22.
    II PU ComputerScience. Prof. K. Adisesha Page 22 iii Operators used to negate conditions l Write the classification of SQL commands: Ans: a) Data Definition Language(DDL) i Data Manipulation Language(DML) ii Data Control Language(DCL) iii Data Query Language(DQL)
  • 23.
    II PU ComputerScience. Prof. K. Adisesha Page 23 Web designing 1. What is DHTML? Ans:-Dynamic HTML is a collective term for a combination of Hypertext Markup Language tags and options that can make web pages more animated and interactive than previous versions of HTML. 2. Mention the use of HTML Ans:-HTML is used to make websites. 3. What is web scripting? Ans:-The process of creating and embedding scripts in a web page is known as web scripting. 4. What do you mean by Domain? Ans:-Domain names are used in URLs to identify particular Web pages. For example, in the URL http://www.google.com 5. What do you mean by hosting? Ans:-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. 6. Expand ARPANET? Ans:-Advanced Research Project s Agency Network. 7. Give the features/ merits of DHTML. a) An object oriented view of a web page and its elements b) Cascading style sheets and the layering content c) programming that can address all or most page elements d) Dynamic fonts 8. What is the use of PHP files? a)Password protection b) Form processing c) Browser customization d) Dynamically editing or adding content to web page e) Building and displaying pages created from a database.
  • 24.
    II PU ComputerScience. Prof. K. Adisesha Page 24 9. Explain Hosting of a Website. Web hosting is a type of internet hosting service that makes web sites and web pages available to many users via the world wide web(WWW). 10.What is the use of PHP file? a) PHP file are used in server side scripting b) PHP can generate dynamic page content. c) PHP can send and receive the cookies. d) PHP can encrypt the data. 11.Write the advantage of WWW a) Free availability of information b) Provides easy communication facility c) Accessible from anywhere d) Easy to exchange large amount of data e) Helps in managing information Viva Voce questions should be asked based on the given C++ program, SQL assignment and HTML assignment. Program 1,6,7 - Basic concepts of OOP and Classes and Objects Program 2,3,4,5 - Data structures [Up to two -Dimensional array] Program 8,9 - Function overloading Program 10 -Constrictor and destructor Program 11 - Inheritance Program 12 - Pointers SQL assignments 1,2 - SQL[DDL, DML, DQL, DCL, TCL statements with their purpose, operators, Data types , functions ] HTML assignment 1,2, - HTML tags with their purpose , DHTML and XML features.