methods

Know how to write methods and how to call methods based on their signature.

You can write and call methods in your program to perform specific functions. Here is an example of a method called drawSquare:
void drawSquare(){
    for (int i= 0; i < 4; i++){
        rob.move(100);
        rob.turn(90);
    }
}
The first line of a method is called its signature. In the above method the signature contains the following:

void      is an example of the type of information the method will return. In this case 'void' means nothing will be returned by this method.

drawSquare     is the name of the method, that you will use to call it.

( )       tells you what parameters the method needs. In this case it doesn’t need any so they are empty.

{ }      put all the code that the method will contain between its curly brackets.

The method signature tells you what code you need to write when you call it. You would call the above method like this:
drawSquare();
Here is another method:
int sevenTimes(int number){
	return number * 7;
}
int      tells you this method is going to a return an int so the code to call it will need an int variable for this information. In the method, you see a return statement. A method that is not void, must have a return statement.

sevenTimes      is the name of the method, that you will use when you call it.

(int number)      tells you what parameters the method needs. In this case it needs you to pass it an int. In the example below, we are passing in the number 2.
int answer = sevenTimes(2);
The value of answer after the method finishes will be 14.