Last Programming Assignment !


What to do:

    Implement a linked list similar to what we did in class, except maintain the list in alphabetical order by name. Your node declaration should contain instance data that includes a name (String) , a quiz grade (an integer) and a reference to a Node. To make the programming easier, your constructor for the linked list should insert a dummy node with the name "zzzzzz".

Some other implementation details:

- the Node class must be implemented as a private inner class
- the LinkedList must implement two methods for printing out the content of the list: printForward() and printReverse() . Both of these
methods must employ recursion. Neither method should print out the dummy node.
-the LinkedList class must employ a method int getCount() that returns the number of Nodes contained in the list. This number should not include the dummy node.
- your program should accept input from the user, as in:
       Enter name (STOP to terminate):    smith                   ("smith" typed by user an converted to all upper case before insertion)
       Enter quiz score:   67
- after all the data has been input (that is, the user has typed "STOP"), the user is presented with a menu:
       1) Print list in forward order
       2) Print list in reverse order
       3) Print number of nodes
       4) Stop the program
       Enter choice _
The menu accepts the input, executes the appropriate method(s) , and redisplays the menu. This continues until the user enters 4. If the user
enters anything other than the correct choices, an error message is displayed ("Please enter either a 1, 2, 3, or 4. Hit ENTER to continue."),
<Enter> must be entered, and the menu is redisplayed.

Below is a sample of how your execution should look. I will grade you according to how closely your program looks like the following. Any deviation from what you see below will cause you to loose points (bold indicates user input ):

Enter name (STOP to terminate):   smith
Enter quiz score:  80

Enter name (STOP to terminate):   JoNeS
Enter quiz score:  70

Enter name (STOP to terminate):   edwards
Enter quiz score:  60

Enter name (STOP to terminate):   ZeLDA
Enter quiz score:  95

Enter name (STOP to terminate):   ADams
Enter quiz score:  20

Enter name (STOP to terminate):   stop

1) Print list in forward order
2) Print list in reverse order
3) Print number of nodes
4) Stop the program
Enter choice 1

ADAMS 20
EDWARDS 60
JONES 70
SMITH 80
ZELDA 95

1) Print list in forward order
2) Print list in reverse order
3) Print number of nodes
4) Stop the program
Enter choice 2

ZELDA 95
SMITH 80
JONES 70
EDWARDS 60
ADAMS 20

1) Print list in forward order
2) Print list in reverse order
3) Print number of nodes
4) Stop the program
Enter choice 3

There are 5 nodes in the list

1) Print list in forward order
2) Print list in reverse order
3) Print number of nodes
4) Stop the program
Enter choice a

Please enter either a 1, 2, 3, or 4. Hit ENTER to continue.  (user enters <ENTER> )

1) Print list in forward order
2) Print list in reverse order
3) Print number of nodes
4) Stop the program
Enter choice 4