Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C# Programming : Create a housing application for a property manager. Include a

ID: 3674771 • Letter: C

Question

C# Programming :

Create a housing application for a property manager. Include a base class named Housing. Include data characteristics such as address and year built. Include a virtual method that returns the total projected rental amount. Define an interface named IUnits that has a method that returns the number of units. The MultiUnit class should implement this interface. Create subclasses for MultiUnit and SingleFamily. SingleFamily should include characteristics such as size in square feet and availability of garage. MultiUnit might include characteristics such as the number of units. Create .DLL components for the housing classes. Define a presentation class to test your design.

Explanation / Answer

Ok well this is telling you a few things. You are going to have a class called Housing. You are going to inherit from it. This class has a few data members called "address" and "year_built". It will also have a virtual method. This means that the method actually has no body in the housing class, but instead makes it so that you have to inherit from it.

In this class you need to define an interface (study the first example there) called IUnits. Interfaces define methods that any class which implements the interface must then provide code for. This interface has a method that will eventually return the number of units. But again, the classes that implement the interface are the ones that will define this method. The interface just tells C++ what the class must have in the way of a method.

Now back to our Housing base class. We are going to derive a few classes from it. These are subclasses. They will be called MultiUnit and SingleFamily. So if you are keeping count you have three classes. 1 base class and 2 classes which will derive from it. Multiunit needs to know number of units, so it is going to implement the IUnits interface and define its method for returning the number of units it has. So MultiUnit will have a method that matches the interface. Interface says what that name is, the class will then provide the method.



Lastly, you have a class which will then be used to test your setup. That means it will do nothing but attempt to create derived MultiUnit and SingleFamily classes using the base class. It will then call the various methods including the method to get the number of units. It is used to test and prove your code is working as it should.

1 Housing Class (base)