Problem

Ordered by Name, Ordered by Age Write a program that processes a text file that c...

Ordered by Name, Ordered by Age

Write a program that processes a text file that contains names of people paired with ages. Each name–age pair is on a line by itself, with the name coming first and separated from the age by whitespace. The program prints out the data line by line, in alphabetical order of names, and then prints out the same data in ascending order of age. Here is a sample input file.

Mary 45

Anna 78

Sophia 5

Petros 12

The file may have any number of lines of such data. The output should be printed to the screen as well as to an output file.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT