cs102 lab1
http://www.maths.nuigalway.ie/~gettrick/teach/cs102/
-
For this lab you must submit all source code (python .PY
files or jupyter .IPYNB notebooks), and, if applicable, the result(s) of running the program on (a few)
test cases. This should be uploaded in CANVAS (not sent in 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 either
(a) by
typing the answers into the relevant box on the CANVAS upload form, or
(b) by typing in the details as text, as a comment in the PYTHON code
(i.e. after the # sign that is used for comments).
-
This material should be uploaded
before
the deadline of 5pm
Friday February 2nd., 2024. 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, chatGPT, etc....)) will not be tolerated.
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.
©
University of Galway