Why is class Details derived from class Property? This doesn't seem right. Details has the array of Property which is as expected.
What do you mean by doesn't seem right? I'm not quite sure.
The code mentions polymorphism. There's no polymorphism here. Details::statement() will execute the Details function and Property::statement() will execute the Property statement.
Is it not basic polymorphism? We were told to apply the basic polymorphism and I followed the one example from w3school's polymorphism.
There is no requirement for no in Property. But Details should maintain a variable for the number of properties elements used. Should no be in Details and not Property?
There are other code issues, but you need to get the design right before we get into the coding issues.
You are right. However, I have not much time until my due date. I had to work these codes in between my exam week as well which must be why the code design is not up to good.