Below are five problems that you can do to get extra credit on the midterm. Each problem is worth two points. Unlike interclass problems, you can't get assistance on these from anyone except the instructor. These are due by Monday, October 11th at midnight. You should e-mail your solutions to the instructor. Only e-mail the .java files that are specified in the problem descriptions.

Rock-Paper-Scissors - Using the RkPprScsrs scenario, add a method to the RPSworld that will randomly pick either a rock, paper or scissors, and then create an object of that type in the left cell. Then repeat the procedure in the right cell. Evaluate which side wins, and create the appropriate win or tie marker in the middle cell.

When calling new Item(...), you must pass in a String argument that is one of the following: "rock", "paper", "scissors", "=", "<", ">". For this one you need to submit the RPSworld.java file.

Space Columbus - For this problem you will be using the Columbus scenario. The scenario begins with a single base and several ships. Each of the ships is given a rank. Ships are supposed to fly to the base, in rank order. You will add code to the Ship and Base to make it so that each Ship moves to the base in turn; no Ship should move until it is it's turn, and all Ships can only move one cell at a time (diagonals are allowed).

For this this option you will need t submit both the Ship.java and Base.java files.

Dance Dance Revolution - Using the DDR scenario, complete the checkKeys method in the Screen class so that when an Arrow object gets close to it's matching outline and the user presses the appropriate key the Arrow is removed. The Arrow class has a method called getKey and a method called getOutline that you should use (when removing Arrows, take care not to remove the outlines themselves). The Screen class contains variables called OUTLINE_HEIGHT and TOLERANCE that you should use to determine when an Arrow is at the right height.

For this problem you need to submit your copy of the Screen.java file.

Actor Sorting - A very common task on computers is to sort objects based on some value. For this problem you will do exactly that in Greenfoot using the Actor Sort scenarion. When you compile or reset this scenario, ten Number objects are created with random values and placed in the world. You need to put code in the act() method that will sort them. The way it will work is that each Number object, except the one on the far right, should compare itself to the one on its right. If it has a larger value than the number object on its right, it should switch the locations of the two. That is to say, it should move itself to the right and the one on its right to the left.

Once you have written this code you should be able to watch the numbers sort themselves either by hitting act multiple times or doing run. For this problem you need to submit the Number.java file.

Buy a Vowel - Create your own scenario. Create a method that takes an input String and removes the vowels. Print both the original and the latered version. For this problem submit the .java file for whatever class you put the code in.