Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In java. In this project, you will develop Mobile surgery software. In this project, you are required to develop the following classes: 1. Interface

image text in transcribedimage text in transcribed

In java. In this project, you will develop Mobile surgery software. In this project, you are required to develop the following classes: 1. Interface Nameable Create an interface Nameable that has four methods setFirstName, getFirstName, setLastName and getLastName. 2. Class Person the class Person implements interface Nameable. Ensure all the methods in Nameable are implemented in Person class. In addition, Class Person has first name, last name, age and national ID as its attributes. Give your class a full argument constructor that initializes all attributes. Add the necessary setters and getters, in addition to a toString() method to print all the person details. 3. Class Date Class Date that has day, month and year as attributes. Give your class a full constructor that initializes all attributes. Add the necessary setters and getters in addition to a toString() method. 4. Class Patient Derive Patient from the class Person. A Patient record has the insurance coverage state (use the type of Boolean: True for full or false for partial coverage); and count to track patient total. This class should implement the Comparable interface, and the compareTo() method should be overridden to order objects based on the patients ages. In addition, the record should have the patient first name, last name, age and national ID (defined in the class person). Give your class a full constructor that initializes all attributes. Make sure that the person constructor will be invoked in the patient constructor. Add the necessary setters and getter methods in addition to a toString() method. 5. Class Doctor Doctor record has the Doctor's first name, last name, age and national ID (defined in the class person), a specialty as a string (for example Neurological, Ophthalmic, Oral and Maxillofacial, Orthopedic, Pediatric Surgery and so on). Use Comparator interface to make this class comparable based on two comparators: specialty and national ID. Give your class a full constructor that initializes all attributes. Make sure that the person constructor will be invoked in the Doctor constructor. Add the necessary setters and getter methods in addition to a toString() method. 6. Class Surgery Surgery class will contain doctor object, a date object as surgery date, surgery name, room number, surgery duration as string and counter to track surgery total. Give your class a full constructor that initializes all attributes. Add the necessary setters and getter methods in addition to a toString() method. This class should implement the Comparable interface, and the compareTo() method should be overridden to order objects based on surgery duration. Main Program for testing Write a menu-driven program to implement the Application. The menu includes the following: Hint: use switch Statement to implement this menu. 1. Add a new Doctor. The program will prompt the user to enter the fields for the new Doctor and will add it to DocList(Array List), which will be used to store Doctor objects. 2. Display all Doctors using foreach. 3. Add a new Patient. The program will prompt the user to enter the fields of the new Patient and will add it to PatientList (Linked List). Where PatientList will be used to store Patient objects. 4. Display all Patients using iterator 5. Add a new Surgery Object. Create a priority queue called SurList and add surgery objects to it. 6. Display Surgery data. Don't forget to check for conflicts in the doctor schedule. If the same doctor at the same date has two surgeries, raise a message. Then, Assign the surgery to another doctor. please apply all requeirments 7. Sort Patients 8. Sort Doctors 9. Sort Surgeries. 10. Store Doctor objects in a file. Write the contents of the Doclist to a file called Doctorinfo.txt. 11. Store Patient objects in a file. Write the contents of the PatientList to a file called Patientinfo.txt. 12. Exit. The program should handle special cases and incorrect input and terminate safely.

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

Accounting Information Systems

Authors: Marshall B. Romney, Paul J. Steinbart

13th edition

133428532, 978-0133428537

More Books

Students also viewed these Programming questions