Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The assignment for my Application Development class has us creating an office sy

ID: 3603702 • Letter: T

Question

The assignment for my Application Development class has us creating an office system for a dentist. The following requirements are:

It must display the current lists for Dentists, Assistants, Patients, and Services

It must allow the user to add/edit/or delete items from this list

It must display an invoice for the customer based on the chosen services

I asked this yesterday and the answer I got helped immensely. I now have a questions on the exact code layout.

Namely, what would the code have to look like for case 5 in order to actually display the list as well as the changes made to them?

import java.util.Scanner;
import java.util.ArrayList;
public class OfficeSystem
{
public static void main (String[] args)
{
Scanner sc = new Scanner (System.in);
ArrayList patients = new ArrayList();
ArrayList doctors = new ArrayList();
ArrayList assistants = new ArrayList();
ArrayList services = new ArrayList();
Patient pat1 = new Patient (1,"James","Mack","123 ABC Street","Blue Cross");
Patient pat2 = new Patient (2,"Mark","Smith","456 DEF Street","United Health");
Patient pat3 = new Patient (3,"Doug","Barker","789 GHI Avenue","Kaiser Permanente");
patients.add(pat1);
patients.add(pat2);
patients.add(pat3);
Doctor doc1 = new Doctor (1,"Ben","Kenobi","555 Certain Point View","DDS");
Doctor doc2 = new Doctor (2,"Darth","Vader","777 Mustafar Street","DMD");
Doctor doc3 = new Doctor (3,"Luke","Skywalker","333 Toshe Station","DDS");
Doctor doc4 = new Doctor (4,"Han","Solo","111 Millenium Drive","DMD");
doctors.add(doc1);
doctors.add(doc2);
doctors.add(doc3);
doctors.add(doc4);
Assistant assist1 = new Assistant (1,"Leia","Organa","555 Alderaan Drive","Dr. Solo");
Assistant assist2 = new Assistant (2,"Poe","Dameron","777 Resistance Blvd","Dr. Skywalker");
Assistant assist3 = new Assistant (3,"Rey","Unknown","2187 Neema Outpost","Dr. Kenobi");
assistants.add(assist1);
assistants.add(assist2);
assistants.add(assist3);
Service serv1 = new Service (1,"Teeth Cleaning","Dr. Vader",7);
Service serv2 = new Service (2,"Root Canal","Dr. Kenobi",12);
Service serv3 = new Service (3,"Cavity Filling","Dr. Skywalker",20);
Service serv4 = new Service (4,"Gum Cleaning","Dr. Kenobi",15);
Service serv5 = new Service (5,"Tooth Pulling","Dr. Solo",15);
services.add(serv1);
services.add(serv2);
services.add(serv3);
services.add(serv4);
services.add(serv5);
System.out.println("***************************************************************");
System.out.println(" Kennesaw Dental Office ");
System.out.println("***************************************************************");
System.out.println("1. Display Patient List");
System.out.println("2. Display Doctor List");
System.out.println("3. Display Assistant List");
System.out.println("4. Display Service Fees");
System.out.println("5. Edit Patient List");
System.out.println("6. Edit Doctor List");
System.out.println("7. Edit Assistant List");
System.out.println("8. Edit Service Fees");
System.out.println("9. Issue Patient Invoice");
System.out.println("0. Exit the Program");
System.out.println("Please select an option: ");
int option = sc.nextInt();
switch(option)
{
case 1:
System.out.println("***************************************************************************");
System.out.println(" Patients ");
System.out.println("***************************************************************************");
break;
case 2:
System.out.println("***************************************************************************");
System.out.println(" Doctors ");
System.out.println("***************************************************************************");
break;
case 3:
System.out.println("***************************************************************************");
System.out.println(" Assistants ");
System.out.println("***************************************************************************");
break;
case 4:
System.out.println("***************************************************************************");
System.out.println(" Service Fees ");
System.out.println("***************************************************************************");
break;
case 5:
System.out.println("***************************************************************************");
System.out.println(" Patients ");
System.out.println("***************************************************************************");
System.out.println("Please enter an option 1-4: ");
System.out.println("1. Add a new entry");
System.out.println("2. Edit an existing entry");
System.out.println("3. Delete an entry");
System.out.println("4. Return to main menu");
int patientChoice = sc.nextInt();
switch (patientChoice)
{
case 1:
System.out.println("Please enter the patient information in the following format: ");
System.out.println("Patient # First Name Last Name Address Insurance Provider");
break;
case 2:
System.out.println("Please enter the number of the patient you would like to edit: ");
System.out.println("Please enter the patient information in the following format:");
System.out.println("Patient # First Name Last Name Address Insurance Provider");
break;
case 3:
System.out.println("Please enter the number of the patient you would like to delete: ");
break;
case 4:
break;
}
break;
case 6:
System.out.println("***************************************************************************");
System.out.println(" Doctors ");
System.out.println("***************************************************************************");
System.out.println("Please enter an option 1-4: ");
System.out.println("1. Add a new entry");
System.out.println("2. Edit an existing entry");
System.out.println("3. Delete an entry");
System.out.println("4. Return to main menu");
int doctorChoice = sc.nextInt();
switch (doctorChoice)
{
case 1:
System.out.println("Please enter the doctor information in the following format:");
System.out.println("Doctor # First Name Last Name Address Specialization");
break;
case 2:
System.out.println("Please enter the number of the doctor you would like to edit: ");
System.out.println("Please enter the doctor information in the following format:");
System.out.println("Doctor # First Name Last Name Address Specialization");
break;
case 3:
System.out.println("Please enter the number of the doctor you would like to delete: ");
break;
case 4:
break;
}
break;
case 7:
System.out.println("***************************************************************************");
System.out.println(" Assistants ");
System.out.println("***************************************************************************");
System.out.println("Please enter an option 1-4: ");
System.out.println("1. Add a new entry");
System.out.println("2. Edit an existing entry");
System.out.println("3. Delete an entry");
System.out.println("4. Return to main menu");
int assistantChoice = sc.nextInt();
switch (assistantChoice)
{
case 1:
System.out.println("Please enter the assistant information in the following format:");
System.out.println("Assistant # First Name Last Name Address Doctor");
break;
case 2:
System.out.println("Please enter the number of the assistant you would like to edit: ");
System.out.println("Please enter the assistant information in the following format:");
System.out.println("Assistant # First Name Last Name Address Doctor");
break;
case 3:
System.out.println("Please enter the number of the assistant you would like to delete: ");
break;
case 4:
break;
}
break;
case 8:
System.out.println("***************************************************************************");
System.out.println(" Service Fees ");
System.out.println("***************************************************************************");
System.out.println("Please enter an option 1-4: ");
System.out.println("1. Add a new entry");
System.out.println("2. Edit an existing entry");
System.out.println("3. Delete an entry");
System.out.println("4. Return to main menu");
int serviceChoice = sc.nextInt();
switch (serviceChoice)
{
case 1:
System.out.println("Please enter the service information in the following format:");
System.out.println("Service # Service Title Doctor Service Price");
break;
case 2:
System.out.println("Please enter the number of the service you would like to edit: ");
System.out.println("Please enter the service information in the following format:");
System.out.println("Service # Service Title Doctor Service Price");
break;
case 3:
System.out.println("Please enter the number of the service you would like to delete: ");
break;
case 4:
break;
}
break;
}
}
}

public class Patient

{

private String firstName;

private String lastName;

private String address;

private String insurance;

private int identification;

public Patient (int id, String fname, String lname, String add, String ins)

{

firstName = fname;

lastName = lname;

address = add;

insurance = ins;

identification = id;

}

public void setIdentification (int id)

{

identification = id;

}

public int getIdentification ()

{

return identification;

}

public void setFirstName (String fname)

{

firstName = fname;

}

public String getFirstName ()

{

return firstName;

}

public void setLastName (String lname)

{

lastName = lname;

}

public String getLastName ()

{

return lastName;

}

public void setAddress (String add)

{

address = add;

}

public String getAddress ()

{

return address;

}

public void setInsurance (String ins)

{

insurance = ins;

}

public String getInsurance ()

{

return insurance;

}

}

public class Doctor

{

private String firstName;

private String lastName;

private String address;

private String specialization;

private int identification;

public Doctor (int id, String fname, String lname, String add, String special)

{

firstName = fname;

lastName = lname;

address = add;

specialization = special;

identification = id;

}

public void setIdentification (int id)

{

identification = id;

}

public int getIdentification ()

{

return identification;

}

public void setFirstName (String fname)

{

firstName = fname;

}

public String getFirstName ()

{

return firstName;

}

public void setLastName (String lname)

{

lastName = lname;

}

public String getLastName ()

{

return lastName;

}

public void setAddress (String add)

{

address = add;

}

public String getAddress ()

{

return address;

}

public void setPhoneNumber (String special)

{

specialization = special;

}

public String getSpecialization ()

{

return specialization;

}

}

public class Assistant

{

private String firstName;

private String lastName;

private String address;

private String doctor;

private int identification;

public Assistant (int id, String fname, String lname, String add, String doc)

{

firstName = fname;

lastName = lname;

address = add;

doctor = doc;

identification = id;

}

public void setIdentification (int id)

{

identification = id;

}

public int getIdentification ()

{

return identification;

}

public void setFirstName (String fname)

{

firstName = fname;

}

public String getFirstName ()

{

return firstName;

}

public void setLastName (String lname)

{

lastName = lname;

}

public String getLastName ()

{

return lastName;

}

public void setAddress (String add)

{

address = add;

}

public String getAddress ()

{

return address;

}

public void setDoctor (String doc)

{

doctor = doc;

}

public String getDoctor ()

{

return doctor;

}

}

public class Service

{

private String serviceName;

private String doctor;

private int identification;

private int price;

public Service (int id, String name, String doc, int pr)

{

serviceName = name;

doctor = doc;

identification = id;

price = pr;

}

public void setIdentification (int id)

{

identification = id;

}

public int getIdentification ()

{

return identification;

}

public void setServiceName (String name)

{

serviceName = name;

}

public String getServiceName ()

{

return serviceName;

}

public void setDoctor (String doc)

{

doctor = doc;

}

public String getDoctor ()

{

return doctor;

}

public void setPrice (int pr)

{

price = pr;

}

public int getPrice ()

{

return price;

}

}

Explanation / Answer

NOTE:

1. Removed raw type ArrayList and parameterized references to generic type ArrayList<E>.
       ArrayList<Patient> patients = new ArrayList<Patient>();
       ArrayList<Doctor> doctors = new ArrayList<Doctor>();
       ArrayList<Assistant> assistants = new ArrayList<Assistant>();
       ArrayList<Service> services = new ArrayList<Service>();.
  
2. Overridden toString methods in all the model classes (Doctor, Patient, Service and Assistant)to pretty print the data.
   Eg:    @Override
           public String toString() {
               return "Doctor [FirstName=" + firstName + ", LastName=" + lastName + ", Address=" + address
               + ", Specialization=" + specialization + ", Identification=" + identification + "]";
       }

3. Menu option input was not working corrected that. Added loop to accept input until the program is closed or exited via users console.

4. The cases were actually not doing anything, added code to actually display items.
   Display Patient List
   Display Doctor List
   Display Assistant List
   Display Service Fees

5. Added working program termination option (refer Case 0) from console.

6. Finally added code for case 5
1. Add a new entry (Takes user input in format "ID Number#First Name#Last Name#Address#Insurance Provider"
For example: 102#Robert#Langdon#221B Baker Street#GSK"
and inserts into the list and prints the new list.
)
2. Edit an existing entry
(Takes user input of entry to be modified and the new data in format "ID Number#First Name#Last Name#Address#Insurance Provider"
For example: 102#Robert#Langdon#221B Baker Street#GSK"
and edits list and prints the new list.
3. Delete an entry (Takes user input for the entry to be deleted and prints new shortened list.)
4. Return to main menu

Edit options for others can be implemented in similar way.

7. Added invoice generation (refer case 9) which wasn't there, with option to selet services and dynamic price calculation.

8. Added comments where needed for understanding.

Code: (All the classes have been modified and listed sequentially)

import java.util.Scanner;
import java.util.ArrayList;

public class OfficeSystem {
   public static void main(String[] args) {
       ArrayList<Patient> patients = new ArrayList<Patient>();
       ArrayList<Doctor> doctors = new ArrayList<Doctor>();
       ArrayList<Assistant> assistants = new ArrayList<Assistant>();
       ArrayList<Service> services = new ArrayList<Service>();
       Patient pat1 = new Patient(1, "James", "Mack", "123 ABC Street", "Blue Cross");
       Patient pat2 = new Patient(2, "Mark", "Smith", "456 DEF Street", "United Health");
       Patient pat3 = new Patient(3, "Doug", "Barker", "789 GHI Avenue", "Kaiser Permanente");
       patients.add(pat1);
       patients.add(pat2);
       patients.add(pat3);
       Doctor doc1 = new Doctor(1, "Ben", "Kenobi", "555 Certain Point View", "DDS");
       Doctor doc2 = new Doctor(2, "Darth", "Vader", "777 Mustafar Street", "DMD");
       Doctor doc3 = new Doctor(3, "Luke", "Skywalker", "333 Toshe Station", "DDS");
       Doctor doc4 = new Doctor(4, "Han", "Solo", "111 Millenium Drive", "DMD");
       doctors.add(doc1);
       doctors.add(doc2);
       doctors.add(doc3);
       doctors.add(doc4);
       Assistant assist1 = new Assistant(1, "Leia", "Organa", "555 Alderaan Drive", "Dr. Solo");
       Assistant assist2 = new Assistant(2, "Poe", "Dameron", "777 Resistance Blvd", "Dr. Skywalker");
       Assistant assist3 = new Assistant(3, "Rey", "Unknown", "2187 Neema Outpost", "Dr. Kenobi");
       assistants.add(assist1);
       assistants.add(assist2);
       assistants.add(assist3);
       Service serv1 = new Service(1, "Teeth Cleaning", "Dr. Vader", 7);
       Service serv2 = new Service(2, "Root Canal", "Dr. Kenobi", 12);
       Service serv3 = new Service(3, "Cavity Filling", "Dr. Skywalker", 20);
       Service serv4 = new Service(4, "Gum Cleaning", "Dr. Kenobi", 15);
       Service serv5 = new Service(5, "Tooth Pulling", "Dr. Solo", 15);
       services.add(serv1);
       services.add(serv2);
       services.add(serv3);
       services.add(serv4);
       services.add(serv5);

       while(true){
           Scanner sc = new Scanner(System.in);
           System.out.println("***************************************************************");
           System.out.println(" Kennesaw Dental Office ");
           System.out.println("***************************************************************");
           System.out.println("1. Display Patient List");
           System.out.println("2. Display Doctor List");
           System.out.println("3. Display Assistant List");
           System.out.println("4. Display Service Fees");
           System.out.println("5. Edit Patient List");
           System.out.println("6. Edit Doctor List");
           System.out.println("7. Edit Assistant List");
           System.out.println("8. Edit Service Fees");
           System.out.println("9. Issue Patient Invoice");
           System.out.println("0. Exit the Program");
           System.out.println("Please select an option: ");
           int option = sc.nextInt();
       switch (option) {
       case 1:
           System.out.println("***************************************************************************");
           System.out.println(" Patients ");
           System.out.println("***************************************************************************");
           for(Patient patient:patients){
               System.out.println(patient.toString());
           }
           break;
       case 2:
           System.out.println("***************************************************************************");
           System.out.println(" Doctors ");
           System.out.println("***************************************************************************");
           for(Doctor doctor:doctors){
               System.out.println(doctor.toString());
           }
           break;
       case 3:
           System.out.println("***************************************************************************");
           System.out.println(" Assistants ");
           System.out.println("***************************************************************************");
           for(Assistant assistant:assistants){
               System.out.println(assistant.toString());
           }
           break;
       case 4:
           System.out.println("***************************************************************************");
           System.out.println(" Service Fees ");
           System.out.println("***************************************************************************");
           for(Service service:services){
               System.out.println(service.toString());
           }
           break;
       case 5:
           System.out.println("***************************************************************************");
           System.out.println(" Patients ");
           System.out.println("***************************************************************************");
           for(Patient patient:patients){
               System.out.println(patient.toString());
           }
           System.out.println("Please enter an option 1-4: ");
           System.out.println("1. Add a new entry");
           System.out.println("2. Edit an existing entry");
           System.out.println("3. Delete an entry");
           System.out.println("4. Return to main menu");
           int patientChoice = sc.nextInt();
           switch (patientChoice) {
           case 1:
               System.out.println("Please enter the patient information in the following format: ");
               System.out.println("ID Number#First Name#Last Name#Address#Insurance Provider");
               System.out.println("For example: 102#Robert#Langdon#221B Baker Street#GSK");
               sc.nextLine(); // To consume new lines of earlier input taken via scanner
               String input1 = sc.nextLine();
               String[] inputArr1 = input1.split("#", -1); //Splits sequential input in to array on each hash
               Patient p1 = new Patient(Integer.valueOf(inputArr1[0]),inputArr1[1],inputArr1[2],inputArr1[3],inputArr1[4]);
               patients.add(p1);
               System.out.println("***************************************************************************");
               System.out.println(" New Patients List");
               System.out.println("***************************************************************************");
               for(Patient patient:patients){
                   System.out.println(patient.toString());
               }
               break;
           case 2:
               System.out.println("Please enter the number of the patient you would like to edit: ");
               int patientNoToBeEdited = sc.nextInt();
               System.out.println("Please enter the patients new information in the following format:");
               System.out.println("ID Number#First Name#Last Name#Address#Insurance Provider");
               System.out.println("For example: 102#Robert#Langdon#221B Baker Street#GSK");
               sc.nextLine();
               String input2 = sc.nextLine();
               String[] inputArr2 = input2.split("#", -1);
               Patient p2 = new Patient(Integer.valueOf(inputArr2[0]),inputArr2[1],inputArr2[2],inputArr2[3],inputArr2[4]);
               patients.remove(patientNoToBeEdited - 1); // Since array list count starts from 0, subtracting 1 from patient number
               patients.add(patientNoToBeEdited -1, p2);
               System.out.println("***************************************************************************");
               System.out.println(" Edited Patients List");
               System.out.println("***************************************************************************");
               for(Patient patient:patients){
                   System.out.println(patient.toString());
               }
               break;
           case 3:
               System.out.println("Please enter the number of the patient you would like to delete: ");
               int patientNoToBeDeleted = sc.nextInt();
               patients.remove(patientNoToBeDeleted-1);
               System.out.println("***************************************************************************");
               System.out.println(" New Patients List");
               System.out.println("***************************************************************************");
               for(Patient patient:patients){
                   System.out.println(patient.toString());
               }
               break;
           case 4:
               break;
           }
           break;
       case 6:
           System.out.println("***************************************************************************");
           System.out.println(" Doctors ");
           System.out.println("***************************************************************************");
           System.out.println("Please enter an option 1-4: ");
           System.out.println("1. Add a new entry");
           System.out.println("2. Edit an existing entry");
           System.out.println("3. Delete an entry");
           System.out.println("4. Return to main menu");
           int doctorChoice = sc.nextInt();
           switch (doctorChoice) {
           case 1:
               System.out.println("Please enter the doctor information in the following format:");
               System.out.println("Doctor # First Name Last Name Address Specialization");
               break;
           case 2:
               System.out.println("Please enter the number of the doctor you would like to edit: ");
               System.out.println("Please enter the doctor information in the following format:");
               System.out.println("Doctor # First Name Last Name Address Specialization");
               break;
           case 3:
               System.out.println("Please enter the number of the doctor you would like to delete: ");
               break;
           case 4:
               break;
           }
           break;
       case 7:
           System.out.println("***************************************************************************");
           System.out.println(" Assistants ");
           System.out.println("***************************************************************************");
           System.out.println("Please enter an option 1-4: ");
           System.out.println("1. Add a new entry");
           System.out.println("2. Edit an existing entry");
           System.out.println("3. Delete an entry");
           System.out.println("4. Return to main menu");
           int assistantChoice = sc.nextInt();
           switch (assistantChoice) {
           case 1:
               System.out.println("Please enter the assistant information in the following format:");
               System.out.println("Assistant # First Name Last Name Address Doctor");
               break;
           case 2:
               System.out.println("Please enter the number of the assistant you would like to edit: ");
               System.out.println("Please enter the assistant information in the following format:");
               System.out.println("Assistant # First Name Last Name Address Doctor");
               break;
           case 3:
               System.out.println("Please enter the number of the assistant you would like to delete: ");
               break;
           case 4:
               break;
           }
           break;
       case 8:
           System.out.println("***************************************************************************");
           System.out.println(" Service Fees ");
           System.out.println("***************************************************************************");
           System.out.println("Please enter an option 1-4: ");
           System.out.println("1. Add a new entry");
           System.out.println("2. Edit an existing entry");
           System.out.println("3. Delete an entry");
           System.out.println("4. Return to main menu");
           int serviceChoice = sc.nextInt();
           switch (serviceChoice) {
           case 1:
               System.out.println("Please enter the service information in the following format:");
               System.out.println("Service # Service Title Doctor Service Price");
               break;
           case 2:
               System.out.println("Please enter the number of the service you would like to edit: ");
               System.out.println("Please enter the service information in the following format:");
               System.out.println("Service # Service Title Doctor Service Price");
               break;
           case 3:
               System.out.println("Please enter the number of the service you would like to delete: ");
               break;
           case 4:
               break;
           }
           break;
       case 9:  
               System.out.println("***************************************************************************");
               System.out.println(" Generate Invoice ");
               System.out.println("***************************************************************************");
               System.out.println(" Enter the services you want from below list: ");
               System.out.println(" Please input in below format. If you want 1st and 3rd service then enter 1#3.");
               for (Service service : services) {
                   System.out.println(service.toString());
               }
               sc.nextLine();
               String input3 = sc.nextLine();
               String[] inputArr3 = input3.split("#", -1);
               System.out.println("----------------------Customer Invoice Start-------------------------");
               System.out.println("Service(s) Selected: ");
               int bill = 0;
               for(int i=0; i<inputArr3.length;i++){
                   System.out.println(services.get(Integer.parseInt(inputArr3[i])-1).toString());
                   bill += services.get(Integer.parseInt(inputArr3[i])-1).getPrice();
               }
               System.out.println("Net payble amount: $"+bill);
               System.out.println("----------------------Customer Invoice End-------------------------");
               break;
       case 0: System.exit(0);  
       }
   }
   }
}


public class Patient

{

   private String firstName;

   private String lastName;

   private String address;

   private String insurance;

   private int identification;

   public Patient(int id, String fname, String lname, String add, String ins)

   {

       firstName = fname;

       lastName = lname;

       address = add;

       insurance = ins;

       identification = id;

   }

   public void setIdentification(int id)

   {

       identification = id;

   }

   public int getIdentification()

   {

       return identification;

   }

   public void setFirstName(String fname)

   {

       firstName = fname;

   }

   public String getFirstName()

   {

       return firstName;

   }

   public void setLastName(String lname)

   {

       lastName = lname;

   }

   public String getLastName()

   {

       return lastName;

   }

   public void setAddress(String add)

   {

       address = add;

   }

   public String getAddress()

   {

       return address;

   }

   public void setInsurance(String ins)

   {

       insurance = ins;

   }

   public String getInsurance()

   {

       return insurance;

   }

   @Override
   public String toString() {
       return "Patient [FirstName=" + firstName + ", LastName=" + lastName + ", Address=" + address + ", Insurance="
               + insurance + ", Identification=" + identification + "]";
   }
}

public class Doctor

{

   private String firstName;

   private String lastName;

   private String address;

   private String specialization;

   private int identification;

   public Doctor(int id, String fname, String lname, String add, String special)

   {

       firstName = fname;

       lastName = lname;

       address = add;

       specialization = special;

       identification = id;

   }

   public void setIdentification(int id)

   {

       identification = id;

   }

   public int getIdentification()

   {

       return identification;

   }

   public void setFirstName(String fname)

   {

       firstName = fname;

   }

   public String getFirstName()

   {

       return firstName;

   }

   public void setLastName(String lname)

   {

       lastName = lname;

   }

   public String getLastName()

   {

       return lastName;

   }

   public void setAddress(String add)

   {

       address = add;

   }

   public String getAddress()

   {

       return address;

   }

   public void setPhoneNumber(String special)

   {

       specialization = special;

   }

   public String getSpecialization()

   {

       return specialization;

   }

   @Override
   public String toString() {
       return "Doctor [FirstName=" + firstName + ", LastName=" + lastName + ", Address=" + address
               + ", Specialization=" + specialization + ", Identification=" + identification + "]";
   }

  
}

public class Service

{

   private String serviceName;

   private String doctor;

   private int identification;

   private int price;

   public Service(int id, String name, String doc, int pr)

   {

       serviceName = name;

       doctor = doc;

       identification = id;

       price = pr;

   }

   public void setIdentification(int id)

   {

       identification = id;

   }

   public int getIdentification()

   {

       return identification;

   }

   public void setServiceName(String name)

   {

       serviceName = name;

   }

   public String getServiceName()

   {

       return serviceName;

   }

   public void setDoctor(String doc)

   {

       doctor = doc;

   }

   public String getDoctor()

   {

       return doctor;

   }

   public void setPrice(int pr)

   {

       price = pr;

   }

   public int getPrice()

   {

       return price;

   }

   @Override
   public String toString() {
       return "Service [ServiceName=" + serviceName + ", Doctor=" + doctor + ", Identification=" + identification
               + ", Price=" + price + "]";
   }
  
  
}

public class Assistant

{

   private String firstName;

   private String lastName;

   private String address;

   private String doctor;

   private int identification;

   public Assistant(int id, String fname, String lname, String add, String doc)

   {

       firstName = fname;

       lastName = lname;

       address = add;

       doctor = doc;

       identification = id;

   }

   public void setIdentification(int id)

   {

       identification = id;

   }

   public int getIdentification()

   {

       return identification;

   }

   public void setFirstName(String fname)

   {

       firstName = fname;

   }

   public String getFirstName()

   {

       return firstName;

   }

   public void setLastName(String lname)

   {

       lastName = lname;

   }

   public String getLastName()

   {

       return lastName;

   }

   public void setAddress(String add)

   {

       address = add;

   }

   public String getAddress()

   {

       return address;

   }

   public void setDoctor(String doc)

   {

       doctor = doc;

   }

   public String getDoctor()

   {

       return doctor;

   }

   @Override
   public String toString() {
       return "Assistant [FirstName=" + firstName + ", LastName=" + lastName + ", Address=" + address + ", Doctor="
               + doctor + ", Identification=" + identification + "]";
   }

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote