7
answers
0
watching
204
views
5 Dec 2018

21. (2 points) Create a class to represent rectangles. A rectangle is specified (as with drawing them in Processing) by the coordinates of its upper left corner, its width, and its height. Give your class just enough functionality to make it work with the program below. The display() method should simply draw the rectangle with no change in fill or stroke. Rectangle[] boxes = new Rectangle [100]; void setup() { size (400, 400); for (int i = 0; i < boxes.length; i++) { boxes[i] = new Rectangle((int) random (width), (int) random (height), (int) random (10,40), (int) random (5, 20)); void draw() { for (int i = 0; i < boxes.length; i++) { fill (random (255), random (255), random (255)); boxes[i].display();

For unlimited access to Homework Help, a Homework+ subscription is required.

Unlock all answers

Get 1 free homework help answer.
Already have an account? Log in
Already have an account? Log in
Already have an account? Log in
Already have an account? Log in
Already have an account? Log in
Already have an account? Log in
Patrina Schowalter
Patrina SchowalterLv2
6 Dec 2018
Already have an account? Log in
Start filling in the gaps now
Log in