0% found this document useful (0 votes)
10 views

qp oops

c++

Uploaded by

Immortal gaming
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

qp oops

c++

Uploaded by

Immortal gaming
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Name:

Enrolment No:

UNIVERSITY OF PETROLEUM AND ENERGY STUDIES


End Semester Examination, December 2022
Course: Object-Oriented Programming Semester: I
Program: B.Tch.(Engg.)- Mech./Mechatronics/ADE/Aerospace/Electronics and Communication/Electronics
and Computer Science/Chemical/Civil/Applied Petroleum(Upstream) Time: 03 hrs.
Course Code: CSEG1008 Max. Marks: 100

Instructions: All questions are compulsory.


SECTION A
(5Qx4M=20Marks)
S. No. Marks CO
Q1 Describe the advantages of Object-oriented programming language over
4 CO1
procedural-based programming language.
Q2 Explain 3 different types of loop control statements with pseudo-code
4 CO1
and flowchart.
Q3 Explain this pointer in C++ with a suitable example. 4 CO2
Q4 Describe the term polymorphism with suitable examples. Explain in brief
4 CO3
function overloading.
Q5 Describe a class template and a function template. 4 CO4
SECTION B
(4Qx10M= 40 Marks)
Q6 Explain call by value and call by reference by giving a suitable
10 CO1
example.
Q7 Describe the concept of constructors and destructors with the help of a
10 CO3
suitable programming example.
Q8 Write a C++ Program for exception handling using multiple catch
10 CO4
statement.
Q9 Explain the following with the help of a C++ program
a) Friend class
b) Static Functions
OR
10 CO2
Write a C++ program to write a class name “person” with data
members: i) “id” of type integer and ii) “name” of type character array
of size 30. Write member functions: i) “set_details()” to fill the data
members and ii) “get_details()” to print the data members. Implement
these member functions and invoke these functions from the main()
function using the concept of classes and objects.

SECTION-C
(2Qx20M=40 Marks)
Q 10 a) Describe the term inheritance briefly. Explain with suitable C++
examples the use of protected access specifier.
b) Explain single, multilevel, and multiple inheritance with suitable
examples in C++. 6+9+5 CO3
c) Write a C++ program to demonstrate the concept of function
overloading.

Q 11 a) What is the application of the scope resolution operator in C++?


b) Write a program to get two numbers from a user and compute
their sum and if the sum is greater than 100 then pass the value
to another function to check whether the sum is odd or even
(Using classes and functions).
4+8+8
c) Write a C++ program by using classes in which user enter the
number, program will reverse the number. After reversing the
number, show the sum of all numbers. For example, if the
number is 153, the after reverse it will be 351 and the sum will
be 9.

OR

a) Write a C++ program to display the area of a rectangle by using CO4


a class named ‘Rectangle’ with one public member function
named as ‘Calculate_Area()’ returns the area of the rectangle.
The private data members are ‘length’ and ‘width’. Also, write a
global function named as ‘dimension()’ that will be friend to the
14+6
‘Rectangle’ class. This function will initialize the ‘length’ and
‘width’ of the rectangle which is input from the user. In main()
create an object of the class ‘Rectangle’, then assign ‘length’ and
‘width’ to that object using the global friend function
‘dimension()’. Display the area by calling the corresponding
member function ‘Calculate_Area()’ of that object. (You can use
reference variables to solve this).
b) Explain the term access specifiers in C++ with the help of suitable
C++ programs.

You might also like