//     CS 120     Jeff Horn                   

//   Comments in Java  (some guidelines)

 

//    This is syntax for a comment.  The double forward slash means that the rest of the line of

//     text is a comment.  This means it is ignored by the compiler, does not get put into your

//     compiled code (that is, the byte code, or "machine code", that is in your .class file).

//    Comments are meant for humans, such as ourselves, other programmers, etc., to read.

//    The most important comment is the "main comment" at the top of your src code file

//    (the .java file).  The main comment should have important identification information,

//    such as your name, what the code is for (e.g., CS 120 Fall 2009  Assignment 4), and

//      maybe the date, etc.

int x;       //  Declare x to be an integer.  (This is an example of an "in-line" comment, meaning

              //  that it is on the same line as the code it describes.) 

x = (int)   (400 * Math.random()    );   //  This gives x a random int from 0 to 400.

                                                           //  Watch your parentheses and don't forget the semi-colon! 

x = (int) (600 * Math.random() );       //   This gives x a random int from 0 to 800.

x = 200+  (int) (600 * Math.random()  );  // This gives x a random int from 200 to 800.