Here are the tools you need in your Java Toolbox in your head. The red words cannot be changed. The green can be changed by you:

public class MyClassName
{
     public static void main( )
     {

           // your statements will go here
     }
}


For the midterm, you need to understand how to read from a screen, but do not need to memorize the commands. The commands in red will be available to you on the day of the test. You may be asked to create a program that reads from a screen, so you will need to know the order to place the commands.


You need to know how to use these for the midterm, but you do not need to memorize the commands. If you are asked to call these methods, you will be given the method name and parameters.


Creating methods:

public static return_type method_name (type parm1, type parm2)
{
...
...
return expression;
}

Calling methods:

object_or_class.method_name(parm1, parm2);


If / if else / else

if (condition that evaluates to true or false)
{
// do something
}
else if (condition that evaluates to true or false) // remember that everything that met first criteria doesn't get here
{
// do something else
}
.
. // repeat else if as needed
.
else // remember to put no condition
{
// do something
}

If facts:


Loops

For loop - repeats when you know the number of times to repeat


for (statement to start the loop; condition that evaluates to true or false; statement to run when the loop repeats)
{
// do something
}

For facts:

While loop - repeats until some condition is met


while (condition that evaluates to true or false)
{
// do something
// at some point, set the condition to stop
}


Page you will have available during the midterm test

Page you will have available during the decision and loop test