Tuesday, November 23, 2010

Final

1.  JavaBeans.  Suppose a Player bean has properties name, position and bound properties salary and team.  A listener class called Commissioner which monitors:
    - Max salary for a player is $1,000,000.
    - Max total salary per team is $10,000,000.
a.  create the classes Player, Commissioner, and any helpers
b.  give "code" in which you create an instance of the commissioner and attach it to the following player object:
       Player player = new Player(......);

2.  RMI
a.  Define a studentImp class that has attributes id, name, credits and appropriate geter/seter and ctors methods. (note you need to define an interface, say Student).
b.  Define a RMI Server class called StudentEnrollment that creates a few students and registers them on a RMI registry.
c.  Define a RMI client class called StudentClient which works with the remote student objects to do s.o.p's of the student objects information.

3.  Write a program that finds all the prime numbers from 1 to 100.  A positive integer is prime if the only positive integers that divide evenly into it are 1 and the number itself.  To exercise multithreading, follow the algorithm presented here in pseudo code:
  • Set up an array of 100 boolean elements and initialize every element to true.  Each element is a flag, and true indicates a potential prime number.  Set an element to false when its index is proven not to be prime.
  • Loop through the array.  If the element is true, meaning the number is a potential prime, launch a thread for the index of the element and in that thread, set elements to false for all multiples of the number.  For example, the first thread you launch this way eliminates multiples of 2(4,8,16...) from the set of potential primes.  The next thread eliminates multiples of 3, and so on.
  • When all the threads except the main thread have ended, print the numbers for which the corresponding element is still true.  The output should show 26 prime numbers starting with 1, 2, 3, 5, 6, 11...

4.  Create a collection class called IntegerSet that imposes the restriction that all elements in the collection must be integer values and that no duplicate values are allowed.  The IntegerSet class should have methods for adding and removing values, checking to see if a value is already in the set, and removing all values.  The class should also have a method that returns an Iterator object that will iterate through the set.

5.  Create an application called ColoredScribble that lets the user click, drag, and release with the mouse to draw lines in a window.  Include buttons or menu items that let the user select the color of the line to be drawn, pring the drawing, save the drawing to a file, and retrieve the drawing from a file.

6.  Create a pair of classes ImmediateMessage and ImmediateMessageServer.  Objects of ImmediateMessageServer class should listen on a specified port for a connection for other systems, and then display the information received on the connection.  Objects of the ImmediateMessage class will connect to these server objects and send a single message to be displayed at the server system.

The ImmediateMessageServer class should create a thread to process each connection from a client ImmediateMessage.  You need to define the Thread class that:
     - Take a Socket object and wraps it up as an InputStream
     - Reads a message from the stream and sop's the message
     - The thread should end when the message is "DONE"

Wednesday, November 3, 2010

November 9 - December 7 class schedule

November 9 - no formal class - time to work on group projects
November 16 - Individual  topic presentations
November 23 - Individual topic presentations continue
November 30 - Group project presentations
December 7 - Final exam and assignments due

Note: individual topic presentations should include an introduction to the topic, key features, where/when it is used, key architectural "things", and possible example(s).  No formal paper is required for this assignment, just the presentation (typically power point).

Thursday, October 21, 2010

Group Project Papers are Due Tuesday 11/26

Reminder that the group project write up is due on Tuesday 11/26.  Include a description of the project and who the members of the group are.

Assignment Due 11/2/2010 - the last programming assignment

Collection Assignment Due 10/26/2010

This is from the last page of the data structure notes:
Write a program that reads in a series of first names and stores them in a linked list.  Do not store duplicate names.  Allow the user to search for a first name.  Use a GUI that is "somewhat" like the one on page C10 (Note, below there should be a status bar)

Monday, September 27, 2010

WSU Student Rachel Beauchene Pepsi refresh projects needs your vote

Please take 2 minutes to vote for a fellow students Pepsi refresh project.  Voting ends on 9/30/2010 so please vote as soon as you can AND pass on the link to all your contacts.

http://www.refresheverything.com/lacrossespayandrescue

Saturday, September 25, 2010

Thursday, September 16, 2010

Due Tuesday September 21, no later than Tuesday September 28

Extend the Producer/Consumer problem discussed in class.  The Producer creates String("1","2". etc) and puts them into a box.  The Box can hold up to a maximum number of Strings, say 4.  The Consumer gets Strings from the Box and displays them.  The strings must be written to the screen in the same order in which they are put into the box.

Design and implement Producer, Consumer, and Box classes.  Note the Box should be implemented as a Queue class.  The Queue must be "thread safe".  The Producer sleeps a random time between 1 to 100 ms before it places another item in the queue and the Consumer sleeps a random time between 1 to 75 ms before it takes another item from the Queue.  Display an appropriate message each time the Producer must wait for the Queue (when it is full) and each time the Consumer must wait for the queue (it is empty).  That is, some blocking should be observed.

You can choose either the approach of using Thread subclasses or the Runnable interface.  All exceptions should be handled in a responsible manner.

EXTRA CREDIT:"  Use multiple Producers (5) and Consumers (3).  when a Producer finishes it should output a message "I ------am done producing" and the Consumers go until there are no more Producers and the Queue is empty.

Be sure to develop good test cases.

Tuesday, September 7, 2010

Assignments due Tuesday September 14

Write a 1-2 page paper about why the stop method was deprecated, how do you fix the problem and why the fix works.  Also due on this date - have your animation applet ready to demo to the class.

Wednesday, September 1, 2010

Assignment due 9/14

Assignment that is due on Tuesday, September 14 Create an applet that does some sort of animation and uses a thread to control the animation.  You will need to demo your applet to the class on Tuesday the 14th.  Have fun!

Assignment due Tuesday 9/7

Due for Tuesday, September 7th write a 1-2 page description on applets - signed and/or trusted - and how they work based on research from the web.

Thursday, August 26, 2010

Want to become a contributor/author of this blog?

If you would like to be a contributor/author of this blog, please send me an email request at:

slka46@gmail.com