Automatically extracted historical question data. Academic accuracy and examination rules require verification.
Part B — 11
Answer the following .
A. Copy constructor and Dynamic constructor. (4)
B. List those operators that can be and cannot be overloaded in C++. (4)
C. "Only destructors can be made virtual". Justify your answer. (2)
D. When will you make a function Inline. Write an inline function to find the maximum of three
numbers. (4)
E. Is there any way to access class private members without its object? J ustify your answer. (2)
Other Or UnclassifiedSource quality review required
Part B — 12a
a) i) Write a program that demonstrates the use of static data member, static member
function and array of objects. (10)
ii) What is an array of pointers ? And how does it differ from pointer to an array?
Illustrate with an example. (6)
Other Or UnclassifiedSource quality review required
Part B — 12b
b) 1) Write a C program to calculate the net salary of an employee with structure members
as Name, Empid, Basic pay, Da(10% of Basic pay), Ta(12% of Basic pay). Create a
pointer pointing to an array of 10 employees. Write a display function to display the
details of employee who is getting the highest salary based on their annual income
using pointers. Also write an update function to modify the annual income by
deducting IT( use structure pointer as function argument). (10)
11) Write a C program to store 5 names in a text file. Display the same. Append 2 names
and display the byte position of 6th name. (6)
Other Or UnclassifiedSource quality review required
Part B — 13a
a) 1) Create a base class named, 'shape' with two members base and height, a member
function for initialization and a virtual function to compute area(). Derive two specific
classes Triangle and Rectangle which override the function area(). Use these classes in
main function and display the area of triangle and rectangle using virtual functions.
(12)
ii) Brief about Abstract base class and Virtual base class with suitable syntax. (4)
Other Or UnclassifiedSource quality review required
Part B — 13b
b) Write a program that has a class Train with data members- no of 50218 1”, no of
seats 2", no_of seats 3" and member functions to set and display data. Derive a class
Reservation that has data members- seats booked_1*, seats ௦01602”,
seats booked_31""- and functions to book and cancel tickets, and display the status.
(16)
Other Or UnclassifiedSource quality review required
Part B — 14a
a) i) List out the advantages of class and function templates. (4)
11) Write a generic function to perform linear search on an array (12)
Other Or UnclassifiedSource quality review required
Part B — 14b
b) Write a program that has a class Matrix, overload the += operator, and throws an
exception if number of rows and columns of the two matrices are not equal. (16)
Other Or UnclassifiedSource quality review required
Part B — 15a
a) i) Write a program that reads a file and copies its contents in another file. While copying,
replace all full stops with commas. (8)
11) Write a program to reads a file that contains integers. Read the integers and categorize
them as even or odd. Store all even integers in a file called EVEN.TXT and all odd
numbers in ODD.TXT (8)
Other Or UnclassifiedSource quality review required
Part B — 15b
b)i) Write a program that demonstrates the use of different cast operators.
ii) Write a program to implement Vectors in STL which includes the following
operations.
- push_back( )
- pop_back( )
- begin( )
- end( )
(8)
Other Or UnclassifiedSource quality review required