In: Computer Science
Design and build objects to be used by a real estate company for listing the properties for sale. A base object of a property is necessary. Decide what common about all properties and include these in the property object. Different type of properties are land, commercial and residential. A residential property can be single family and multi family. A commercial can be a commercial can be either a farm or non-farm.
Look at real estate websites and decide what to include in each object. Provide the UML that shows the objects and the relationship. Write the code for all the objects and submit hard copy of the UML and the code.
class Person { public Person() { name = "YetToBeNamed"; birthdayYear = 1999; // my default } public Person(String givenName, int yearOfBirth) { name = givenName; birthdayYear = yearOfBirth; } public String getName() { return name; } public String changeName(String name) { String aux; aux = this.name; this.name = name; return aux; } public int getAgeInYears(int currentYear) { return currentYear - birthdayYear; } private String name; private int birthdayYear; public static void main(String[] args) { Person a = new Person(); Person b = new Person("Richard P. Feynman", 1918); String name = a.changeName("The Next Richard Feynman"); System.out.println( "Physicist " + name + " makes big " + "discovery, touted as " + a.getName() ); System.out.println( b.getName() + " was " + b.getAgeInYears(1945) + " in 1945, in May. " ); } }