Review of all commands:

Create variables

Assign values to variables:

Compare values:

Decisions

Loops (Repeat)

Make methods:

Use methods

Make classes:

Use classes

Print to the screen:

Comments:

Read from screen:

Syntax rules

Tracing

Details on some classes we used:

Scanner: import java.util.*;
create instance: Scanner x = new Scanner(System.in);
call methods: int y = x.next();

Random: import java.util.Random;
create instance: Random x = new Random();
call methods: int y = x.nextInt(6);

Decimal Format: Library: import java.text.DecimalFormat; ---> (we did not use this much)
Create instance: DecimalFormat percentage2 = new DecimalFormat(“0.00%”);
Call methods: System.out.println(percentage2.format(.308)); // will print 30.80

0 = required position
# = show it if you have it
% = make it a % (mult by 100)
E = E notation (scientific)

String:

Graphics:

Picture It

Exercises to help you review:

1) Create a program with vara = 3 and varb = 2. Swap the values and print "vara now has " + vara + "varb now has" + varb.

2) In your game:

3) Practice exercise: