In an assignment, I have to use four different files in a single program. I know doing so has something to do with inheritance (which we're studying now), but I don't understand how to write each file to use the others. How do I use multiple files in this single program?
The assignment reads like this:
* create four distinct .java files:
o Person.java
o HeadofHousehold.java (extends Person)
o Dependent.java (extends Person)
o NeighborhoodCensus.java (which will contain the program's main() method)
* use an array of Dependents in capturing input and producing output
As in several earlier assignments, your goal is to create a program that gathers census information from possibly several households, until the user indicates that he or she wishes to stop. At the end of the process of gathering information for each family, that family's data will be reported in this sequence:
* all summary household data as reported in previous assignments, such as the level of family income
* the name, age, gender, and marital status of the HeadofHousehold (only one per family)
* the name, age, gender and marital status of each Dependent in the family