
The George Washington University
School of Engineering and Applied Science
Department of Computer Science
CSci 131 -- Algorithms and Data Structures I
Project #1
Due Date: beginning of class, September 7, 2000
This project depends on Chapters 1 and 2
The purpose of this project is to refresh your memories of programming
since you took CSci 51, and to give students who took a different introductory
courses a chance to get up to speed with Ada 95. Start working on
this now, so you have a chance to ask questions about anything
you don't understand!
Chapter 2 describes a package Currency
and a child package Currency.IO,
which together provide support for dealing with currency quantities in
exact form, without the roundoff associated with floating point. Your tasks
in this project are:
-
Compile the Currency and Currency.IO (currency-io.ads
and currency-io.adb) files. These are packages; do not link them
yet!
-
Read the Currency specification (currency.ads) and the
body (currency.adb) very carefully. You will discover that several
of the operations are "stubbed out", that is, they do not contain useful
code yet. These are "under construction." Complete the construction of
these operations; recompile till there are no compilation errors. This
should be straightforward; use the code for other package operations as
an example.
-
Write a very simple test program for these packages; use Test_Rationals_1
as an example. The goal here is just to make sure you know how to compile
and use the packages.
-
Now write a test plan for a program that determines whether all the currency
operations are working properly. Use the test plan of Section 2.2 as an
example; of course yours will be longer.
-
Finally, expand your test program so it implements your test plan. Run
the program and compare its results with the plan.
Note that all the programs from the book are in your
programs131
directory on the Unix network; this directory becomes visible to you when
you have done the setup described in
project 0.
Do
not type in any code that's in the book! You are wasting your time - Feldman
has done this already!
What to submit:
You must submit listing (.lsb) files for the package specs
and bodies, and one or more execution transcripts for the test program.
Use the command
turnin to set up a script session for
your execution results. Also turn in your test plan. Be sure to indicate
in your test results how they tie back into the plan. This can be done
by annotating your test results by hand.