Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

object oriented programming c++ You are to make one object to have-a other objects and make a object conversion to become-a another object. To create

object oriented programming c++

You are to

  • make one object to "have-a" other objects and
  • make a object conversion to "become-a" another object.

To create LandTract Class that utilize the FeetInches class in Lab3c (Github/m03) and write the following application.

Make a LandTract class that is composed of two FeetInches 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.

To calculate the area, the FeetInches objects have to be converted into double (in feet). You will need to implement the object conversion inside the FeetInches class to double in order to compute the area in square feet.

FeetInches::operator double()

The final output of this exercise shall display the area in square feet, and drop the fraction.

*Note: In the example below the output area is using square feet. The value of 42.169 square feet is the product of 5.50 * 7.67

Sample Test Run:

Running /home/ubuntu/workspace/comsc200/Week06/testLandTract.cpp _______ LandTract Class Test Menu __________ m - menu n - new LandTract d - display the LandTract attributes q - Quit Enter your choice: m _______ LandTract Class Test Menu __________ m - menu n - new LandTract d - display the LandTract attributes q - Quit Enter your choice: n Enter Tract Width in Feet, then Inches: Enter Feet: 5 Enter Inches: 6 Enter Tract Length in Feet, then Inches: Enter Feet: 7 Enter Inches: 8 Enter your choice: d the width is 5 feet, 6 inches the length is 7 feet, 8 inches the area is 42.169 square feet Enter your choice: m _______ LandTract Class Test Menu __________ m - menu n - new LandTract d - display the LandTract attributes q - Quit Enter your choice: q Program exit! 

Starter (Github/m06/PRJ2)

  • testLandTrac.cpp
  • FeetInches.h (same as in Github/m03)
  • LantdTrac.h (data member only)

Submit:

  • appLandTract.cpp
  • LandTract.h
  • FeetInches.h
  • Test run validation

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What triggers the conflict in this scene? LO.1

Answered: 1 week ago

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago