Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a java program (intelliJ prefereably) CS210 For this project, you will build a hospital interface, where you can: - Login - List patients -

Write a java program (intelliJ prefereably) CS210

For this project, you will build a hospital interface, where you can:

- Login - List patients - Add patients - See patient records - Add/remove records for a patient.

You will be reading data from multiple files: - employees.txt will be responsible for managing user login. (file will be provided) - patients.txt will be responsible for managing the list of patients (file will be provided) - Each patient will have their own file with their records.

Suggested way to tackle this homework:

- Start by downloading all the files. - View the files to see all the formats. - Read the employees from employees.txt o Create a new employee for each line. o Add the employees to the employees ArrayList of the hospital. - Read the patients from patients.txt o Create a new patient for each line. o For each patient Read their designated records. For each line, create a record and add it to the records ArrayList. o Add the patient to the patients ArrayList of the hostpital. - At this point, you have a hospital, with employees, patients. - Write down the menu, with the appropriate switch / if/else statement. - List_patients should be straightforward. - View_records, youll need a way to find the patient from the patients array list - Add_record should be straightforward. - Remove_record, youll need a way to find the patient from the patients array list and then find the record from the records array list. - Add_patient. Youll need to add this user to the patients.txt and create a record file for them. Suppose you add Thomas, you will have to create a thomas.txt file to hold their records. - Finally upon program exit (when the user enters 0), write back the data. - Start with the patients, iterate over all the patients and write them down to patients.txt o For each patient, get the records and write it down to the appropriate file. Annes records go in to anne.txt, etc.

The files given are:

patients.txt

Anne

Tim

John

stephane

gary

Thomas

employees.txt

doctor-password- surgeon

alan-anotherpassword- technician

The output should look like this:

Name of the Hospital

What is your username?

(user input= username)

What is your password?

(user input= password)

Successfully logged in

What would you like to do?

Options:

1. list_patients

2. view_records

3. add_record

4. remove_patient

5. add_patient

(user input 1)

Patients:

Anne

Tim

John

Stephane

Gary

- prompts the user the same question and option like before such as What would you like to do?....etc.

(user input= 2)

Name of patient you would like to view?

(user input= Anne)

Records

fever - 05/14/2017 14;43;25

cough - 05/14/2017 15:03:01

- prompts the user the same question and option like before such as What would you like to do?....etc.

(user input= 3)

Name of patient you would like to view?

(user input= Anne)

What disease?

congestion

Successfully added record

- prompts the user the same question and option like before such as What would you like to do?....etc.

(user input= 2)

Name of patient you would like to view?

(user input= Anne)

Records

fever- 05/14/2017 14:43:25

cough- 05/14/2017 15:03:01

congestion - 05/14/2017 15:07:10

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

More Books

Students also viewed these Databases questions