Grid: | ||
Tics Lines: |
|
Width
px
|
Hash Lines: |
|
Width
px
|
Labels: |
|
Font
px
|
Trace Lines: | ||
Robot 1: |
|
Width
px
|
Robot 2: |
|
Width
px
|
Robot 3: |
|
Width
px
|
Robot 4: |
|
Width
px
|
Axes: | x-axis | y-axis | Show Grid |
Grid: | 24x24 inches | 36x36 inches | 72x72 inches |
96x96 inches | 192x192 inches | ||
Quad: | 4 quadrants | 1 quadrant | Hardware |
Units: | US Customary | Metric |
Background: |
![]() |
|
|
|
|
|
|
|
|
|
Run the program and find the pattern for the sequence of numbers. Use the pattern to find the fourth number in the sequence.
/* Code generated by RoboBlockly v2.0 */ /* Problem Statement: Run the program and find the pattern for the sequence of numbers. Use the pattern to find the fourth number in the sequence.*/ #include <chplot.h> double n; CPlot plot; int count; int count2; // This is a sample solution printf("Please complete the sequence: 20, 5, -10, ___ . The 4th number is -25."); printf("The numbers of stars will appear in order of the sequence. If the number is negative, it will be hexagons."); for(i = 0; i <= 3; i++) { //plot.backgroundImage("stars.png"); n = 20 + -15 * i; if (n >= 0) { count = 0; while(count < n) { plot.strokeColor(randcolor()); plot.star(randdouble(-12, 24), randdouble(-12, 24), 1.5, 0); count = count + 1; } } else { double repeat_end = abs(n); count2 = 0; while(count2 < repeat_end) { plot.strokeColor(randcolor()); plot.regularPolygon(randdouble(-12, 24), randdouble(-12, 24), 5, 1, 30); count2 = count2 + 1; } } delaySeconds(1); } plot.strokeColor("yellow"); plot.text("You are correct! Well done!", PLOT_TEXT_LEFT, -6, 8); plot.label(PLOT_AXIS_XY, ""); plot.grid(PLOT_OFF); plot.tics(PLOT_AXIS_XY, PLOT_OFF); plot.axis(PLOT_AXIS_XY, PLOT_OFF); plot.axisRange(PLOT_AXIS_XY, -12, 24); plot.ticsRange(PLOT_AXIS_XY, 6); plot.sizeRatio(1); plot.plotting();
Problem Statement: Run the program and find the pattern for the sequence of numbers. Use the pattern to find the fourth number in the sequence. |
|||||||||||
|
|||||||||||