Please help me soplve the programming problem that has been given to me as homework. I know its bad to get the source from someone else, but plezz help Im a newbie and have no idea what friend functions do: :blink:
Create 2 classes DM and DB which store the value of distance. DM store distances in meters and cm and DB in feet and inches. Write a program that can read values for the class objects and add one object DM with another object of DB.
Use a friend function to carry out the addition operation the object that stores the results may be a DM object or a DB object, depending upon the units in which the results are required. The display should be in the format of feet and inches or meters and cms depending on the object on display.
PS: I'll study what friend function means this weekend. But have to do this homework submission by tomorrow, so plezzz help. I know this may be a cakewalk for most C++ programmers, but Im still a school student.
Question
sunbiz_3000
Please help me soplve the programming problem that has been given to me as homework. I know its bad to get the source from someone else, but plezz help Im a newbie and have no idea what friend functions do: :blink:
Create 2 classes DM and DB which store the value of distance. DM store distances in meters and cm and DB in feet and inches. Write a program that can read values for the class objects and add one object DM with another object of DB.
Use a friend function to carry out the addition operation the object that stores the results may be a DM object or a DB object, depending upon the units in which the results are required. The display should be in the format of feet and inches or meters and cms depending on the object on display.
PS: I'll study what friend function means this weekend. But have to do this homework submission by tomorrow, so plezzz help. I know this may be a cakewalk for most C++ programmers, but Im still a school student.
Link to comment
Share on other sites
15 answers to this question
Recommended Posts