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();
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();
29 Jun 2023
rosi10agarwalLv10
29 Mar 2023
Already have an account? Log in
syedazmath1627Lv10
3 Feb 2023
Already have an account? Log in
Patrina SchowalterLv2
6 Dec 2018
Already have an account? Log in