CT240 lab7
http://geminga.it.nuigalway.ie/~gettrick/courses/CT240/labs/l7.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 3rd. November 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.
This weeks lab is based on the example on pages 53,54 of the
wikibook
"Non-Programmers Tutorial For Python" by Josh Cogliati (2005),
(see http://en.wikibooks.org/wiki/Non-Programmer's_Tutorial_for_Python/Dictionaries). In his example, Cogliati has options for printing,
adding, removing, and looking up a phone number. Change the code so that,
instead of the value in the dictionary being a simple phone number,
it is now a list with three values:
-
phone number
-
e-mail address
-
web page
The key should still be simply the persons name. Adapt the menu used in
the example accordingly, for example the '2. Add a Phone Number' should
now read '2. Add an entry' and if selected should ask the user for the
4 items of information (name, phone, email, web). Aditionally:
-
Add an option (e.g. number 6 in the menu) to 'Change/Edit an existing
entry'.
-
Add options to
-
Print just a list of the phone numbers
-
Print just a list of the e-mail addresses
-
Print just a list of the web addresses
-
Print all of the above together
©
NUI, Galway