A registry office has stored into two text files (named “births.txt” and “deaths.txt”, respec-tively) the dates of the births and deaths occurred in a small village.
The format of the two files is identical:
•For each person, two consecutive file lines are used.
•The first line reports the name and surname of the person.
•The second line gives the date (specified with format yyyy/mm/dd) in which that person was born or died, respectively. (10 points)Write a program which, starting from the contents of the two files, generates an output files, named “ _lives.txt”, in which every line reports all the data about one person from the same family (with the same surname), with format: Assume that the number of people in the two files is limited to 1000 and that every person appear-ing in one file also appears in the other file. Data should be stored as an object using Class. (10 points)Output file “ _lives.txt” should be sorted by “Birth year” in DESCENDING way. (10 points)Print in Output Least-liver person (Person who lived the least). Please take into account only year. Month and date should not be taken into account. (10 points)Example: Assume the following contents for the two input files: births.txtdeaths.txtGreens HopkinsGreens Hopkins1932/01/011988/02/15Whites SmithBlacks Jonas1940/06/192000/02/10Blacks JonasWhites Smith1942/12/221996/04/21Then, the following file should be generated (the order of the lines is not relevant):Hopkins_lives.txtGreens Hopkins 1932/01/01 1988/02/15Smith_lives.txtWhites Smith 1940/06/19 1996/04/21Jonas_lives.txtBlacks Jonas 1942/12/22 2000/02/10Output: Least-liver person: Greens Hopkins 1932/01/01 1988/02/15
Answers
Answered by
0
Answer:
Events occurring before the invention of writing systems are considered prehistory. "History" is an umbrella term that relates to past events as well as the memory, discovery, collection, organization, presentation, and interpretation of information about these events.
Similar questions