cs102 lab6
http://www.maths.nuigalway.ie/~gettrick/teach/cs102/labs/l6.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
Friday March 1st, 2013. 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.
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%27s_Tutorial_for_Python_3/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