Question: c++ Question 2: ( 14 points) A. Define a class Distance that has two private data members: feet and inch. The class has the following
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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
