Entry level class assignment; Sort alphabetically

Hello this is my first semester using C++ and I am very 'green' when it comes to programming. My assignment is as follows:

Create a program that will accept three names and their ages from a file called NAMES.TXT.
After accepting the names and ages from the file, output the names in alphabetical order
followed by outputting the names and their ages in ascending order by age. Example will be shown below.
Reference the rubric for grading purposes. CPP file should be named LASTNAME-4.CPP.

The data in the NAMES.TXT file should be as follows:

Luke 48

Josey 25

Jeremy 36

The professor likely covered some kind of sorting function recently, however I've been absent most of the week due to a fever. What is a reasonably simple way to do this and make it work with whatever name/age he decides to put in the file?
Topic archived. No new replies allowed.