In: Computer Science
House Class The first class you should develop is a House class, as defined in the assignment specification. As we have not yet covered inheritance or association, we will not be integrating Banner this week — you will still be writing it for later usage though. Hence, the complete class should be implemented as defined in the UML below (please see the note on interpreting UML). You should maintain the order of the class fields in field declarations, and parameter orders (alternate constructor and setters). House - name - years - bannermen - castle + clone(): House + toString(): String The validation requirements for all of these fields can be found in the assignment specification. Begin by specifying the class name, constants (there should be a couple), and class fields. Next develop the default constructor, remember the default constructor should take no parameters and construct a valid object, what constitutes appropriate values for a default constructor is left to your discretion. Now complete your alternate constructor, remember to deal with validation as necessary and to indicate when/if the submodule can FAIL. The parameter order should be the same as the order in which your class fields are declared. The final constructor to complete is the copy constructor. A copy constructor should take in an object of the same class, use the accessors to retrieve the object state and initialise the class fields. The next method to focus on is clone. Clone should take no imports and return a copy of the current object. You may do this by using the copy constructor and passing it this. Clone is very similar to the copy constructor but without the requirement to specify the class name, this will be extremely useful once we cover inheritance. Complete the getters, equals, toString (see the note), and mutators (in that order) as per the examples and lecture slides. Take note that at this point you cannot yet implement battleStrengthand population, this method will be added in and completed in a later practical. Once your design is checked by a tutor you can convert your design to java.
Testing House Class, you need to develop a test harness for your House class. Your test harness should test (either directly or indirectly) every submodule you wrote for House.
Army Class
Next you need to develop Army, again the details for validation can be found in the assignment specification. you should continue to follow the order of, constructors, accessors, equals, toString, mutators in that order. Army - name - years - footmen - archers - history + clone(): Army + toString(): String Follow the same process as above to develop the design and then convert it to Java. Do not forget to create a test harness for this class as well.
Banner Class
The last class you need to develop this week is Banner, approach this class in the same manner as the previous two classes. Once again the validation details can be found in the assignment specification, the class should be implemented according to the following UML: Banner - sigil - bannerColour - sigilColour + clone(): Banner + toString(): String Once you have completed your pseudcode design and implemented in Java you need to create a test harness for this class as well.