Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Project 2 Object Conversion and Composition 15 points fr. Program Challenge Chap14-12. Land Tract Class In this project, you are to make one object to
Project 2 Object Conversion and Composition 15 points fr. Program Challenge Chap14-12. Land Tract Class In this project, 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 Land Tract 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 9 - Quit Enter your choice: m LandTract Class Test Menu m - menu n - new LandTract d - display the LandTract attributes 9 - 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: 9 Program exit! Starter (Github/m06/PRJ2) testLandTrac.cpp Feetinches.h (same as in Github/m03) LantdTrac.h (data member only) Submit: o appLandTract.cpp o Land Tract.h o Feetinches.h o Test run validation
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