Day 2# Code re-usability, why it’s important!!

Today’s challenge was coming up with an everyday scenario of how OOP (Object Oriented programming) can be implemented, that was a challenge in itself. After 30 mins minutes of drawing blanks, My father called me and he was going on and on about how he feels that his properties are mismanaged and he finds it difficult to keep track of where his proceedings go to, Bingo! I found an everyday problem.

Now the challenge was to get all this logic and put it into a working model. I came up with a list of all the rent properties that he owns, which included land, Cars, and Houses. class Property(object): was born, and quickly realized that all these properties have some things in common, all of them have to be bought, sometimes they are sold and all have a rental income.

All these properties can be rented, but not all get the same amount of rental income and certainly not at the same rate, for instance, Houses are paid for each month, while The land rental is paid for at the end of each year, Hmm!, back to the challenge again, How do you put this method into the class Property?

Check out my Git-hub for a repository of this model.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.