- rect(350, 65, 190, 60);
- text("VARIABLE", 390, 100);
- text("'Variable' is a storage location paired with an associated symbolic name ,", xVar1, 180);
- text("which contains some known or unknown quantity or information referred to as a value.", xVar1-50, 220);
- ///////////////////////////////////////////////////////////////////////////////////////////////////
- text("kind of variable", xVar2-50, 260);
- line(xVar2-50, 265, xVar2+100, 265);
- text("- Byte : Contain the integer from -128 until to 127 and storage 1 byte. ", xVar2, 300);
- text("- Int : Contain the integer data type and storage 4 bytes. ", xVar2, 340);
- text("- float : Contain the decimal data type and storage 4 bytes. ", xVar2, 380);
- text("- Char : Contain the character data type and storage 2 bytes. ", xVar2, 420);
- ///////////////////////////////////////////////////////////////////////////////
- text("Assignment Operator", xVar3, 460);
- line(xVar3, 465, xVar3+205, 465);
- text("An assignment operator is the operator used to assign a new value to a variable, ", xVar3+50, 500);
- text("example the regularly usage.", xVar3, 540);
- text("+ (plus)", xVar3-50, 580);
- text("- (minus)", xVar3-50, 620);
- text("* (multiply)", xVar3+80, 580);
- text("/ (divide)", xVar3+80, 620);
- text("> (over)", xVar3+210, 580);
- text("< (less than)", xVar3+210, 620);
- text("= (eqaual)", xVar3+350, 580);
- text("!= (not equal)", xVar3+350, 620);
- text("&& (and)", xVar3+490, 620);
- text("|| (or)", xVar3+490, 580);
- text("% (modulation)", xVar3+610, 580);
- ///////////////////////////////
+text("VARIABLE", 390, 100);
+text("'Variable' is a storage location paired with an associated symbolic name ,", xVar1, 180);
+text("which contains some known or unknown quantity or information referred to as a value.", xVar1-50, 220);
+///////////////////////////////////////////////////////////////////////////////////////////////////
+text("kind of variable", xVar2-50, 260);
+line(xVar2-50, 265, xVar2+100, 265);
+text("- Byte : Contain the integer from -128 until to 127 and storage 1 byte. ", xVar2, 300);
+text("- Int : Contain the integer data type and storage 4 bytes. ", xVar2, 340);
+text("- float : Contain the decimal data type and storage 4 bytes. ", xVar2, 380);
+text("- Char : Contain the character data type and storage 2 bytes. ", xVar2, 420);
+///////////////////////////////////////////////////////////////////////////////
+text("Assignment Operator", xVar3, 460);
+line(xVar3, 465, xVar3+205, 465);
+text("An assignment operator is the operator used to assign a new value to a variable, ", xVar3+50, 500);
+text("example the regularly usage.", xVar3, 540);
+text("+ (plus)", xVar3-50, 580);
+text("- (minus)", xVar3-50, 620);
+text("* (multiply)", xVar3+80, 580);
+text("/ (divide)", xVar3+80, 620);
+text("> (over)", xVar3+210, 580);
+text("< (less than)", xVar3+210, 620);
+text("= (eqaual)", xVar3+350, 580);
+text("!= (not equal)", xVar3+350, 620);
+text("&& (and)", xVar3+490, 620);
+text("|| (or)", xVar3+490, 580);
+text("% (modulation)", xVar3+610, 580);
+///////////////////////////////
- text("A variable step", 50, 80);
- text("1. Variable declaration : write the type of the variable and then write the variable name.", xVar4, 130);
- text("example ---> int a; [declare the variable 'a' in an integer data type]", xVar4+75, 170);
- text("The Scope of variable.", xVar4+25, 210);
- text("- Local Varible : declaring in function.", xVar4+50, 250);
- text("- Glocal Varible : declaring out of function.", xVar4+50, 290);
- /////////////////////////////////////////////////////////////
- text("2. Assign the variable : Specify a value to a variable,", xVar5-50, 330);
- text("The value on the right hand side assign the variable", xVar5-30, 370);
- text("example ---> int a=10; [assign the variable 'a' has an integer value is 10]", xVar5+25, 410);
- ///////////////////////////////////////////////////////////////////////////////////////////
- text("3. To call the variable : call the variable with 2 type", xVar6, 450);
- text("- User defined variable : call the variable that user make the variable by step 1 and 2.", xVar6+20, 490);
- text("example ---> line(a,30,a+50,30);", xVar6+75, 530);
- text("- System variable : call the variable that already to use in processing program.", xVar6+20, 570);
- text("example ---> mouseX , mouseY , etc.", xVar6+75, 610);
+text("A variable step", 50, 80);
+text("1. Variable declaration : write the type of the variable and then write the variable name.", xVar4, 130);
+text("example ---> int a; [declare the variable 'a' in an integer data type]", xVar4+75, 170);
+text("The Scope of variable.", xVar4+25, 210);
+text("- Local Varible : declaring in function.", xVar4+50, 250);
+text("- Glocal Varible : declaring out of function.", xVar4+50, 290);
+/////////////////////////////////////////////////////////////
+text("2. Assign the variable : Specify a value to a variable,", xVar5-50, 330);
+text("The value on the right hand side assign the variable", xVar5-30, 370);
+text("example ---> int a=10; [assign the variable 'a' has an integer value is 10]", xVar5+25, 410);
+///////////////////////////////////////////////////////////////////////////////////////////
+text("3. To call the variable : call the variable with 2 type", xVar6, 450);
+text("- User defined variable : call the variable that user make the variable by step 1 and 2.", xVar6+20, 490);
+text("example ---> line(a,30,a+50,30);", xVar6+75, 530);
+text("- System variable : call the variable that already to use in processing program.", xVar6+20, 570);
+text("example ---> mouseX , mouseY , etc.", xVar6+75, 610);
- text("Explanation of Variable steps ", 310, 80);
- ellipse(420, y_var2, 50, 50);
- text("int", 410, y_var2);
- ellipse(380, 300, 100, 100);
- text("int A", 360, 300);
- text("The value on the right hand side assign the variable.", 210, 450);
- ellipse(x_var2, 300, 50, 50);
- text("50", x_var2-10, 305);
+text("Explanation of Variable steps ", 310, 80);
+ellipse(420, y_var2, 50, 50);
+text("int", 410, y_var2);
+ellipse(380, 300, 100, 100);
+text("int A", 360, 300);
+text("The value on the right hand side assign the variable.", 210, 450);
- ///////////////var//////////////////////////////////////////
- ////////////////function////////////////////////////////////
- if (mousePressed&&mouseX>=posX2+50&&mouseX<= width&&mouseY >= posY2-230&&mouseY <= posY2-100) {
- } else if (countPage==3) {
- ////////////////array////////////////////////////////////
- else if ((mousePressed&&mouseX>=150&&mouseX<= turtleX+100)&&(mouseY >= turtleY-90&&mouseY <= height)) {
- } else if (countPage==4) {
- } else if (mousePressed&&mouseX>=20&&mouseX<=200&&mouseY>=20&&mouseY<=350) {
- } else if (change_con<3) {
+ellipse(x_var2, 300, 50, 50);
+text("50", x_var2-10, 305);
+text("If-else", 430, 80);
+text("If : Allows the program to make a decision about which code to execute.", xCon1+50, 120);
+text("If the test evaluates to true, the statements enclosed within the block are executed", xCon1, 160);
+text("and if the test evaluates to false the statements are not executed.", xCon1, 200);
+///////////////////////////////////////////////////////////////////////////////////////////////////
+text("else : Extends the if structure allowing the program to choose between", xCon2, 240);
+text(" two or more block of code. It specifies a block of code to execute", xCon2-50, 280);
+text("when the expression in if is false.", xCon2-50, 320);
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// // ButtonChangePage(820, 550, "Press Key 1");
+text("* example *", xCon3+100, 360);
+text("int x=30;", xCon3+300, 400);
+text("if( x < 20 ){", xCon3+300, 440);
+text("println(100);", xCon3+330, 480);
+text("}else{", xCon3+300, 520);
+text("println(200);", xCon3+330, 560);
+text("}", xCon3+330, 600);
+text("}", xCon3+300, 640);
+text("For Loop : A basic for structure has three parts: init, test, and update.", 150, yCon1);
+text("Each part must be separated by a semicolon (;). The loop continues until the
test evaluates to false,", 100, yCon1+40);
+text("When a for structure is executed.", 100, yCon1+80);
+text("* example *", 200, yCon1+120);
+text("for (int i = 0; i < 80; i = i+5) {", 340, yCon1+120);
+text("line(30, i, 80, i);", 380, yCon1+160);
+text("}", 340, yCon1+200);
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// // ButtonChangePage(820, 550, "Press Key 2");
+text("While Loop : executes a series of statements continuously while the expression is true.", 150, yCon2);
+text("The expression must be updated during the repetitions or the program will never break out of while.", 100, yCon2+40);
+text("* example *", 200, yCon2+80);
+text("int i = 0;", 340, yCon2+80);
+text("while (i < 80) {", 340, yCon2+120);
+text("line(30, i, 80, i);", 380, yCon2+160);
+text("i = i + 5;", 380, yCon2+200);
+text("}", 340, yCon2+240);
ไม่มีความคิดเห็น:
แสดงความคิดเห็น