Computer Science 461

Distributed Computing and Networking

Fall 1997


Assignment 0

This assignment does not count toward your grade. We will ask you to turn it in, but only to test the assignment submission process. We will not grade this assignment, though we will look at your submissions to make sure they are in the right format. (If the format is wrong, we'll ask you to fix it and resubmit.).

Though the assignment is ungraded, we strongly recommend that you do it. If you don't know Java, the assignment will help you make the transition from C. If you do know Java well, you should be able to do the assignment very quickly. In either case, you'll get used to our local setup and learn the ropes.

If you don't do this assignment, we will not give you any leeway on submission and formatting procedures for Assignment 1.

Part A: Hello world.

Write and run the "Hello world" program in Java. Write a Java class called AcmeNet.Assn0.Hello, which contains a main that prints "Hello world" on standard output.

Part B: Threads and Packages

Write a program that creates two threads that communicate using an AcmeNet.Util.Queue data structure. (The AcmeNet.Util.Queue class is supplied in the AcmeNet Utility Library.) Your program should create two queues, which we'll call Q1 and Q2. You should create an "echo thread" which gets objects one by one from Q1, putting each object it gets onto Q2. Then create a "driver thread" which repeatedly puts an object onto Q1, gets an object from Q2, and then tests to make sure that the object it got from Q2 is the same one it put into Q1.

You will probably end up defining more than one Java class in Part B. Your main class should be called AcmeNet.Assn0.QueueTester, and it should be a public class. You can call the other classes whatever you want, but they should be in the AcmeNet.Assn0 package, and they should not be public.


Copyright (c) 1997 by Edward W. Felten

Last modified: Monday, September 08, 1997 01:48 PM