Self-Study and Tutorial Exercises
|
Tutorial Exercises
The following are the lab exercises that will be covered during the labs
this semester. Note that answers to these exercises will
not be posted;
these will be presented during the labs.
Self-Study Exercises
These are exercises that students can work on independently in order to get ready to use Java in this course. They will not be disucssed in tutorials, but you can send email to the course instructor about them.
-
Self-Study Exercise 1 - setting up your Java environment. This exercise can be completed by students at the beginning of the term. It does not rely on any material presented in lectures or tutorials.
-
Self-Study Exercise 2 - applications of proofs of correctness. This exercise should be completed as soon as possible after correctness of algorithms and programs has been discussed, that is, early during the second week of lectures.
As well as giving you more practice with Java programming, this introduces documentation tools and an assertion checking mechanism that will allow you to apply the material about correctness that you have studied to improve the documenation and (automated) testing of your code. It also introduces some practical limitations of proofs of correctness as well as a kind of dynamic programming that computer science majors will study later on when they take Computer Science 413.
-
Self-Study Exercise 3 - dynamic testing of software. This exercise can be completed during the third week of classes. It concerns software for testing, including the JUnit testing framework that you will be expected to use in this course.
-
Self-Study Exercise 4 - debugging software. This exercise can be completed during the third or fourth week of classes. It introduces the Java debugger jdb, a tool you can use to locate the sources of errors in your programs when these are discovered during testing.
-
Self-Study Exercise 5 - measuring the running times of algorithms. This exercise can be completed during the third or fourth week of classes. It introduces the Java profiler JRat and the Unix time command — tools that can be used to measuring the running time used when you run a program on a given input.
-
Self-Study Exercise 6 - implementing ADT's and data structures in Java. This exercise can be completed at any time after the lecture on ADT's and data structures. It is intended to help you to make sure that you are able to
- implement data structures and algorithms as Java classes,
- write Java interfaces that represent abstract data types,
and make use of interfaces and classes that have been provided for you.
-
Self-Study Exercise 7 - testing a class. his exercise can be completed at any time after the previous self-study exercise. While it is far from complete, it does provide some suggestions about how you might develop tests for a class, especially one that implements an interface.
Last updated:
http://www.cpsc.ucalgary.ca/~jacobs/Courses/cpsc331/W12/tutorials.html |