Question: Add a width parameter to your drawFigure method from Exercise #3G.2 Hint: You really just need to work on the drawFigure method, as I've written
Add a width parameter to your drawFigure method from Exercise #3G.2
Hint: You really just need to work on the drawFigure method, as I've written main already:
Upload MickeyBoxMany.java with a main method as shown below, and upgrade your drawFigure method from text Exercise 3G.2 to add a parameter for the size (width) of the Mickey figure.
The text Exercises all have a Mickey of width 120 (from 20 + 80 + 20), and now we'll use the additional width parameter to resize Mickey. Start with the following code:
// CS210 many Mickey Boxes public class MickeyBoxMany { // CLASS constant public static final int N = 10; // how many // required main method public static void main(String[] args) { int sizeX = 800; // width int sizeY = sizeX / N; // scale height DrawingPanel panel = new DrawingPanel(sizeX, sizeY); panel.setBackground(Color.YELLOW); // as in text Graphics g = panel.getGraphics(); // Oracle Graphics int width = sizeX / N; // divides up the width for (int i=0; i // you write this drawFigure method: drawFigure(g, x, y, width); // size parameter added } } For example, in the code above, with N=2, I get 2 Mickey boxes that are large:

But when I change the Class constant N for number of Mickey to 10, they must be smaller:

Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
