Question: java /** * Returns a String of length width that begins and ends with the character edge and contains width-2 copies of the * character
java
/** * Returns a String of length width that begins and ends with the character edge and contains width-2 copies of the * character inner in between. The method does not print anything. * * Example makeLine('+', '-', 8) is "+------+". * * IMPLEMENTATION NOTE: Use an accumulation loop * * @params width must be >= 2 */
/** * Returns a string which, when printed out, will be a rectangle shaped something like this: * *
* +----------+ * | | * | | * | | * | | * | | * +----------+ ** * The returned string should consist of height lines, each ending with a newline. In addition to the newline, the * first and last lines should begin and end with '+' and should contain width-2 '-' symbols. In addition to the * newline, the other lines should begin and end with '|' and should contain width-2 spaces. The method does not * print anything. * * IMPLEMENTATION NOTE: For full credit (and for easier implementation), make use of the makeLine method in your * implementation of makeRectangle. Use an accumulation loop. * * @param height must be >= 2 * @param width must be >= 2 */
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
