2105 Lab 1 handed in as Assignment 1
For details of other assignments and general rules, see this page.
Lab date: Second week of classes. See syllabus
This will be handed in as assignment 1, by the time indicated on the syllabus.
Group work and partners: In this lab, and all other labs that
involve programming, you will work in groups of two. If you have not
previously arranged to work with someone in your lab section, then you
will have to find someone immediately. If there are an odd number of
students, the TA may permit an individual to work alone for now. No groups
of 3 will be permitted.
Seating: In the early labs, each group will use one computer,
although you will need an extra computer when you are doing later labs
involving client-server work.
Saving work and accounts: Your TA will give you any needed help
regarding setting up your account. Before you leave the lab each day,
make sure you have saved your work.
Using Eclipse: You will be using Eclipse in this lab.
Instructions on how to get started in the lab can be found here.
Exercises to do: Work on the following exercises from the textbook.
You must hand in only one copy of answers per group. Make sure the names
and student numbers of both partners are clearly indicated. You must
work on these questions during the lab and then finish off
the work on your own time.
- Before coming to the lab you were asked to read and understand Section
2.9 of the textbook, starting on page 57. If you have not done this, take five minutes now to
- To start this lab, download the code for the PointCP example
Compile the code and run it.
- By modifying the original version, implement design 2 (Polar coordinates only), and design 4 (both types of points stored in a single class)
When you hand in the lab, you will hand in the code you have written.
- Modify the PointCPTest class to allow you to test the designs
you have developed. Do a thorough series of tests to ensure
your classes and interface work properly. You will hand in the code, and
also a printout of the output generated by your tests.
- Hand in your answers to exercises E26 (table of what you think will be the
advantages and disadvantages of each design), and E28-E30 (performance analysis, comparing
all three designs you have implemented instead of Design 1 with Design 5 as the book says). To do this evaluation, for each design create random instances and then call each method many thousands of times, and then find the elapsed time in milliseconds for the fixed number of iterations. Make sure that your program runs each time for about 10 seconds so you get a good measure of performance. Test each method separately. Run each
version several times to ensure that your results are consistent and use the
median result as your definitive result, plus give the maximum and minimum
Hand in a description of how you did the tests,
sample outputs from running the tests, the table and a discussion of the