” 辅导CSE1/4IOO编程、 写作Java编程设计、 辅导JavaCSE1/4IOO Assignment Part 2 1 of 10CSE1IOO/CSE4IOO Semester 2, 2020Programming Assignment Part 2 (20%)Assessment: This assignment is worth 20% of the final mark for this subject. Please read the entire specification carefully, before you start writing the code. Due Date: Monday, 12 October 2020, at 10 am. Delays caused by computer downtime cannot be accepted as a valid reason for a latesubmission without penalty. Students must plan their work to allow for bothscheduled and unscheduled downtime. This is an individual Assignment. You are not permitted to work as a group whenwriting this assignment. Copying, Plagiarism: Plagiarism is the submission of somebody elses work in amanner that gives the impression That the work is your own. The Department ofComputer Science and Information Technology treats academic misconductseriously. When it is detected, penalties are strictly imposed. Refer to the unit guidefor further information and Strategies you can use to avoid a charge of academicmisconduct. All submissions will be electronically checked for plagiarismusing latcs8 server program. If you are new at La Trobe, please completeacademic integrity module on LMS to understand what is regarded as anacademic misconduct. Objectives: The general aims of this assignment are: To analyse a problem in an object-oriented manner, and then design andimplement an object-oriented solution that conforms to given specifications To practise using inheritance in Java To practise file input and output in Java To make implementations more robust through mechanisms such asexception handling. Submission Details and Marking Scheme: Instructions on how to submitelectronic copies of your source code files from your latcs8 account and a markingscheme overview are given at the end. If you have not been able to complete aprogram that compiles and executes containing all functionality, then you shouldsubmit a program that compiles and executes with as much functionality as youhave completed. (You May comment out code that does not compile.)NOTE: While you are free to develop the code for this assignment on any operatingsystem, your solution must run on the latcs8 system.CSE1/4IOO Assignment Part 2 2 of 10 辅导CSE1/4IOO作业、 写作Java编程设计作业、NOTE: You can use Arrays or ArrayList or LinkedList of the Java API. If you usearrays, assume that we never have more than 50 patients in the system. BackgroundAs described in the handout for Part 1, the overall aim of the assignment is todevelop a prototype for a patient record system. In Part 1, you have implemented the classes to represent patients, medicalobservation types, and Observations. You have also implemented aPatientRecordSystem class which allows us to add patients, observation types andobservations. Building on the work that you have done for part 1, in this Part 2, you will beadding more functionalities to the classes and implementing a menu program. Youare required to do the tasks (task 1, 2, and 3) described below. Task 1Implement two methods for the PatientRecordSystem class to save and load data. **************************************The first method should have the header:public void saveData() throws ExceptionThe method should write the data about observation types, patients, andobservations that are currently in the PatientRecordSystem instance, in five textfiles as described below:1. PRS-MeasurementObservationTypes.txtThe file will contain information about the measurement observation types. Therequired format of the text Data in the file is shown with an example below:T100; Blood Pressure; psiT400; Height; cmEach measurement observation type must be on a separate line. Each line mustcontain the observation type code, name, and unit, separated by semi-colons. 2. PRS-CategoryObservationTypes.txtThe file will contain information about the category observation types. The requiredformat of the text data in the file is shown with an example below:CSE1/4IOO Assignment Part 2 3 of 10T200; Blood Type; Group A, Group B1, Group B2T300; Stress Level; Low, Medium, HighEach category observation type must be on a separate line. Each line must containthe observation type code, name, and the categories. The three elements, i.e., code, name, and categories are separated by semi-colons. The different categories areseparated by Commas. 3. PRS-Patients.txtThe file will Contain information about the patients data without their observations. The required format of the text data in the file is shown with an example below:P100; John SmithP200; Anna BellEach patient must be on a separate line. Each line must contain the patients id andname, separated by a semi-colon. 4. PRS-MeasurementObservations.txtThe file will contain information about the patients measurement observations. Therequired format of the text data in the file is shown with an example below:P100; T100; 120.0P200; T400; 180Each measurement observation must be on a separate line. Each line must containthe patients id, the observation code and the observation value (a double). Thefields are separated by semi-colons. 5. PRS-CategoryObservations.txtThe file will contain information about the patients category observations. Therequired format of the text data in the file is shown with an example below:P100; T200; Group AP200; T300, LowEach category observation must be on a separate line. Each line must contain thepatients id, the observation code and the observation value. The fields areseparated by Semi-colons. For the saveData() method, refer to the lecture notes of week 5, and revise thecontents related to the use of PrintWriter class.CSE1/4IOO Assignment Part 2 4 of 10**************************************The second method to load data from text files should have the following header:public void loadData() throws ExceptionThe method will read the data from five text files and save them in aPatientRecordSystem instance by calling methods of the same class to addmeasurement observation types, category observation types, etc. For example, whenyou read details about a patient from PRS-Patients.txt file, you should call theaddPatient() method with those details to add the patient in thePatientRecordSystem. The data should be loaded into a PatientRecordSystem instance which is empty ofdata. For the loadDate() method, revise the lecture notes and text files under week5 and focus on the Scanner class. You should write a small program to test these two methods. A sample test programis given in the Appendix 1. As for Part 1, your implementation must be such that the sample testprogram can be run without any change. Task 2Write the menu program, called PatientRecordSystemMenu, to provide options in thefollowing menu: =====================Patient Record System=====================1. Add a measurement observation type2. Add a category observation type3. Add a Patient4. Add a measurement observation5. Add a category observation6. Display details of an observation type7. Display a patient record by the patient id8. Save data9. Load dataD. Display all data for inspectionX. ExitPlease enter an option (1-9 or D or X):CSE1/4IOO Assignment Part 2 5 of 10The menu program must use the PatientRecordSystem class. For each option, theprogram should ask for the required inputs, each with a separate prompt. For option 6, 7 and D, it is acceptable just to use the toString methods of the classesinvolved. After a menu option is selected and the operation is completed, the menu should bepresented to the user again. See Appendix 2 for a short sample run. The menu program for this task is only required to satisfy the data correctnessconditions. It is not required to be robust, i.e. it can crash when certain exceptionsoccur. For this task, the examples in lab 3 and lab 4 might be worth looking into. Task 3Implement a class called RobustPatientRecordSystemMenu, which makes the previousmenu program robust by including exception handling features. It is required to berobust only in the following sense: when an exception occurs in the execution of anoption, the program will display some information about the exception on the screenand return to the main menu. Electronic Submission of Your Source CodeSubmit all Your Java files on LMS submission link. Marking Scheme OverviewThe assignment has the total of 100 marks, which are distributed as follows: Implementation (Execution of code) 90 marks (Do all parts of the programsexecute correctly? Note your programs must compile and run to carry out thisimplementation marking. So, comment out the non-working code in yoursubmission.) Code Design, Layout and Documentation 10 marks (Does the programconform to specifications? Does the program solve the problem in a well- designed manner? Does the program follow good programming practices?Does the indentation and code layout follow a good, consistent standard? Arethe identifiers meaningful? Are comments useful in explaining what and howthe program works? (Javadoc comments are optional.) A detail marking rubric will be published on LMS soon.CSE1/4IOO Assignment Part 2 6 of 10Appendix 1 A sample program to test methods to save and load dataimport java.io.*;import java.util.*;public class PatientRecordSystemTester{public static void main(String [] args) throws Exception{testSaveData();testLoadData();}public static void testSaveData() throws Exception{// Create PatientRecordSystem// Add observation types , patients and observationsPatientRecordSystem prs = new PatientRecordSystem();prs.addMeasurementObservationType(T100, Blood Pressure, psi);CSE1/4IOO Assignment Part 2 7 of 10String [] categories = {Group A, Group B1, Group B2};prs.addCategoryObservationType(T200, blood type, categories);String [] temp = {low, Medium, high};categories = temp;prs.addCategoryObservationType(T300, stress level, categories);prs.addMeasurementObservationType(T400, height, cm);prs.addPatient(P100, Smith);prs.addPatient(P200, Adams);prs.addMeasurementObservation(P100, T100, 120);prs.addCategoryObservation(P100, T200, Group A);// save data to fileprs.saveData();}public static void testLoadData() throws Exception{PatientRecordSystem prs = new PatientRecordSystem();prs.loadData();System.out.println(prs);}}Appendix 2 A sample run of the menu program=====================Patient Record System=====================1. Add a Measurement observation type2. Add a category observation type3. Add a patient4. Add a measurement observation5. Add a category observation6. Display details of an observation type7. Display a patient record by patient id8. Save data9. Load dataD. Display all data for inspectionX. ExitCSE1/4IOO Assignment Part 2 8 of 10Please enter an option (1-9 or D or X): 2Enter observation type code: t1Enter observation type name: stress levelEnter the number of categories: 3Enter category 1: lowEnter category 2: mediumEnter category 3: high=====================Patient Record System=====================1. Add a measurement observation type2. Add a category observation type3. Add a patient4. Add a measurement observation5. Add a category observation6. Display details of an observation type7. Display a patient record by patient id8. Save data9. Load dataD. Display all data for inspectionX. ExitPlease enter an option (1-9 or D or X): 3Enter Patient ID: p1Enter patient Name: john smith=====================Patient Record System=====================1. Add a measurement observation type2. Add a category observation type3. Add a patient4. Add a measurement observation5. Add a category observation6. Display details of an observation type7. Display a patient record by patient id8. Save data9. Load dataD. Display all data for inspectionX. ExitPlease enter an option (1-9 or D or X): 5CSE1/4IOO Assignment Part 2 9 of 10Enter patient ID: p1Enter observation type code: t1Enter observation type value: medium=====================Patient Record System=====================1. Add a measurement observation type2. Add a category observation type3. Add a patient4. Add a measurement observation5. Add a category observation6. Display details of an observation type7. Display a patient record by patient id8. Save data9. Load dataD. Display all data for inspectionX. ExitPlease enter an option (1-9 or D or X): d————————–PATIENT RECORD SYSTEM DATA————————–OBSERVATION TYPES:– CategoryObservationType[code: t1, name: stress level, categories: |low|medium|high|]PATIENTS:– Patient id: p1, Name: john smith Observations:- CategoryObservation[observationType: CategoryObservationType[code: t1, name: stress level, categories: |low|medium|high|], value: medium]=====================Patient Record System=====================1. Add a measurement observation type2. Add a category observation type3. Add a patient4. Add a measurement observation5. Add a category observation6. Display details of an observation type7. Display a patient record by patient id8. Save data9. Load dataD. Display all data for inspectionX. ExitPlease enter an option (1-9 or D or X): xCSE1/4IOO Assignment Part 2 10 of 10 Bye!如有需要,请加QQ:99515681 或邮箱:99515681@qq.com
“
添加老师微信回复‘’官网 辅导‘’获取专业老师帮助,或点击联系老师1对1在线指导。