64.9k views
4 votes
randomFactory public static Shape randomFactory(int canvas_width, int canvas_height) Create a random shape. Create a random shape to fit on a canvas of the given size. The shape will be no larger than half the size of the canvas and will fit completely on it. Parameters: canvas_width - the width of the canvas being used. canvas_height - the height of the canvas being used. Returns: the generated shape.

User Keshava
by
5.5k points

1 Answer

6 votes

Answer:

import java.awt.Color;

import java.awt.Canvas;

import java.awt.Button;

import java.awt.Image;

import java.awt.Graphics;

import java.awt.Frame;

import java.awt.event.*;

import java.util.*;

/**

* Check attached images for the continuation of the code

* 5000 characters exceeded

* It appears that your answer contains either a link or inappropriate words error

*/

randomFactory public static Shape randomFactory(int canvas_width, int canvas_height-example-1
randomFactory public static Shape randomFactory(int canvas_width, int canvas_height-example-2
User Julesj
by
4.9k points