Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please submit a report on the Assignment submission page with the solution to the next problems: Analyze the following problem: Gaddis, 2 0 1 5
Please submit a report on the Assignment submission page with the solution to the next problems:
Analyze the following problem: Gaddis, Programming Challenger, FeetInches Modification,
Feetlnches Class Copy Constructor and multiply Function and LandTract Class Chapter page
Feetlnches Modification
Modify the Feetlnches class discussed in this chapter so it overloads the following
operators:
Demonstrate the class's capabilities in a simple program.
Feetlnches Class Copy Constructor and overload the multiply operator function
Add a copy constructor to the Feetlnches class. This constructor should accept
a Feetlnches object as an argument. The constructor should assign to the feet
attribute the value in the argument's feet attribute, and assign to the inches attribute
the value in the argument's inches attribute. As a result, the new object will be a copy
of the argument object.
Next, add a multiply member function to the Feetlnches class. The multiply
operator function should accept a Feetlnches object as an argument. The argument object's feet and
inches attributes will be multiplied by the calling object's feet and inches
attributes, and a Feetlnches object containing the result will be returned.
LandTract Class
Make a LandTract class that is composed of two Feetlnches objects, one for the
tract's length and one for the width. The class should have a member function that
returns the tract's area. Demonstrate the class in a program that asks the user to enter
the dimensions for two tracts of land. The program should display the area of each
tract of land and indicate whether the tracts are of equal size.
Use the textbook code of Feetlnches class, defined in Feetlnches.h Version page to solve the
problems.
The solution must contain the following:
a pts Source code.
b pts Separate class specifications from implementation.
c pts Program output. Show the operation of the copy constructor and each of the operators defined in
its class, in the drive program.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started