Download GTU BE/B.Tech 2018 Winter 4th Sem New 2140705 Object Oriented Programming With C++ Question Paper

Download GTU (Gujarat Technological University) BE/BTech (Bachelor of Engineering / Bachelor of Technology) 2018 Winter 4th Sem New 2140705 Object Oriented Programming With C++ Previous Question Paper

www.FirstRanker.com
1
Seat No.: ________ Enrolment No.___________

GUJARAT TECHNOLOGICAL UNIVERSITY

BE - SEMESTER ?IV (NEW) EXAMINATION ? WINTER 2018
Subject Code:2140705 Date:12/12/2018

Subject Name:Object Oriented Programming With C++

Time: 02:30 PM TO 05:00 PM Total Marks: 70

Instructions:

1. Attempt all questions.

2. Make suitable assumptions wherever necessary.

3. Figures to the right indicate full marks.


MARKS

Q.1 (a) Differentiate Object Oriented Programming (OOP) and Procedure
Oriented Programming (POP).
03
(b) Write a C++ program to find out the sum and average of three numbers
using nesting of member function.

04
(c) Describe the basic structure of a C++ program with all necessary
blocks.
07
Q.2 (a) When can you make function inline? What are the advantages of
making function inline?
03
(b) Following is a main() program.
void main()
{
time T1;
int duration = 85;
T1 = duration;
}
Where time is a class which contains variables hrs and minutes.
duration stores total time in minutes. Define a class time with
necessary functions to break up the duration in maximum hours and
remaining minutes and store them into hrs and minutes respectively.
04
(c) Write a C++ program that overloads + operator to add two complex
numbers.
07
OR
(c) Write a C++ program to find volume of cube, cylinder and rectangular
box using concepts of function overloading.
(volume of cube = s3, volume of cylinder is ?*r2*h, volume of
rectangular box is l*b*h)
07
Q.3 (a) An unsigned int can be twice as large as the signed int. Explain how? 03
(b) Write a C++ program to swap the values of pair of integers using
function and call by reference.
04
(c) Explain various forms of inheritance with suitable diagrams and
example of each.
07
OR
Q.3 (a) Differentiate structure and class in C++. 03
www.FirstRanker.com www.FirstRanker.com
www.FirstRanker.com
FirstRanker.com - FirstRanker's Choice
www.FirstRanker.com
1
Seat No.: ________ Enrolment No.___________

GUJARAT TECHNOLOGICAL UNIVERSITY

BE - SEMESTER ?IV (NEW) EXAMINATION ? WINTER 2018
Subject Code:2140705 Date:12/12/2018

Subject Name:Object Oriented Programming With C++

Time: 02:30 PM TO 05:00 PM Total Marks: 70

Instructions:

1. Attempt all questions.

2. Make suitable assumptions wherever necessary.

3. Figures to the right indicate full marks.


MARKS

Q.1 (a) Differentiate Object Oriented Programming (OOP) and Procedure
Oriented Programming (POP).
03
(b) Write a C++ program to find out the sum and average of three numbers
using nesting of member function.

04
(c) Describe the basic structure of a C++ program with all necessary
blocks.
07
Q.2 (a) When can you make function inline? What are the advantages of
making function inline?
03
(b) Following is a main() program.
void main()
{
time T1;
int duration = 85;
T1 = duration;
}
Where time is a class which contains variables hrs and minutes.
duration stores total time in minutes. Define a class time with
necessary functions to break up the duration in maximum hours and
remaining minutes and store them into hrs and minutes respectively.
04
(c) Write a C++ program that overloads + operator to add two complex
numbers.
07
OR
(c) Write a C++ program to find volume of cube, cylinder and rectangular
box using concepts of function overloading.
(volume of cube = s3, volume of cylinder is ?*r2*h, volume of
rectangular box is l*b*h)
07
Q.3 (a) An unsigned int can be twice as large as the signed int. Explain how? 03
(b) Write a C++ program to swap the values of pair of integers using
function and call by reference.
04
(c) Explain various forms of inheritance with suitable diagrams and
example of each.
07
OR
Q.3 (a) Differentiate structure and class in C++. 03
www.FirstRanker.com www.FirstRanker.com
www.FirstRanker.com
www.FirstRanker.com
2
(b) Consider following class declarations.
class ABC;
class XYZ{
int x;
public:
void get_x(int i) {x=i;}
friend void sum(XYZ,ABC);
};
class ABC{
int y;
public:
void get_y(int i) {y=i;}
friend void sum(XYZ,ABC);
};
By considering above class declarations, define a function sum() at
outside the class to find out the sum of x and y and display the result.
Also define the main() which satisfy above class declarations.
04
(c) List out the characteristics of constructor in C++. Write a program to
illustrate the use of copy constructor.
07
Q.4 (a) Differentiate between late binding and early binding. 03
(b) Desribe different ways to open file with suitable example. 04
(c) Define polymorphism? How is it achieved in C++? Explain with
suitable example.
07
OR
Q.4 (a) Describe the syntax and use of set () function with suitable example. 03
(b) Explain virtual base class with a program. 04
(c) Demonstrate the use of static variables and static functions with a
program.
07
Q.5 (a) Describe the significance of this pointer with suitable example. 03
(b) Explain following file modes.
a. ios::app b. ios::out c. ios::binary d. ios::nocreate
04
(c) Define Exception? Explain Exception Handling Mechanism. Write a
program that demonstrates use of multiple catch.
07
OR
Q.5 (a) Explain pure virtual function with suitable example. 03
(b) Describe the various approaches by which we can detect the end of file
condition.
04
(c) Write a C++ program to copy the contents of a file A.txt into another
file B.txt.
07

*************
www.FirstRanker.com www.FirstRanker.com
www.FirstRanker.com
FirstRanker.com - FirstRanker's Choice

This post was last modified on 20 February 2020