Question: C++ #include #include #include using namespace std; / The Feet Inches class holds distances measured in feet and inches. class Feet Inches { private: int

 C++ #include #include #include using namespace std; / The Feet Inches
class holds distances measured in feet and inches. class Feet Inches {
private: int feet; // The number of feet int inches; // TheC++
number of inches /** The simplify method adjusts the values in feet
and inches to conform to a standard measurement. */ void simplify {
if (inches > 11) { feet = feet + (inches/12); inches =

#include #include #include using namespace std; / The Feet Inches class holds distances measured in feet and inches. class Feet Inches { private: int feet; // The number of feet int inches; // The number of inches /** The simplify method adjusts the values in feet and inches to conform to a standard measurement. */ void simplify { if (inches > 11) { feet = feet + (inches/12); inches = inches * 12; 2 / This constructor assigns to the feet and inches fields. public: Feet Inches) { feet = 0; inches = 0; ) This constructor accepts two arguments which are assigned to the feet and inches fields. The simplify method is then called. @param The value to assign to feet. @param 1 The value to assign to inches. / Feet Inches(int f, int i) { feet = f; inches = 1; simplify(); 3 The following is a copy constructor. It accepts a reference to another Feet Inches object. The feet and inches fields are set to the same values as those in the argument object. @param object2 The object to copy. ./ Feet Inches (const Feet Inches& object2) feet = object2.feet; inches = object2. inches; { ) / The setFeet method assigns a value to the feet field. @param f The value to assign to feet. void setFeet(int f) { feet = f; } / The set Inches method assigns a value to the inches field. @param 1 The value to assign to inches. * void setInches(int 1) { inches = i; simplify(); ) /. get Feet method @return The value in the feet field. */ int getFeet() ( return feet; 3 /*. getInches method @return The value in the inches field. */ int get Inches) { return inches; print method prints the distance as feet/inches void print() { cout > ft; cout > in; g. setFeet(ft); g. set Inches(in); cout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!