Barobo
PortalSign In
HomeShopTutorialsFree CurriculumHour of Code
RoboBlockly for Learning Math and Coding

Piano
Linkbot Image Mindstorm Image Cursor Image
0x36302418126y36302418126
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
Labels: x-axis y-axis Show Grid
Grid: 12x12 inches 24x24 inches 36x36 inches
72x72 inches 96x96 inches 192x192 inches
Quad: 4 Quadrants 1 Quadrant 1&4 Quadrants
Units: US Customary Metric
Background: Background Image

Robot 1

Linkbot
Mindstorm
Initial Position:
( in, in)
Initial Angle:
deg
Current Position: (0 in, 0 in)
Current Angle: 90 deg
Wheel Radius:
Track Width:
in

Robot 2

Linkbot
Mindstorm
Initial Position:
( in, in)
Initial Angle:
deg
Current Position: (6 in, 0 in)
Current Angle: 90 deg
Wheel Radius:
Track Width:
in

Robot 3

Linkbot
Mindstorm
Initial Position:
( in, in)
Initial Angle:
deg
Current Position: (12 in, 0 in)
Current Angle: 90 deg
Wheel Radius:
Track Width:
in

Robot 4

Linkbot
Mindstorm
Initial Position:
( in, in)
Initial Angle:
deg
Current Position: (18 in, 0 in)
Current Angle: 90 deg
Wheel Radius:
Track Width:
in
Draw a Pie Chart
/* Code generated by RoboBlockly v2.0 */
#include <chplot.h>
double v1;
double v2;
double v3;
double v4;
double v5;
double total;
double start;
double end;
double i;
CPlot plot;

v1 = 5;
v2 = 6;
v3 = 7;
v4 = 8;
v5 = 9;
total = ((v1 + v2) + v3) + (v5 + v4);
start = 0;
end = (double(v1)/total) * 360;
plot.noStrokeColor();
for(i = 1; i <= 5; i++) {
  plot.fillColor(randcolor());
  plot.arcSector(18, 18, 10, start, end);
  if (i == 1) {
    start = end;
    end = start + (double(v2)/total) * 360;
  }
  else if (i == 2) {
    start = end;
    end = start + (double(v3)/total) * 360;
  }
  else if (i == 3) {
    start = end;
    end = start + (double(v4)/total) * 360;
  }
  else if (i == 4) {
    start = end;
    end = start + (double(v5)/total) * 360;
  }
  else {
    start = end;
    end = 0;
  }
}
plot.strokeColor("black");
plot.strokeWidth(2);
plot.text("5/35", PLOT_TEXT_LEFT, 22, 20);
plot.text("6/35", PLOT_TEXT_LEFT, 17, 23);
plot.text("7/35", PLOT_TEXT_LEFT, 10, 20);
plot.text("8/35", PLOT_TEXT_LEFT, 11, 13);
plot.text("9/35", PLOT_TEXT_LEFT, 20, 13);
plot.text("1 star", PLOT_TEXT_LEFT, 30, 26);
plot.text("2 stars", PLOT_TEXT_LEFT, 17, 32);
plot.text("3 stars", PLOT_TEXT_LEFT, 2, 26);
plot.text("4 stars", PLOT_TEXT_LEFT, 5, 4);
plot.text("5 stars", PLOT_TEXT_LEFT, 25, 4);
plot.line(29, 25, 26, 22);
plot.line(19, 30, 19, 25);
plot.line(5, 25, 10, 22);
plot.line(7, 6, 12, 12);
plot.line(25, 6, 23, 12);
plot.grid(PLOT_OFF);

plot.axisRange(PLOT_AXIS_XY, 0, 36);
plot.ticsRange(PLOT_AXIS_XY, 6);
plot.sizeRatio(1);
plot.plotting();
Load Blocks
Hardware
LArduino
Workspace Show Ch Save File
Problem Statement:
The pre-placed blocks draw a pie chart of equal thirds. Using the arc sector block, create a pie chart that represents the reviews for a movie reviewed by several people. 5 people gave it 1 star, 6 gave it 2 stars, 7 gave it 3 stars, 8 gave it 4 stars, and 9 people gave it 5 stars. Label the pie chart.

		
Rubbish bin
Time