Further Programming Assignment 2
Prison Management System
(due at or before 6 pm 9 December 2006)
Preamble:
Keeping a log book can help justify a higher mark for this assignment than would otherwise be possible, since it may show that you're able to lay out a plan of work for yourself and make progress. This is important in real-world software development.
You may wish to send me temporary efforts at this assessment, as you go along, as a protection to things going wrong (for example, being out sick) during the days leading up to the submission date. Each temporary effort will supersede previous efforts and the last temporary effort received automatically becomes the final submission, if no others are received. However, please make sure that all submissions include all files, even those that you haven't changed, since, to avoid any possibility of confusion, I'll delete all previous efforts. The entire assignment must be sent as several attachments to precisely one email.
Due to the fact that my own suggested attempt at this assignment will be posted to the web a day or two after the final date of submission, it won't be possible to handle late submissions.
Do remember to refer to the foot of this assignment for information about how to submit it. Remember that 15% of the mark is given just for submitting according to the correct procedure. It's very easy to follow the procedure!
web reference: section 3.2
The specification of the system:
(a) Write a program to manage a 100-cell prison that allows the prison clerk to enter
(i) the forename and surname of each prisoner
(ii) age of each prisoner when he/she arrived in the prison
(iii) original sentence handed down to the prisoner
(iv) a seemingly random prison number allocated to each prisoner - this is entered by the prison clerk and may have meaning to him/her but not to the system. It's not anticipated that you use a random number generator. Rather the Prison Clerk will enter a number which he/she knows is used by no other prisoner. To the system, it will appear as a number chosen at random.
Hint: It's a good idea to make the cell number to be the index of each of the one dimensional arrays that you use. Thus, for example, sForename[15] would hold the forename of the prisoner in cell 15 while dOrignalSentence[15] would hold the original sentence of that prisoner. It would also be good to add a section, if you can, to allow changes to be made to the information relating to a given cell, to allow for amending clerical errors or in event, say, of a prisoner leaving and a new prisoner coming in to occupy that cell.
(b) Continue the program to allow a report of the age of the oldest prisoner, the prison number of the youngest prisoner, the cell number of the prisoner with the longest sentence and any other information of that sort that would clearly be of interest to the prison management, such as the average age of the prisoners currently in the prison. (Discuss with me, if you wish.)
(c) Remission of sentence is granted on the following basis: If a prisoner is well-behaved, he/she will be allowed out when he/she has reached his/her 70th birthday or has served half of his/her sentence whichever happens soonest. Write software to generate a report on the length each prisoner will serve assuming good behaviour, where each prisoner is referenced by her/his prisoner number. The report should be capable of being provided in order of prison number or in order of surname.
All program listings should be well-documented, including being properly indented and with appropriate use of blank lines and comment blocks; this is for the benefit of other programmers who need to read and work with your code. All variables should start with names representing their types and all class names should start with upper-case alphabetic characters. Lines of Java code that are too long on the screen or the printed page MUST be broken by insertion of one or two new line characters (press the return key to generate one of those). The needs of the user should be considered too. Provide him/her with suitable prompt strings and with a user manual, which needn't be overdone. You may prepare a web site to go with the system.
It's not advisable to use two dimensional arrays in this program. You don't have to use any more than one single method (a main one). However, using several methods and classes divided up into separate files would be good if done in a systematic way and would make the assignment worth a little more.
An approximate marking scheme is: Ingenuity of coding 40%, documentation (for both programmer and user) 35%, overall presentation 10%, adherence to the submission requirements 15%.
Everyone should submit something, even if it's not the entire body of software listed above to pass his/her continuous assessment. If you're in difficulties please let me know. The easiest way to ensure failure in the Further Programming module is to submit nothing as that, and only that, guarantees a mark of zero. Do maintain brief, lucid and helpful notes of your work on this assignment in your log.
Assignment Submission Details:
The assignment is due on or before 6pm 09 December 2006; the assignment should be sent to me as a collection of email attachments, attached to only ONE email, with the subject line MM2 Assignment 2. Please don't send your email with any other subject line! Your java and html files can have any name you like, but each java file must start with your name preceded by // so that the compiler will ignore it. Any MS Word document accompanying the submission should have the name Dunne Mary Assignment 2.doc (i.e. Dunne beginning with an uppercase D, space, Mary beginning with an uppercase M, space, etc) if your name is Mary Dunne and the equivalent otherwise.
In the body of the email, please write your forename(s) surname and your student number.
Please submit only one Microsoft Word document even
although there may be numerous Java source code files.
Internal and External Delivery dates:
In real-world practice, a development team has two delivery dates: a date on which they plan to deliver (the internal delivery date) and a date on which they must deliver (the external delivery date). The time interval between the two is the contingency time. The idea is never ever to need to use the contingency time, but it's there to make allowances for things going wrong including staff being out sick and computers not working.
The external delivery date for this project will be 9 December 2006 at 6 pm. Choose an internal delivery date some time before that and plan to submit by then.
Risk:
You must internalise the risk associated with this project, i.e. things like computers breaking down, having a sore throat or a cold and so on. You must deliver by the delivery date since a solution to this problem may appear immediately after that date. So it's best not to take risks and steer well-clear of the delivery date, getting your assignment in well before that.
Staff email addresses:
Staff email addresses are of form: forenameinitialsurnname@wit.ie so if there were a lecturer called Billy Bloggs he would be bbloggs@wit.ie. You'll have to work out what my email address is. I'm not writing here in case it's picked up off the web by spammers collecting email addresses! It's never a good idea to put your email address on a web site. You might like to keep this in mind if you ever have a personal web site. Please only send your assignment to my WIT email address, NOT to my eircom one.
ID
Last major revision: 14 July 2006