/** @return total value of registration owed to the council */ private double totalRegistrationOwed() { double totalRegistration = 0; for (Doctor doctor : doctors) { totalRegistration += doctor.calculateRegistrationFee(); } return totalRegistration; }
/** @return total value of registration owed to the council by Specialists */ private double totalSpecialistRegistrationOwed() { double totalSpecialistRegistration = 0; for (Doctor doctor : doctors) { if (doctor instanceof Specialist) { totalSpecialistRegistration += doctor.calculateRegistrationFee(); } } return totalSpecialistRegistration; }
/** @return total value of registration owed to the council by General doctors */ private double totalGeneralRegistrationOwed() { double totalGeneralRegistration = 0; for (Doctor doctor : doctors) { if (doctor instanceof General) { totalGeneralRegistration += doctor.calculateRegistrationFee(); } } return totalGeneralRegistration; }
/** @return total value of registration owed to the council by Interns */ private double totalInternRegistrationOwed() { double totalInternRegistration = 0; for (Doctor doctor : doctors) { if (doctor instanceof Internship) { totalInternRegistration += doctor.calculateRegistrationFee(); } } return totalInternRegistration; }