Create two classes dm and db which store the value of


Program

Create two classes DM and DB which store the value of distances. DM stores distances in meters 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 another object of DB.

Use a friend function to carry out the additional operation. The object that stores the result may be a DM object or DB object depending on the units in which the results are required. The display should be in the format of feet and inches or meters and centimeters depending on the object on display.

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Create two classes dm and db which store the value of
Reference No:- TGS01475441

Now Priced at $10 (50% Discount)

Recommended (99%)

Rated (4.3/5)