A program using friend function in C++

Are you searching for a solution for using functions in C++? Searching for the program and explanation to attempt the BTech Object Oriented Programming Exam? Scroll through the answers on this Ask Expert page and prepare for your exam.

Following is a question that was asked in the question paper of GUJARAT TECHNOLOGICAL UNIVERSITY for BE Semester-V(Winter 2016) for subject Object Oriented Programming using C++(152004).

This question is asked for 07 marks and hence requires some explanation along with the program code. Please let me know the solution -
Q) Create two classes DM and DB which store the value of distances. DM stores
distances in meter and centimeters and DB in feet and inches. Write a program
that read values of the class objects and add one object of DM with another object
of DB.[7 Marks]