My current assignment is essentially as follows:
- I have two classes that are subclasses of a Person class, called Patient and Physician.
- I then have a class called Bill that contains Patient and Physician objects (mimicking a patient's visit to the physician's office where a bill would be required).
- In my main class, I have created an Array List of the Bill class to hold all bill info (Patient info and Physician info) as it's entered by the user.
- At the end of the main class, I need to give a summary off all the data.
Here's the Class Diagram if it helps: http://aceteam.ca/adev1000/assignmen...ProjectUML.pdf
Question: Is there any way for me to access the getVisitFee() method I have within Patient if I've only created an Array List of Bill, which contains Patient objects? I need to give a summary of all visit fees totalled up for the session. I of course can easily add them up as the user input is collected, but I want to make sure there isn't a way to access this using the getVisitFee() method that's available first.
I've read over our class notes and nothing remotely like this is explained...and Google is not being helpful.
If you could help me think this through, I'd be very grateful! I don't need the actual code...just an explanation is fine.