This download link is referred from the post: GTU BE/B.Tech 2018 Winter Question Papers || Gujarat Technological University
Firstranker's choice
Seat No.:
--- Content provided by FirstRanker.com ---
Enrolment No.
GUJARAT TECHNOLOGICAL UNIVERSITY
BE - SEMESTER-1V (NEW) EXAMINATION - WINTER 2018
Subject Code:2140705
Subject Name:Object Oriented Programming With C++
--- Content provided by FirstRanker.com ---
Time: 02:30 PM TO 05:00 PM
Date:12/12/2018
Total Marks: 70
Instructions:
- Attempt all questions.
- Make suitable assumptions wherever necessary.
- Figures to the right indicate full marks.
--- Content provided by FirstRanker.com ---
Q1
- Differentiate Object Oriented Programming (OOP) and Procedure Oriented Programming (POP). (03 MARKS)
- Write a C++ program to find out the sum and average of three numbers using nesting of member function. (04 MARKS)
- Describe the basic structure of a C++ program with all necessary blocks. (07 MARKS)
--- Content provided by FirstRanker.com ---
Q2
- When can you make function inline? What are the advantages of making function inline? (03 MARKS)
- Following is a main() program. (04 MARKS)
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.
void main()--- Content provided by FirstRanker.com ---
{ time T1; int duration = 85; T1 = duration;
} - Write a C++ program. that overloads + operator to add two complex numbers. (07 MARKS)
OR
- Write a C++ program to find volume of cube, cylinder and rectangular box using concepts of function overloading. (07 MARKS)
(volume of ‘cube = s3, volume of cylinder is π*r2*h, volume of rectangular box is l*b*h)
--- Content provided by FirstRanker.com ---
Q3
- An unsigned int can be twice as large as the signed int. Explain how? (03 MARKS)
- Write a C++ program to swap the values of pair of integers using function and call by reference. (04 MARKS)
- Explain various forms of inheritance with suitable diagrams and example of each. (07 MARKS)
--- Content provided by FirstRanker.com ---
OR
- Differentiate structure and class in C++. (03 MARKS)
- Consider following class declarations. (04 MARKS)
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.
class ABC;--- Content provided by FirstRanker.com ---
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);
}; - List out the characteristics of constructor in C++. Write a program to illustrate the use of copy constructor. (07 MARKS)
--- Content provided by FirstRanker.com ---
Q4
- Differentiate between late binding and early binding. (03 MARKS)
- Describe different ways to open file with suitable example. (04 MARKS)
- Define polymorphism? How is it achieved in C++? Explain with suitable example. (07 MARKS)
--- Content provided by FirstRanker.com ---
OR
Q.4
- Describe the syntax and use of set () function with suitable example. (03 MARKS)
- Explain virtual base class with a program. (04 MARKS)
- Demonstrate the use of static variables and static functions with a program. (07 MARKS)
--- Content provided by FirstRanker.com ---
Q.5
- Describe the significance of this pointer with suitable example. (03 MARKS)
- Explain following file modes. (04 MARKS)
- ios::app
- ios::out
- ios::binary
- ios::nocreate
--- Content provided by FirstRanker.com ---
- Define Exception? Explain Exception Handling Mechanism. Write a program that demonstrates use of multiple catch. (07 MARKS)
OR
Q.5
--- Content provided by FirstRanker.com ---
- Explain pure virtual function with suitable example. (03 MARKS)
- Describe the various approaches by which we can detect the end of file condition. (04 MARKS)
- Write a C++ program to copy the contents of a file A.txt into another file B.txt. (07 MARKS)
--- Content provided by FirstRanker.com ---
This download link is referred from the post: GTU BE/B.Tech 2018 Winter Question Papers || Gujarat Technological University