CT240 lab4
http://geminga.it.nuigalway.ie/~gettrick/courses/CT240/labs/l4.html
-
For this lab you must submit a printout of all source code (python
files), and the result(s) of running the program on (a few)
test cases.
The source code must
be well presented (indenting, spaces, reasonable variable/function names,
etc.) and must include comments (as a rough guideline - aim to have nearly as
many comments as lines of code). Any questions asked should be answered on a plain sheet of paper.
-
The above material should be given to Paul or left in the cardboard box marked CT240 in the mail room (room IT415) on the 4th floor of the IT Building
before
the deadline of 5pm
Monday 13th. October 2008. You will lose 20% for each day
(or part of day) the lab is late. If you have a genuine reason for
submitting a late lab, please contact Paul before the lab
due date/time.
-
Plagiarism (the unattributed copying of work from other sources
(internet, fellow students,....)) will not be tolerated. Please see
http://www.nuigalway.ie/engineering/documents/plagiarism_guide_students
_v4.pdf. You risk getting zero for your lab if it is found to be
plagiarized.
Write a program in PYTHON that counts the
average number of occurences of the
letter 'a' per sentence in a piece of
input text. Your program should read the text from a file
in.txt and print the results to the screen.
Also in your program, calculate the
number of occurences (again per sentence).
(The median of a set of numbers (integers) is some number x
such that half of the numbers fall above x and half below:
- The median of [2,3,5,200] is 4 (2 of the numbers fall below 4
and two above) (note the average here is clearly not four: it is 105)
- The median of [2,2,2,6,6,7,7] is 6
)
Test your program, and write/submit the results, on the file
http://geminga.it.nuigalway.ie/~gettrick/courses/CT240/labs/in.txt.
©
NUI, Galway