size (600, 600);
// More conditions (Activity 11)
int hoffset = 15;
int initialvalue = 24 ;
String msg;
int cpt = 0;
int value = 0;
int cptred = 0;
int cptgreen = 0;
int cptblue = 0;
for(int i = 0; i <= initialvalue ; i++){
cpt++;
value = i ;
if ((value % 2 ) == 0 && (value % 5 ) == 0 ) { // If the number is even and it is also divisible by 5, then it should be displayed as green.
fill(0,150,0);
msg = " " + value ;
text(msg, 20, cpt * hoffset);
cptgreen++;
}
else if ((value % 2 ) == 0) { //If the number is even, then you should display the number as red.
fill(255,0,0);
msg = " " + value ;
text(msg, 20, cpt * hoffset);
cptred++;
}
else { // If it is any other number, display it as blue.
fill(0,0,255);
msg = " " + value ;
text(msg, 20, cpt * hoffset);
cptblue++;
}
}
cpt++;
msg = "Total even numbers ( red ) ==> " + cptred;
fill(255,0,0);
text(msg, 20, (cpt * hoffset)+10);
cpt++;
fill(0,150,0);
msg = "Total even numbers divisible by 5 (green) ==> " + cptgreen;
text(msg, 20, (cpt * hoffset)+10);
cpt++;
fill(0,0,255);
msg = "Total other numbers (blue) ==> " + cptblue;
text(msg, 20, (cpt * hoffset)+10);
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}