0% found this document useful (0 votes)
21 views6 pages

Question Bank OOP - KNK

Object oriented programming notes and questions

Uploaded by

sammholder547
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)
21 views6 pages

Question Bank OOP - KNK

Object oriented programming notes and questions

Uploaded by

sammholder547
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/ 6

Prof Ram Meghe College of Engineering & Management, Badnera

Department of Electronics & Telecommunication Engineering


III Sem 3ETC05 Object Oriented Programming Important Questions

Question bank Unit I

1) What are the data types in C++? Explain in brief. 6m


2) Write a program to find the sum and average of given numbers using while loop 7m
3) Explain the structure of C++ programming with the help of an example. 6/7m
4) What is object oriented programming? List the advantages/ benefits of OOP.
7m
5) What do you mean by object oriented programming? How it differs from procedure
oriented programming?
6) Write a C++ program to determine average marks. Accept number of subjects, number of
students and subject marks as input through the user. 7m
7) Explain the following terms in OOP- (elements/ pillars/ concept of OOP)
a. Classes
b. Objects
c. Data abstraction and encapsulation
d. Inheritance
e. Polymorphism
f. Dynamic binding
g. Message passing
8) Write a program to convert decimal number into binary number using “%” operator. 7m
9) What are identifiers? Give the rules for naming identifiers in C++. 6m
10) What are tokens? List the keywords specific to C++. Can these keywords be used as
variables? 6m
11) What is the purpose of void data type? 5m
12) Explain with examples the basic data types supported by C++. 6m
13) Write a C++ program to check whether the number entered by user is even or odd.
14) Write a C++ program to swap two variables
a) Using third variable
b) Without using third variable.
15) Write a program in C++ to print the area and perimeter of a rectangle. 6m
16) Write a C++ program to check whether the number entered by user is positive or
negative. 6m
17) Write a C++ program to convert the given weight in kilograms into a weight in pounds.
6m
18) Write a C++ program to display addition and average of five numbers without using loop.
19) Write a program to determine the factorial of a given number using the for loop (or do-
while loop). 7m

KNK_OOP
20) Write a C++ program to generate all the prime numbers between 1 and n, where n is a
value supplied by the user.

Question bank Unit II

1) Explain the various control structures in C++. 7m


2) Explain the derived data types in C++. 6m
3) Explain the user defined data types in C++. 8m
4) Explain with example inline function. Which are the situations where inline expansion
may not work? 7m
5) Write a function program that will return the sum of the squares of the integer from 1 to
n, i.e. 12+22+32+….+n2, where n is a parameter. 7m
6) What is reference variable? Discuss its major use. 7m
7) What are manipulators? Show their usage using examples. 7m
8) With the help of example, discuss the usage of scope resolution operator :: in C++. 6m
9) What are inline functions? When it is used? Write an inline function for finding
maximum of two numbers. 7/8m
10) What are the differences between parameter passing by value and passing by address?
Explain with suitable example. 8m
11) What is function overloading? Write a program using overloaded functions for
computing area of a triangle, a circle and a rectangle. 8m
12) Explain the use of following operators with suitable example. 6m
a. >>
b. <<
c. ::
13) What are default arguments? Write a program to compute tax. A tax compute function
takes two arguments: amount and tax percentage. Default tax percentage is 15% of
income. 7/8m
14) Write a program to find the square of a given number using a function declaration
without using the return statement. 7m
15) Discuss with examples the uses of enumeration data types. 7m
16) Write a program to display the name of the day in a week depending upon the number
which is entered by keyboard using switch statement. 7m
17) Write a function program to find maximum value of an array. 6m
18) Write a C++ program to read the age of 10 persons and count the number of persons in
the age group of 50 to 60. Use for loop. 7m
19) Create a function to receive two numbers from main() and return the sum back to main
program and display. Write C++ program. 7m
20) Write a C++ program to calculate net bill. Discount will be given if if purchase value is
more than Rs. 5000. Use function overloading. 6/7m

KNK_OOP
Question bank Unit III

1) What is a Constructor? List rules about declaring and using Constructors. 7m


2) What do you mean by constructor in C++? How can the constructor function be invoked?
7m
3) With suitable example explain copy constructor. 7m
4) What is a friend function? Give the advantage and disadvantage of using friend function.
6m
5) What is parameterized constructor? Demonstrate with example the passing argument to
the constructor function. 7m
6) What is constructor? With the suitable example program explain the dynamic constructor.
6m
7) What are friend functions and friend classes? Write a normal function which adds objects
of the complex number class. Declare this normal function as friend of complex class.
6m
8) What is destructor? List rules about declaring and using destructor.
9) Describe friend function with an example. 7m
10) Declare two classes named one and two. Use function named setdata in class one and in
class two to initialize data members of class one and class two. Use friend function to add
data members of class one and class two respectively. Display the result of addition of
data members data1 of class one and data member data2 of class two in this friend
function named add. 8m
11) Define a class Time with three integer variables i.e. hours, minutes and seconds. Write a
C++ program to add two Time variable (objects) entered in hours, minutes and seconds
into the third time variable. Demonstrate the use of constructors and destructor.
12) Write a C++ program to read two integer numbers through two different objects of class
„Addition‟. Add these two integers using friend function and display the total.
13) What is a friend function? What are the characteristics of a friend function?
14) Write a C++ program to implement a class Student having following members.
a) Data Members: i) Name of student ii) Marks of two subjects M1, M2
b) Member functions: i) To assign initial values ii) To compute total and average iii) To
display result i.e. Name, total and average.
The program will accept name of a student and two subject marks and display name,
total and average of two subjects.

KNK_OOP
Question bank Unit IV

1) Enlist the rules for overloading C++ operators. 6m


2) List the C++ operators
a. that can not be overloaded.
b. that can be overloaded for binary usages.
c. that can not be overloaded for unary usages.
3) Write a program to add two complex numbers C1 and C2 and store the result in C3 using
operator overloading. 8m
4) What is operator overloading? Why it is necessary to overload operators? 6m
5) Explain operator overloading using friend function. 7m
6) Explain the syntax of binary operator overloading. How many arguments are required in
the definition of an overloaded binary operator? 6m
7) Why is it necessary to overload an operator? How many arguments are required in the
definition of an overloaded unary operator? 6m
8) Describe the steps involved in overloading of operators. 6m
9) Write a C++ program to overload unary minus (-) operator using friend function. 7m
10) Write a program for addition of complex numbers with friend feature using binary
operator overloading. 8m
11) Write C++ program to overload ++ (increment) operator.
12) What are the limitations of overloading unary increment/ decrement operator? How are
they overcome? 5m
13) Write a program to overload the unary minus operator in such a way that when applied to
object should change the sign of each of its data items. Declare a class with data members
int x, y, z and member functions named getdata, display for reading the data members
and display their values respectively. Use operator function for overloading unary minus.
7m
14) Explain with example how the unary minus (-) operator is overloaded. 7m
15) Explain with example overloading of binary operator. 7m
16) Explain with example how the unary plus (+) operator is overloaded. 7m
17) Define class “Time” having integer data members hours, mins and secs. Create 3 objects
of this class T1, T2, T3. The data members of T1 and T2 are initialized from keyboard
and data members of object T3 are obtained from addition of data member of object T1
and T2. Use + operator friend function for overloading. 13m
18) Write C++ program to overload „+‟ operator to carry out concatenation of strings. 7m
19) What is a conversion function? How is it created? Explain its syntax. 6m
20) Define a class STRING with two STRING objects. Use overloaded „==” operator to
compare two STRING objects.

KNK_OOP
Question bank Unit V

1) What is visibility mode? What are different inheritance visibility modes supported by
C++? Explain. 6/7m
2) What is a virtual function? Why does we need virtual function? 6m
3) What is inheritance? How to define a derived class? Write advantages of inheritance.
7m
4) What are different forms of inheritance? Give an example for each. 7m
5) With suitable example explain multiple inheritance. 6m
6) What is the difference between normal member function and virtual member function in
inheritance? Explain with suitable program. 7m
7) What are pure virtual functions? How do they differ from normal virtual functions? 6m
8) Describe the rules for implementing virtual functions in C++. 6m
9) With suitable example, explain single inheritance. 6m
10) With suitable example, explain multilevel inheritance. 6m
11) What are abstract classes? Write a program having student as an abstract class and create
many derived classes such as Engineering, Science, Medical, etc. from student class.
Create their objects and process them. 7m
12) Write a C++ program to implement the structure shown below.
Class student has data members roll no and name. Class test has data members marks1
and marks2 and Class sports has data member sports marks. Define necessary member
functions in these classes. Class result has data member for total marks. Finally display
roll no, name, marks obtained and total marks.

student

test sports

result

13) Write a C++ program to implement the structure shown below using the concept of
virtual base class. Define necessary data members and member functions in the
respective class and finally display roll no, marks1, marks2, sports score and total result.

student

test sports

result

KNK_OOP
14) Consider the class structure shown in figure below. Class student stores name and roll no,
class test stores marks obtained in sub1 and sub2, class result contains total marks in sub1
and sub2 and class division contains the division student has passed based on the
percentage of marks. Create all classes and include necessary functions to read name and
roll no of student, read marks in sub1 and sub2, calculate total marks in sub1 and sub2
and division obtained and display the division obtained.

student

test

result

division

Question bank Unit VI

1) Explain why Java is known as a platform independent language? 6m


2) Write a program in Java that reads a number in meters, converts it to feets and displays
the result. 7m
3) Explain the structure of a Java program and mention the steps for executing a Java
program. 6m
4) What is „this‟ keyword in Java? Write a suitable program using „this‟ keyword. 7m
5) What are Java identifiers? List the rules of Java identifiers. 6m
6) What is method overloading? Explain with the help of a program. 7m
7) Write a Java program to calculate area of circle. 7m
8) Write a program in Java that accepts a series of resistances and outputs the equivalent
resistance when they are connected in series. 7m

KNK_OOP

You might also like