Read five names into a vector name, then prompt the user for the ages of the people

Question:

Read five names into a vector name, then prompt the user for the ages of the people named and store the ages in a vector age. Then print out the five (name[i],age[i]) pairs. Sort the nam    es (sort(name .begin(),name.end())) and print out the (name[i],age[i]) pairs. The tricky part here is to get the age vector in the correct order to match the sorted name vector.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: