JMU
Going Further on Programming Assignment 3


These questions/problems/tasks allow you to go further on Programming Assignment 3. They are neither required nor for extra credit. They will, however, help you gain a deeper understanding of the material.
1 Enhancements to the TextFormatter Class: Add the following methods to the TextFormatter class:


1.1 Right Justification
Add the following method:
    /**
     * Right justify a multi-line String (i.e., a String with embedded
     * newline characters) in a field of given width.
     *
     * If a line is too wide, it is not changed in any way.  Otherwise,
     * spaces are added to the beginning of the line so that it is
     * exactly width characters wide.
     *
     * @param s      The multi-line String to justify
     * @param width  The width of the field
     * @return       The justified multi-line String
     */
    public static String flushRight(String s, int width)
    


1.2 Right and Left Justification
Add the following method:
    /**
     * Right and left justify a multi-line String (i.e., a String with embedded
     * newline characters) in a field of given width.
     *
     * If a line is too wide, it is not changed in any way.  Otherwise,
     * spaces are added between words so that it is exactly width 
     * characters wide.  The number of spaces between words are as
     * balanced as possible.  That is, the added spaces are evenly distributed.
     *
     * @param s      The multi-line String to justify
     * @param width  The width of the field
     * @return       The justified multi-line String
     */
    public static String flush(String s, int width)
    
2 Enhancements to the Design and Implementation of HomeBase: Change the design and implementation of HomeBase so that it includes the following:


2.1 A Land Class
Add a class that encapsulates empty land (sometimes also called a lot). This class must include the obvious relevant attributes as well as the utilities present (e.g., electricity, natural gas, water, sewer, and telephone).

Note: You may choose to add other classes and/or enumerated types.

Copyright 2011