
Lavi M.
asked 10/30/20Can someone do me this project? (Java)
The project description:
As a programmer, you have been asked to write a Java application, using OOP concepts, for a Hospital
with the following requirements:
The Hosptal has several employees and each one of them has an ID (int), name (string), address
(string), mobile phone number (string), email (string) and salary (double) with suitable data types.
The employees are divided into:
●Administration staff: who have in addition to the previous information their position (string).
●Doctor: who have also a rank (string) and specialty (string)
The project requirements:
You will need to create all the needed Java classes with all the required information.
You have to apply all the OOP (Object Oriented Programming) concepts that we have covered in this module (i.e. inheritance, polymorphism, interface and collections)
Include a Microsoft Word document (name it as readme.doc) that includes several screenshots of
your Netbeans IDE application GUI interface as well as the output screenshot results. Provide all
assumptions that you have made during design and implementation.
Include the whole Netbeans Java project with all source codes. Write as much comments as possible to document your source codes.
At the end, you will need to create a testing class (e.g. Hospital.java) with the static main() method with
the following requirements:
It must have initial fixed collections of working staff (at least 3 administration staffs and 2
doctors)
The program will print a selection screen where the user can choose the operation he/she wants to perform. The selection screen will be repeated after each selection until the staff type the number 4 to completely exit from the program:
1. Add an administration staff (by providing all her/his information) to the list of all administration staff.
2. Add a doctor (by providing all her/his information) to the list of all doctors.
3. Print all working staff (remember to differentiate between administration staff and doctors
in the output printout).
4. Exit the program.
1 Expert Answer

Patrick B. answered 10/30/20
Math and computer tutor/teacher
//******** Employee.java *******************************
class Employee
{
protected int employeeID;
protected String employeeName;
protected String employeeAddress;
protected String employeePhone;
protected String employeeEmail;
protected double employeeSalary;
public Employee(int id, String name, String addr, String ph, String email, double salary)
{
employeeID = id;
employeeName = new String(name);
employeeAddress = new String(addr);
employeePhone = new String(ph);
employeeEmail = new String(email);
employeeSalary = salary;
}
public void SetName(String name) { employeeName = new String(name); }
public void SetAddress(String addr) { employeeName = new String(addr); }
public void SetPhone(String ph) { employeePhone = new String(ph); }
public void SetEmail(String email) { employeeEmail = new String(email); }
public void SetSalary(double salary) { employeeSalary = salary; }
public int GetEmployeeID() { return(employeeID); }
public String GetEmployeeName() { return(employeeName); }
public String GetEmployeeAddress() { return(employeeAddress); }
public String GetEmployeePhone() { return(employeePhone); }
public String GetEmployeeEmail() { return(employeeEmail); }
public double GetEmployeeSalary() { return(employeeSalary); }
}
//******** EmployeeAdmin.java *******************************
class EmployeeAdmin extends Employee
{
protected String position;
public EmployeeAdmin( int id, String name, String addr, String ph, String email, double salary, String pos)
{
super(id,name,addr,ph,email,salary);
position = new String(pos);
}
public void SetPosition( String pos) { position = new String(pos); }
public String GetPosition() { return(position); }
}
//******** Doctor.java *******************************
class Doctor extends Employee
{
protected String rank;
protected String specialty;
Doctor( int id, String name, String addr, String email, String ph, double salary,
String rank, String spec)
{
super(id,name,addr,email,ph,salary);
this.rank = new String(rank);
this.specialty = new String(spec);
}
public void SetRank( String rank) { this.rank = new String(rank); }
public void SetSpecialty(String spec) { this.specialty = new String(spec); }
public String GetRank() { return(rank); }
public String GetSpecialty() { return(specialty); }
}
//******** EmployeeMain.java *******************************
class EmployeeMain
{
public void DisplayEmployeeAdmin(EmployeeAdmin employeeAdmin, String strMsg)
{
System.out.println("*********************************************");
System.out.println(strMsg);
System.out.println("*********************************************");
System.out.println(" employee id : " + employeeAdmin.GetEmployeeID());
System.out.println(" employee name :>"+ employeeAdmin.GetEmployeeName());
System.out.println(" employee address :>"+ employeeAdmin.GetEmployeeAddress());
System.out.println(" employee phone :>" + employeeAdmin.GetEmployeePhone());
System.out.println(" employee email :>"+ employeeAdmin.GetEmployeeEmail());
System.out.println(" employee salary: " + employeeAdmin.GetEmployeeSalary());
System.out.println(" employee position:>"+ employeeAdmin.GetPosition());
}
public void DisplayDoctor(Doctor doctor, String strMsg)
{
System.out.println("*********************************************");
System.out.println(strMsg);
System.out.println("*********************************************");
System.out.println(" employee id : " + doctor.GetEmployeeID());
System.out.println(" employee name :>"+ doctor.GetEmployeeName());
System.out.println(" employee address :>"+ doctor.GetEmployeeAddress());
System.out.println(" employee phone :>" + doctor.GetEmployeePhone());
System.out.println(" employee email :>"+ doctor.GetEmployeeEmail());
System.out.println(" employee salary: " + doctor.GetEmployeeSalary());
System.out.println(" employee rank:>" + doctor.GetRank());
System.out.println(" employee specialty :>" + doctor.GetSpecialty());
}
public void Go()
{
EmployeeAdmin admins[] = new EmployeeAdmin[5];
Doctor doctors[] = new Doctor[5];
admins[0] = new EmployeeAdmin(10746,"Theresa Dallasandro","465 SR 46 Boardman OH 44511","[email protected]","330-412-3908",46288.15,"COO");
admins[1] = new EmployeeAdmin(32465,"Mike Corano","1035 W. Rayen Ave Youngstown OH 44512","[email protected]","330-513-8742",53612.95,"Production Manager");
admins[2] = new EmployeeAdmin(7111,"Edward Roy","39960 Winding Creek Lane Warren OH 44486","[email protected]","330-215-8947",102436.98,"Inventory Management");
admins[3] = new EmployeeAdmin(24576,"Patrick Baldwin","1747 Tarah Trace Dr Youngstown OH 44512","[email protected]","330-536-8911",65432.10,"Software");
admins[4] = new EmployeeAdmin(12345,"Jennifer Abels","9756 Lake Worthington Rd Beloit OH 43210","[email protected]","330-586-4321",76543.21,"Project Management");
doctors[0] = new Doctor(12345,"David A Jaffe","123 University Blvd. Hubbard OH 44414","[email protected]","330-134-2567",254167.59,"Senior Chiro","Chiropractic");
doctors[1] = new Doctor(12346,"John Roy","234 Meribal Rd. Cranstow OH 44412","[email protected]","330-146-5789",245132.56,"Clinic","Phsychiatric");
doctors[2] = new Doctor(12347,"Martin Murphy","1854 Sheridan St. Warren OH 44483","[email protected]","330-123-9876",189234.56,"Electrolysis","Electrolysis");
doctors[3] = new Doctor(12348,"Norma E Hazelbaker","34 Western Reserve Rd North Lima OH 44382","[email protected]","330-418-2975",166240.87,"General","Pediatrics");
doctors[4] = new Doctor(12349,"Antonio V Zumpano","2930 SR 46 Niles OH 44486","[email protected]","330-215-9867",213456.78,"MED3","Internal Med");
String outbuff;
for (int iLoop=0; iLoop<5; iLoop++)
{
outbuff = "admin rec # " + (iLoop+1) + " of 5 ";
this.DisplayEmployeeAdmin(admins[iLoop],outbuff);
}
for (int iLoop=0; iLoop<5; iLoop++)
{
outbuff = "doctor rec # " + (iLoop+1) + " of 5";
this.DisplayDoctor(doctors[iLoop],outbuff);
}
}
public static void main(String args[])
{
EmployeeMain x = new EmployeeMain();
x.Go();
}
}
Lavi M.
Thanks but its missing the collection and implements and where The program will print a selection screen where the user can choose the operation he/she wants to perform. The selection screen will be repeated after each selection until the staff type the number 4 to completely exit from the program: 1. Add an administration staff (by providing all her/his information) to the list of all administration staff 2. Add a doctor (by providing all her/his information) to the list of all doctors 3. Print all working staff (remember to differentiate between administration staff and doctors in the output printout 4. Exit the program10/31/20
Still looking for help? Get the right answer, fast.
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.
Patrick B.
source code posted in RESOURCES section under this link10/30/20