Coin()
         - Constructor: creates a new Coin object that has randomly
           been flipped
        public void flip()
         - Flips the coin by randomly choosing a face value.
        public boolean isHeads()
         - Returns true if the current face of the coin is heads;
           returns false otherwise.
In this case since the class is written in Chapter 5 of the textbook
you can actually see the code (it is on page 186) but that isn't
necessary for using it. However, to use the class
you need to have the code in the directory with your program. 
The class is defined in the file 
Coin.java. Now do the following
to complete the program.
      Coin 1 beat Coin 2 getting to 10 heads. It took 23 flips.
      Coin 2 had 7 heads.
OR
      Coin 1 and Coin 2 tied - they reached 10 heads in 19 flips.
The file CharacterCount.java contains the skeleton of a program to read in a string (a sentence or phrase) and count the number of blank spaces in the string. The program currently has the declarations and initializations and prints the results. All it needs is a for loop to go through the string character by character and count (update the countBlank variable) the characters that are the blank space. Since we know how many characters there are (the length of the string) we use a count controlled for loop.
             ch = phrase.charAt(i);
assigns the variable ch (type char) the character that is in index i of
the String phrase.  In your loop you can use an assignment similar to
this (replace i with your loop control variable if you use something other
than i). NOTE: You could also directly use 
phrase.charAt(i) in your if (without assigning it to a variable).
        switch (ch)
	{
           case 'a':
	   case 'A':  countA++;
	              break;
           case ....
	}
Note that this switch uses the "fall through" feature of switch statements.  If
ch is an 'a' the first case matches and the switch continues execution 
until it encounters the break hence the countA variable would be 
incremented.
    prompt for and read in the first phrase ("quit" if no phrases are to be entered)
    while the phrase is not "quit"
    {
       initialize the counters 
       get the length of the phrase
            
       loop to "process" the phrase -- count the a's, e's, s's, t's, and blanks           
       prompt for and read in the next phrase or "quit"
    }
Note that all you need to do is add the sentinel controlled while loop around the code
you currently have.  Note that a sentinel controlled loop has
three important parts -- the loop control in the while statement, the priming read of
the first phrase before the loop, and the reading of the next phrase at the end of the loop.
Be sure that your prompts let the user know what to do to quit!
Note that all of the
initializations for the counts should be inside
 the while loop (that is, the counts should
 start over for each new phrase entered by the user).   Be sure the program is
properly formatted (with nested loops the inner loop should be indented).
Use the formatting (CTRL-SHIFT F) feature of Eclipse.
       Scanner scan = new Scanner (System.in);
The parameter for the constructor is System.in - the input stream we
want to read from.  Similarly we can instantiate a Scanner object
to read from a file if given the name of the file (which is either
a String literal or a String variable).  Examples are:
       // fileScan1 would read from a file named myFile.txt
       Scanner fileScan1 = new Scanner (new File ("myFile.txt"));
       // fileScan2 would read from the file the user specified (its
       // name is stored in the String variable fileName
       String fileName;
       System.out.print ("Enter the name of the input file: ");
       fileName = scan.next();
       Scanner fileScan2 = new Scanner (new File (fileName));
When running a program in Eclipse, the String for the filename needs to
be the relative path to the file from the Project you are in (which
is Labs for us).  So, if the files are saved in your lab8 directory, 
the above instantiations would need to be modified as follows:
       Scanner fileScan1 = new Scanner (new File ("lab8/myFile.txt"));
       Scanner fileScan2 = new Scanner (new File ("lab8/" + fileName));
The usual Scanner class methods - next, nextLine, nextInt, etc. - are
used to read data from a file.  However the Scanner class has another
method called hasNext that returns a boolean indicating whether
or not there are more items in the file - this method is often used
in the loop control for a loop that is reading through a file and
processing the data in it.   FileExample.java
is an example program that reads a file.  In this case the file
consists of lines of data each containing an integer (a student grade)
followed by a String (the student name - no spaces allowed). Some
sample input files of data are grades1.txt and
grades2.txt.  [NOTE: A Scanner object is an
example of an iterator which is discussed in Section 4.6 (pages
143 - 147) of the text.]
Do the following:
Read the whole description of the following problem before doing anything!
Earlier in lab you wrote a program that computed some statistics for a football quarterback. If you wanted to do this for a lot of quarterbacks it would be more convenient to have the individual quarterback statistics in a file and write your program to read the data from the file. The file nflStats.txt contains some statistics for some NFL quarterbacks. Specifically, it contains the name of the quarterback, the number of times he tried to pass the football and the outcome (in yards) of each pass attempt (note: an outcome of 0 means that the pass was incomplete). The file is organized as follows:
QUARTERBACK_NAME NUMBER_OF_PASS_ATTEMPTS YARDAGE_1 YARDAGE_2 YARDAGE_3 ... YARDAGE_NHere's a simple example file:
    Montana
    13
    12 0 35 23 0 0 8 57 0 14 27 21 0
    Jones
    7
    0 0 0 13 0 67 8
Your job is to write a program, named FootballStats.java, that
reads the file and uses the data to compute some aggregate 
statistics.   For each quarterback, you should print a nicely formatted 
message (with a blank line before and after!) that contains:
Moreover, we are interested in identifying the "Best" Quarterback performance. In particular, your program should determine who had a) the largest total yards, and b) the highest completion percentage. Your program should print both the name of the quarterback with the most total yards (and the number of yards) and the name of the quarterback with the largest completion percentage (and the percentage).
Thinking about how to do this: First notice that you did much of the work for computing the statistics for one player in an earlier exercise. So that code can be re-used with a little modification. You will edit it to read from the file instead of asking the user to enter all of the information about the passes. Also you have a few more things to do for each player - you need to read in the name and you need to compute the yards per attempt and the yards per complete pass.
Of course you need to do the same thing for each player listed in the file. Clearly you need a nested loop.
Plan your program before starting it! You should not try to do everything at once - devise a strategy to complete and test the program in steps (the last exercise may give you a hint about a good strategy for writing a program with a nested loop and the example program gives you the basic setup for reading from a file).