Question 2 14 Points Define Class Distance Two Private Data Members Feet Inch Class Follo Q43809163(1)
c++
Question 2: ( 14 points) A. Define a class Distance that has two private data members: feet and inch. The class has the following functions only: A constructor that initializes feet and inch to 0. A input Distance function to input the data from the user. A showDistance function to print the distance. B. Write a non-member function min which returns the smallest of two Distance objects, which are passed to the function. C. Write a main program that defines two Distance objects from the user. Compare them and display the details of the smallest. Hint: 1 feet equals 12 inches Show transcribed image text Question 2: ( 14 points) A. Define a class Distance that has two private data members: feet and inch. The class has the following functions only: A constructor that initializes feet and inch to 0. A input Distance function to input the data from the user. A showDistance function to print the distance. B. Write a non-member function min which returns the smallest of two Distance objects, which are passed to the function. C. Write a main program that defines two Distance objects from the user. Compare them and display the details of the smallest. Hint: 1 feet equals 12 inches
Expert Answer
Answer to Question 2: ( 14 points) A. Define a class Distance that has two private data members: feet and inch. The class has the …
OR