Put the class definition in House.h and the implementation of the constructors and functions in House.cpp 1. Define a class called "House", that represents the information of a house. A House is defined with these attributes: age (int), type (string) (for example Detached, Semi-Attached, Attached) and build_cost (double). Functions of the House class must perform the following operations: ✓ A default constructor which sets all the numeric instance variables to zero and the String instance variables to empty String. ✓ A constructor with 3 parameters which sets the 3 instance variables to the corresponding values passed. ✓ Implement a getter function for each of the 3 instance variables that will return the value of the instance variable. For example, the getX() function for the instance variable type must be called getType(). ✓ Implement a setter function for each instance variable that will assign to the instance variable to the value passed. For example, the setX() function for the instance variable type must be called setType(). ✓ An Estimate Price function: This function estimates the price of a house based on the build_cost and age. The house price is increased by 1% of the build_cost yearly. For example if the build_cost for a house is 100000 and the age of this house is 2, the EstimatPrice() function returns 102000 (100000+2* (0.01*100000)) ✓ A Similar function: This function has one input parameter which is a pointer to a House object. This function compares two houses and it returns true if both of them have the same age and type. ✔ A ComparePrice function: This This function has one input parameter which is a pointer to a House object. This function compares the price of two houses (using the Estimate Price function) and returns a string based on the comparison results as follows: - If the price of the first house is higher, ComparePric function returns this string: House 1 is more expensive" - If the price of the second house is higher, ComparePric function returns this string: House 2 is more expensive"
Put the class definition in House.h and the implementation of the constructors and functions in House.cpp 1. Define a class called "House", that represents the information of a house. A House is defined with these attributes: age (int), type (string) (for example Detached, Semi-Attached, Attached) and build_cost (double). Functions of the House class must perform the following operations: ✓ A default constructor which sets all the numeric instance variables to zero and the String instance variables to empty String. ✓ A constructor with 3 parameters which sets the 3 instance variables to the corresponding values passed. ✓ Implement a getter function for each of the 3 instance variables that will return the value of the instance variable. For example, the getX() function for the instance variable type must be called getType(). ✓ Implement a setter function for each instance variable that will assign to the instance variable to the value passed. For example, the setX() function for the instance variable type must be called setType(). ✓ An Estimate Price function: This function estimates the price of a house based on the build_cost and age. The house price is increased by 1% of the build_cost yearly. For example if the build_cost for a house is 100000 and the age of this house is 2, the EstimatPrice() function returns 102000 (100000+2* (0.01*100000)) ✓ A Similar function: This function has one input parameter which is a pointer to a House object. This function compares two houses and it returns true if both of them have the same age and type. ✔ A ComparePrice function: This This function has one input parameter which is a pointer to a House object. This function compares the price of two houses (using the Estimate Price function) and returns a string based on the comparison results as follows: - If the price of the first house is higher, ComparePric function returns this string: House 1 is more expensive" - If the price of the second house is higher, ComparePric function returns this string: House 2 is more expensive"
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
100%
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education