Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

C 2

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Downloaded from www.jayaram.com.

np

PURWANCHAL UNIVERSITY
II SEMESTER FINAL EXAMINATION-2008

LEVEL : B. E. (Civil/Computer/Electronics & Comm.)


SUBJECT: BEG176CO, Object-Oriented Programming C++
Full Marks: 80
TIME: 03:00 hrs
Pass marks: 32

Q.

Q.

Candidates are required to give their answers in their own words as far
as practicable.
All question carry equal marks mark. The marks allotted for each subquestion is specified along its side. Assume data if necessary.
Answer FIVE questions.
Q.

[1]

Q.

[2]

Q.

[3]

Q.

[4]

Q.

[5]

Q.

[6]

[a] What is object oriented paradigm? Discuss the merits


and demerits of object oriented methodologies. [2+3]
[b] What is class? Write a program illustrating class
declaration, definition and accessing class members. [2+3]
[a] What is polymorphism? How does function overloading
implement polymorphism?
[2+2]
[b] What are inline functions? Write an inline function for
finding minimum of tow numbers using object oriented
concept.
[2+4]
[a] what are constructor and destructor? Explain copy
constructor and explain their need.
[2+3]
[b] Write a program to accept a date of birth and calculate
the age of a person using passing object as argument. [5]
[a] What is the pointer? Write a program demonstrating the
use of the pointer.
[1+4]
[b] Create a class complex for complex number and write
a program to add two complex numbers using friend
function.
[5]
[a] What is type conversion? Explain different types of
data conversions.
[2+3]
[b] Create a class string and add two strings using +
operator.
[5]
[a] What is inheritance ? What are the types of inheritance?
[2+4]

Q.

Q.

[b] Why overriding is needed? Explain with example. [4]


[7] [a] What are virtual functions? Explain how runtime
polymorphism can be achieved using them.
[2+3]
[b] What is visibility mode? What are the different
inheritance visibility modes supported by C++ with
suitable example.
[1+4]
[8] [a] What are file modes? Describe different methods of
opening a file.
[2+3]
[b] Write an interacting program to maintain an employee
database. It has to maintain information such as
employee id, name, salary, designation etc. The user
must be able to access all details about a person by
entering id or name.
[5]
[9] [a] What is generic programming? What are its advantages
and state some of its application.
[2+3]
[b] Write a function template for finding the largest number
in a given array.
[5]
[10] Write short notes on any TWO:
[5+5]
[a] Object modeling Vs Dynamic modeling
[b] Namespaces
[c] Data encapsulation Vs Data abstraction.

Downloaded from www.jayaram.com.np / 1

Downloaded from www.jayaram.com.np

PURWANCHAL UNIVERSITY
II SEMESTER FINAL EXAMINATION-2007

LEVEL : B. E. (Civil/Computer/Electronics & Comm.)


SUBJECT: BEG176CO, Object-Oriented Programming C++
Full Marks: 80
TIME: 03:00 hrs
Pass marks: 32
Candidates are required to give their answers in their own words as far
as practicable.
All question carry equal marks mark. The marks allotted for each subquestion is specified along its side.
Answer EIGHT questions.

Q.

Q.

Q.
Q.

Q.

[1]

[2]

Q.

[3]

Q.

[4]

Q.

[5]

[a] Why do we prefer Object Oriented paradigm in


programming languages? Do you think OOP technique
reduces the memory space requirements? Argue for
your answer with strong relevant points.
[4+4]
[b] What is the purpose of enumeration? How is it declared
in C++?
[2]
[a] How function overloading is achieved in C++? Write a
suitable program in C++ showing function overloading.
[2+6]
[b] What is inline function? What is the advantage of using
inline functions?
[2]
[a] What do you mean by classes and objects? How does
class accomplish data hiding? Explain.
[3+5]
[b] Why friend functions are used in object oriented
programming?
[2]
[a] Describe the role of constructions and destructors.
Explain different types of constructors with suitable
examples.
[3+5]
[b] How static members are declared in c++?
[2]
[a] Create N number of objects/agents that represents
founders of Purbanchal University affiliated colleges
from a class named PU. Write an interactive progam
in C++ with necessary data members and member
functions with its implementation that reads and

Q.

Q.

displays each founders college name, address and


contact numbers.
[8]
[b] What are the possible types of data conversions?
[2]
[6] [a] What do you mean by operator overloading? Write a
program that increment integer type data variables of a
class by unit 2 using increment unary operator
overloading.
[2+6]
[b] What are the types of Inheritance?
[2]
[7] [a] How inheritance reuses the existing code? How
inheritance provides code reusability? Describe the cost
and benefits of Inheritance in brief.
[2+6]
[b] Define pure virtual function and abstract classes.
[2]
[8] [a] What do you mean by runtime and compile item
polymorphism? How run time polymorphism is
achieved in C++?
[2+6]
[b] What do you mean by generic programming? Discuss.[2]
[9] [a] What is stream? Describe the Input/ Output class
hierarchy in brief.
[4+4]
[b] Write a program that creates a file named TEST.TXT in
C++.
[2]
[10] [a] What do you mean by functions and class templates?
How they are declared in C++? Explain.
[4+4]
[b] What is an exception? Why is it necessary to handle in
programming?
[2]

Downloaded from www.jayaram.com.np / 2

Downloaded from www.jayaram.com.np


Q.

PURWANCHAL UNIVERSITY
II SEMESTER BACK PAPER EXAMINATION-2006

LEVEL : B. E. (Civil/Computer/Electronics & Comm.)


SUBJECT: BEG176CO, Object-Oriented Programming C++
Full Marks: 80
TIME: 03:00 hrs
Pass marks: 32

Q.

Candidates are required to give their answers in their own words as far
as practicable.
All question carry equal marks mark. The marks allotted for each subquestion is specified along its side.
Answer EIGHT questions.

Q.

Q.

Q.

[1]

Q.

[2]

Q.

[3]

Q.

[4]

An education institution wishes to maintain record of its


teachers.
[10]
Create class Staff that stores the code (type int) and
name (a string). Derive a class teacher form the class
above that stores the SUBJECT ( a string).
In each class define member functions getdata() to get
the data from the user and putdata() to display the data.
The classes can have other member functions as per the
requirement.
Write a main () program to create 10 instances of class
TEACHER and retrieve the information of the Teacher
object whose code matches with the code suppled by
the user.
Create a class Student with the data members name
(type string) and id (type int), with the member
functions as per the requirements. Write objects of the
student class to a file. Ask use for a id of the object
to be deleted and delete the specific object form the file
whose id matches with id provided by the user. [10]
Differentiate between run time polymorphism and
compile time polymorphism. How is run time
polymorphism achieved, explain with an example. [4+6]
Descrive the characteristics of Object Oriented
programming.
[10]

Q.

Q.

[5]

What is operator overloading?


[2+4+4]
[a] Overload the == (equality operator) to compare two
String Objects. (eg. If (S1==S2))
[b] Overload the + (additional operator) to add two String
Objects. (eg. S1 = S2+S3)
[6]
Discuss on the public , private and protected visibility
mode with examples.
[10]
[7]
What is data conversion? Is data conversion possible
between objects of different class? If yes explain with
example.
[2+8]
[8] [a] What are exception? How are exceptions handled? [5]
[b] Why are templates used? Give a suitable example of a
function template with multiple parameters.
[5]
[9] [a] Explain the different types of construction?
[5]
[b] What is the difference between a member function and
a friend function. Explain with example.
[5]
[10] [a] How do you overload a function using different kinds
of arguments? Explain with example.
[5]
[b] What is a namespace? How do we access the members
of a namespace?
[5]

Downloaded from www.jayaram.com.np / 3

You might also like