Question: IN JAVA PLEASE! This exercise will use an interface to draw a framed graphic to the console. The frame consists of 2 characters: a framing
IN JAVA PLEASE!
This exercise will use an interface to draw a framed graphic to the console. The frame consists of 2 characters: a framing character and a fill character. For example, if the framing character is x and the fill character is #, a frame may appear as:
xxxxx
x###x
x###x
xxxxx
Note that this frame has a dimension of 3 columns and 2 rows surrounded by the framing character. Your interface must provide for all four pieces (framing character, fill character, columns, and rows) as by changing the values of this data will allow the drawing of different frames. As a second example, if the following values:
framing character: $
fill character: *
columns: 4
rows: 3
The following frame must appear:
$$$$$$
$****$
$****$
$****$
$$$$$$
To facillitate this, create an interface named edu.udc.framing.FrameI. FrameI must include the following 4 methods:
public char getFramer();
public char getFiller();
public int getRows();
public int getCols();
Create a public class called edu.udc.cs2.Util.
In the Util class create a public static method called drawFrame(FrameI). The drawFrame method must be written so that the table is output according to the values in the FrameI parameter.
The only classes required to turn in are FrameI and Util. To test your code, you will create a class to implement the FrameI interface. You do not need to turn in such a class. My tests will implment your FrameI interface as well as test the drawFrame method. Ensure you spell the methods and classes correctly along with the package names.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
