Create an Investment class that contains fields to hold the initial value of an investment, the current value, the profit (calculated as the difference between current value and initial value), and the percent profit (the profit divided by the initial value). Include a constructor with two arguments: initial, and current values and then calculate profit, and percent profit, and a display function that displays all fields. Create a House class that includes fields for street address and square feet, a constructor that requires values for both fields, and a display function. Create a HouseThatIsAnInvestment class that inherits from Investment and House. It includes a constructor (in order to pass arguments to its parent constructors) and a display function that calls the display functions of the parents. Write a main() function that declares a HouseThatIsAnInvestment and displays its values.
Create an Investment class that contains fields to hold the initial value of an investment, the current value, the profit (calculated as the difference between current value and initial value), and the percent profit (the profit divided by the initial value). Include a constructor with two arguments: initial, and current values and then calculate profit, and percent profit, and a display function that displays all fields. Create a House class that includes fields for street address and square feet, a constructor that requires values for both fields, and a display function. Create a HouseThatIsAnInvestment class that inherits from Investment and House. It includes a constructor (in order to pass arguments to its parent constructors) and a display function that calls the display functions of the parents. Write a main() function that declares a HouseThatIsAnInvestment and displays its values.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 4 images