Code

size (500,100);
smooth();
for (int c=1; c<=10; c++){
   if( c > 6){
      fill(255,0,0);
        ellipse(25 +(c*40) ,50,  20,20);
   }
   else{
  fill (0);
  ellipse(25 +(c*40) ,50,  20,20);
 }
}

0208 - Conditionals within a for{} loop II: Combining if{} and for{}

Statement:For this assignment, you are limited to a single for{} loop. Assignments using more than one for{} loop will not be credited.
Use an inequality test, embedded inside a for{} loop, to produce the figure shown here (and below), which is very similar to your previous image. (An "inequality test" is a comparison like greater-than, less-than, greater-than-or-equal, or less-than-or-equal.)


hide statement