Question: Program in Processing 4. Draw 5 circles: Draw a canvas of size 600 x 400. Draw 5 circles (ellipses) in a horizontal row, beginning at
Program in Processing
4. Draw 5 circles: Draw a canvas of size 600 x 400. Draw 5 circles (ellipses) in a horizontal row, beginning at point (100, 200), with each circle of size 75 pixels, each circle a different fill color, and each circle separated from one another by 25 pixels (i.e., points (100, 200); (200, 200); (300, 200); (400, 200); and (500, 200)).
5. Draw 5 orange circles using a repeating For loop: Draw a canvas of size 600 x 400. Repeat activity 4, except this time use a repeating For loop in your code and only one ellipse command. Make all circles the same color of orange.
6. Draw 50 colored squares using a repeating For loop: Draw a canvas of size 800 x 600. Draw 50 colored squares of random position (random x, random y), random size, and random color (random R, G, and B values). Use a repeating For loop in your code and only one rectangle command. Use integer (int) variables posX, posY, size, Rvalue, G value, and B value, along with the random (x,y) function to create and store random square positions, sizes and colors before displaying each square.
7. Draw the Solar System: Draw a canvas of size 800 x 600 with a black background color. Using the details provided on the following page (i.e., relative planet sizes and distances from the Sun), draw an approximation of the solar system (Sun + 8 planets as circles, in a horizontal line, as shown below). Use three 9-element arrays to store display data (size, color, and distance from the Sun). Decide on a starting (x,y) position for the Sun, and then use a For loop to display the nine entities.



jupiter Saturn Neptune Earth Venus Mercury Planets in Order of Size: Planet Diameter (km) Mercury 4879.4 Planets in Order of Distance from the Sun: Planet Distance from the Sun (AU/KM) Mercury 0.39 (57.9 million Venus 0.723 (108.2 million Earth 1 (149,6 million) Mars 6779 Venus 12104 Earth 12756 Size relative to Earth 38% the size of Earth 53% the size of Earth 95% the size of Earth 100% the size of Earth 388% the size of Earth 400% the size of Earth 945% the size of Earth 1120% the size of Earth Mars 1.524 227.9 million) Neptune 49528 Jupiter 5.203 778.3 million) Uranus 51118 Saturn 9.539 (1,427.0 million) Saturn 120660 Uranus 19.18 12.871 million) Jupiter 142800 Neptune 30.06 (4.497.1 million) Sun Diameter: Sun Volume: Absolute Relative 1 391 000 km x109 1 412 000x1012 x1 304 km 000 1 988 500x1024 kg x333 000 274 m/s2 x28 Mass: Earth Gravity: Sun Current Distance Moons: Star type: Gas From Sun: From Earth: 147.194 Mil. km
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
