- 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"