cs102 lab10
http://www.maths.nuigalway.ie/~gettrick/teach/cs102/labs/l10.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 April 9th., 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.
You risk getting zero for your lab if it is found to be
plagiarized.
A hospital will store information on its patients in a class called
patients.
For each patient, we will store the attributes
-
patients forename,
-
patients surname,
-
date of patients admission,
-
date of birth, and
-
name of the county where they live.
Write a class in python to represent each patient.
Further, write a subclass private(patients)
to store information on private patients in the hospital. These patients
will have two extra attributes 1) name of insurance company, 2) reference
code of insurance policy (you can treat this as a string of characters).
Construct a list of six (6) fictional patients (use fictional
data you make up yourself), 3 of whom are private
patients, and print out the birth date of all these 6 patients using a
for loop.
All your methods, the constructor, and the class itself, should have appropriate
docstrings.
You should test your methods well (by calling them from the main program), to make
sure they work as planned.
©
NUI, Galway