CS 1323 Section 30, Spring 1997
Individual Project 4
Data Normalization
Due Wednesday, March 5, 3:30pm
papers submitted after 3:30pm Mar 5 and before 4:30pm Mar 6
suffer a penalty of one-grade
papers not accepted after 4:30pm Mar 6
What to Hand In (see also:
example project solution)
- a
Program Organization Chart
exhibiting the interactions between major program
components. Attach a report to the chart
providing a rationale for the program organization.
- A
listing
of the Haskell script you write for your
project, following the required
standards.
- A
session transcript
in which you show
that your function operates correctly on arguments
chosen to demonstrate the function's capabilities.
- Explain (handwritten on the transcript) what
aspects of the function's behavior are illustrated by each of
your choices of
demonstration examples.
- A printed copy of each of the files your program reads
during the demonstration session.
- A logical argument showing that the function transpose,
defined in the
SequenceUtilities
module, satisfies the following property:
- Property T
- If a is a type, m::Int, n::Int,
m > 0, n > 0,
rs::[[a]] is a sequence of sequences with
length(rs)=m,
each element
r in rs has length(r)=n,
and cs=transpose(rs),
then length(cs)=n
and each element
c in cs has length(c)=m.
The Program You Must Write
Write a program that asks the person at the keyboard to enter
(1) the name of a file containing data in the form specified below,
(2) an indication of whether to use standard or scientific notation
for displaying numbers,
and
(3) the number of decimal places or significant digits to use
in displaying numbers.
The program then retrieves the data from the file, normalizes it,
and displays the
normalized data on the screen.
- Data Format
(example:
rainfall.dat,
on the Supplied Software page of the class web site)
Heading Lines.
The first few lines of the data file describe the source of the data.
The next-to-last of these lines
is a sequence of words (strings containing no whitespace characters)
identifying the parameter associated with the corresponding
entry in each of the data lines.
These are called parameter identifiers, and the
line containing them is called the parameter heading.
The last of the heading lines contains no characters other than,
possibly, whitespace characters, and this will be the
only empty line in the heading.
Data Lines.
Each subsequent line of the data file begins with a word identifying
the data on the line followed by a space and
a sequence of numbers separated by spaces.
The word is called the data identifier and the
numbers are the data associated with it.
Each data line contains the same number of numbers, namely
one fewer numbers than
the parameter heading has words.
This means that the number of words in the
parameter heading is the same as the number of words on
each data line (since the numbers on the data lines are "words," in the
sense defined in the description of the heading lines).
- Display Format
Heading Lines.
Display the heading lines as they were given in the data file,
except that the words in the parameter heading
must line up with the corresponding columns of
numbers (or, in one case, data identifiers) below them.
Data Lines.
Display the numbers in the notation selected by keyboard entry
(that is, standard notation with the specified number of
decimal places, or scientific notation with the specified number
of significant digits).
Line up the numbers in columns topped by the
corresponding parameter identifiers, and line up the
data identifiers in a column under the first word in the
parameter heading.
- Data Normalization
Normalize the columns of numbers in the data so that they all have
unit standard deviation. That is, divide each of the numbers
in the k-th column by the standard deviation of the numbers
in the k-th column. (The k-th column consists
of the k-th number from each of the data lines.)
Ground Rules
- You may use any aspects of Haskell
described in the Haskell textbook, any intrinsic operator or function
you have learned from any source, and
any
software supplied
for any project on the class web site.
Note that
NumericUtilities
contains functions for computing standard deviations,
IOutilities
contains functions for converting between numbers of various
types and strings in various formats,
SequenceUtilities
contains the function transpose, which rearranges "matrices"
as sequences of rows or columns, and
Project3D
contains the table function for arranging to display columns
of data.
- The
Project Style Guide
describes additional report requirements.
CS 1323 Section 30 - Fundamentals of Computer Programming -
Spring 1997
Instructor:
Rex Page
(Email: page@ou.edu)
Up to: Welcome Page ~~~
Up to: University of Oklahoma ~~~
Go to:
Next Semester ~~~
Go to:
Previous Semester