Professional Documents
Culture Documents
1.
P is an object pointer to a class student with data member mark.
Select the correct method of accessing from the following list:
a) P.mark
b) P::mark
c) P*mark
d) Pmark
2. Divya wrote a C++ function that allocates memory for100 integers using new operator.
Identify the problems that may arise if she does not use delete operator in it.
3. int a[5] = {10, 5, 18, 14, 16};
cout<<*(a+2);
What will be the output of the above code.
4. For a geometric system discuss the underlying OOP feature in the following operations
a) To combine data and function as a single unit
b) To define a function perimeter that finds perimeter for different shapes.
5. Identify the type of constructor invoked in the following cases.
a) An object is initialised with another object
b) An object is declared with initial values for the data members
6. Distinguish between
a.
b.
c.
d.
e.
f.
g.
h.
i.
j.
k.
1.
What is a class?
Class is concrete representation of an entity. It represents a group of objects, which hold similar attributes and
behavior. It provides Abstraction and Encapsulations. Classes are generally declared using the keyword class.
2. What is an Object? What is Object Oriented Programming?
Object represents/resembles a Physical/real entity. An object is simply something you can give a name.
Object Oriented Programming is a Style of programming that represents a program as a system of
3.
4.
side world
What is Abstraction?
Hiding the complexity. It is a process of defining communication interface for the functionality and
5.
6.
7.
class.
What is an Abstract class?
An abstract class is a special kind of class that cannot be instantiated. It normally contains one or more
8.
1.
2.
3.
Public: The data members and methods having public as access outside the class.
Protected: The data members and methods declared as protected will be accessible to the class
methods and the derived class methods only.
Private: These data members and methods will be accessibl not from objects created outside the
class.
4. What is a void return type?
A void return type indicates that a method does not return a value.
5.
6.
7.
Normally, a function call transfers the control from the calling program to the function and after
the execution of the program returns the control back to the calling program after the function call.
These concepts of function saved program space and memory space are used because the function
is stored only in one place and is only executed when it is called. This concept of function execution
may be time consuming since the registers and other processes must be saved before the function
gets called.
The extra time needed and the process of saving is valid for larger functions. If the function is short,
the programmer may wish to place the code of the function in the calling program in order for it to
be executed. This type of function is best handled by the inline function. In this situation, the
programmer may be wondering why not write the short code repeatedly inside the program
wherever needed instead of going for inline function? Although this could accomplish the task, the
problem lies in the loss of clarity of the program. If the programmer repeats the same code many
times, there will be a loss of clarity in the program. The alternative approach is to allow inline
functions to achieve the same purpose, with the concept of functions.
8.
What is preprocessor?
The preprocessor is used to modify your program according to the preprocessor directives
in your source code. Preprocessor directives (such as #define) give the preprocessor specific
instructions on how to modify your source code. The preprocessor reads in all of your
include files and the source code you are compiling and creates a preprocessed version of
your source code. This preprocessed version has all of its macros and constant symbols
replaced by their corresponding code and value assignments. If your source code contains
any conditional preprocessor directives (such as #if), the preprocessor evaluates the
condition and modifies your source code accordingly.
The preprocessor contains many features that are powerful to use, such as creating macros,
performing conditional compilation, inserting predefined environment variables into your
code, and turning compiler features on and off. For the professional programmer, in-depth
knowledge of the features of the preprocessor can be one of the keys to creating fast,
efficient programs.
9.
10.
memory space needed to tackle this situation. This would result in wastage of unused memory
spaces. Memory management operators are used to handle this situation in C++ programming
language.
11.
new
delete
12. What is array and its type?
13. What is the difference b/n array and pointer?
Pointer pointer is a variables that hold the address of another variable .It is used to manipulate
data using the address, pointer use the * operator to access the data pointed by them.
Array array use subscripted [] variable to access and manipulate the data ,array variables can be
equivalently written using pointer expression.
A special function Always called whenever an instance of the class is created.
a=9;b=8;
} };
Constructor with no arguments or all the arguments has default values. In Above Question Test() is a
default constructor
20. What are virtual functions? Describe a circumstance in which virtual functions would be appropriate
Virtual functions are functions with the same function prototype that are defined throughout a class
hierarchy. At least the base class occurrence of the function is preceded by the keyword virtual. Virtual
functions are used to enable generic processing of an entire class hierarchy of objects through a base
class pointer. For example, in a shape hierarchy, all shapes can be drawn. If all shapes are derived from
a base class Shape which contains a virtual draw function, then generic processing of the hierarchy can
be performed by calling every shapes draw generically through a base class Shape pointer.
22.
will help you to face viva and score more in your final year project report.
A Person who is taking your viva-voice is completely depends on your explanation
about your project means he/she does not do any home work for taking your viva.
They start studying your project just before 10 minutes of your viva. If your report
has some problem related to index, content, coding don't worry about that you can
remove it just by showing confidence and doing professional talk in front of your
professor. We can classify the all viva questions into four category viz. ABOUT
PROJECT TITLE & PROJECT REPORT, DOCUMENTATION i.e.
THEORATICAL KNOWLEDGE, TESTING OF SOFTWARE AND ABOUT
PROGRAMMING.
1.
In the first category i.e. about project title the few questions are: