cs102 lab1
http://www.maths.nuigalway.ie/~gettrick/teach/cs102/labs/l1.html
-
For this lab you must submit all source code (python
files), and, if applicable, the result(s) of running the program on (a few)
test cases. This should be sent in via BLACKBOARD (not directly by email).
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 by
typing the answers into the relevant box on the BLACKBOARD upload form.
-
This material should be uploaded
before
the deadline of 5pm
Saturday January 30th., 2016. You will lose 20% for each day
(or part of day) the lab is late.
-
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.
Suppose we have a list of integers. These numbers represent the
yearly profit (in kilo euro) of n businesses (shops) along the
high street in the City centre. Given these numbers, write a
PYTHON
program to
-
calculate which business makes the most profit.
-
calculate which business makes the least
profit (i.e. the most loss!).
-
calculate
the average profit of the n businesses.
(In your program, the n numbers should be read in from the user). You must use an iterator
for each task - i.e. a loop such as while or for.
©
NUI, Galway