Assignment #6 - 93A

Assignment #6 - 93A


Assignment 6:
------------

TA: Lucie Bernier
E-mail assignments ONLY to-> HQHK
Office Hours: Mondays 1:00-3:00
              Fridays 1:00-3:00
Assignment weight: 30
Due Date: 30th March 1993  <<<==== Note: Update

NOTE: For questions, complaints, or comments, send e-mail to
lucie@cs.mcgill.ca

Assignments sent to lucie will be ignored.
Questions/comments sent to HQHK will also be ignored.

This program will be written in TURBO PASCAL on the MS-DOS
based machines.
While e-mail from the Engineering LAN to MUSICB does work,
you *MUST* send the assignment submission from your own
MUSICB account to HQKD.
This means transferring whatever you need to submit from the
PC to MUSIC. Ask your instructor how to do this.

ASSIGNMENTS SENT FROM ANY PLACE EXCEPT YOUR MUSICB ACCOUNT
WILL BE IGNORED, AS THEY ARE NOT PICKED UP BY THE
AUTOMATIC MARKING PROGRAM!

     ----------------------------------------------------------

                    HISTOGRAM
                    ---------

     In this first PASCAL assignment you will do a brief analysis
of data,  learning how to read from an input file and working
with one-dimensional arrays.
I want you to have a well structured program
       - i.e. use of procedures and/or functions.

     An experiment was conducted on 4 blocks of different material
and weight.  The blocks were sliding down a ruguous angled
plane and their time of descent was noted.
Thirty descents were done for each of the 4 blocks -
  the data from this experiment is the
  data we will work on and is given below.

I want you to read in the data, having 4 one-dimensional arrays of 30
elements.
For each block you will have to compute the maximum, minimum
and mean value of time descent.
You will also find the minimum, maximum and mean value of time descent
for the overall experiment.
Finally I want you to print the histogram of all the
time values.
For each range of 0.5 (i.e. from 0 to 0.5, etc.) you
will "print" how many data points you recorded.
I want you to have a different symbol for different
block number.
For example say that for block 1 you found 5 data points in
the range 2.1 - 2.5 and block 2 only had 1 data point in that range,
if block 1 is represented by *
and block 2 by @ than your output should look like this:


     2.1 - 2.5     *****@
     2.6 - 3  ...


Subdivide your program in procedures and functions that will be
called by your main program:
for example, you can have subroutines for every one of these subtasks:

     1. reads in data
     2. finds the minimum of an array of 30 elements
     3. finds the maximum of an array of 30 elements
     4. computes the mean of an array of 30 elements
     5. prints the min, max and mean value for a block
     6. finds and stores in an array how many data points
        there is for each range of
        a given block
     7. prints the histogram



  1  5.1  3.5  3.4  0.2
  2  4.9  3.0  3.4  0.2
  3  4.7  3.2  4.3  0.2
  4  4.6  3.1  3.5  0.2
  5  5.0  3.6  4.4  0.2
  6  5.4  3.9  4.7  0.4
  7  4.6  3.4  3.4  0.3
  8  5.1  3.4  3.5  0.2
  9  4.4  2.9  3.4  0.2
 10  4.9  3.1  4.5  0.1
 11  7.0  3.2  4.7  1.4
 12  6.4  3.2  4.5  1.5
 13  6.9  3.1  3.9  1.5
 14  5.5  2.3  4.0  1.3
 15  6.5  2.8  4.6  1.5
 16  5.7  2.8  4.5  1.3
 17  6.3  3.3  4.7  1.6
 18  4.9  2.4  3.3  1.0
 19  6.6  2.9  4.6  1.3
 20  5.2  2.7  3.9  1.4
 21  6.3  3.3  5.0  2.5
 22  5.8  2.7  5.1  1.9
 23  7.1  3.0  5.9  2.1
 24  6.3  2.9  5.6  1.8
 25  6.5  3.0  5.8  2.2
 26  7.6  3.0  4.6  2.1
 27  4.9  2.5  4.5  1.7
 28  7.3  2.9  3.3  1.8
 29  6.7  2.5  5.8  1.8
 30  7.2  3.6  3.1  2.5