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
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.
Step by Step Solution
3.36 Rating (174 Votes )
There are 3 Steps involved in it
include stdlibfacilitiesh note that different compilersSDEs keep header files in different places so ... View full answer
Get step-by-step solutions from verified subject matter experts
