Question: Language is C++ 3. Area Calculator Create a class called Area that uses two variables (length, and width) of type Distance to model the area

Language is C++Language is C++ 3. Area Calculator Create a class called Area that

3. Area Calculator Create a class called Area that uses two variables (length, and width) of type Distance to model the area of a rectangle. Initialize a variable of type Area to specific dimensions (taken as input). Overload the double operator, so that Area object can be converted to double value, returning area in square feet. To calculate the area, convert each dimension from a Distance variable to a variable of type double representing feet and fractions of a foot, and then multiply the resulting two numbers. 1 v #include 2 3 using namespace std; 4 5 struct Distance 6 int feet, inches; 7 }; 8 9 // Write the Area class here, and overload the double operator in it. 10 11 vint main() { 12 int li, 12, wl, W2; 13 cin>>li>>w1>>12>>w2; 14 Area areal = {{li, wl}, {12,w2}}; 15 16 double decimalArea = areal; // overload the double operator to convert area object into decimal value. 17 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!