Oop With.c++ - 5-12-18
Oop With.c++ - 5-12-18
Subject Name: Object Oriented Paradigm with C++ Subject Code: BTITC303
Max Marks: 60 Date:05/12l18 Duration: 3 Hr.
Instructions to tlte Studenls:
1. All que,stions are compulsory.
2. The level question/expected answer as per OBE or the Cottr,se Oulcome (CO) on
which lhe question is based is mentioned in front of the question.
3. Use of non-programmable scientific calctrlators is allowed.
4. A,ssume suitable data wherever nece,\sary.and mention it clearly.
(Level Marks
/co)
Q.I Solve Any Two of the following.
A) What is an algorithm? What is/are the need(s) of writing algorithm? COl 6
What is class diagram? What are the components of class diagram? Explain
with the help of diagram.
B) What is reference variable? What is its rnajor use? CO5 6
Write a function using reference variable as argument to sr,vap the values of pair
of integers.
C) i. Enumerate the rules of naming variables in C++. How do they diff-er fiom CO5 6
ANSI C rules?
ii. Describe the major parts of C++ program. How does a main function in C++
ii. What is an exception? How is an exception handled in C++? What are the
advantages of using exception handring mechanism in a program?
when should
a program throws an exception?
:'Class'DisderivedfromclassB.TheclassDdoeSnotcontainanydata
members of its own. Does the class D require constructors? If yes, why?
modified.
B) Creatstwociasses DMandDB which storesthe value of distances. DM stores CO2 12
distances in meter and centimeters and DB in feet and inches. Write a program
that can read values for the class objects and add one object of DM with
Use friend function to carry out the addition operation. The object that stores
the results may be DM object or DB object, depending on the units in which the
results are required. The result should be in the format of feet and inches or
meters and centimeters depending on the object on display.