#2 Design and implement a Name pairs class(or struct) holding (name,age) pairs w
ID: 661177 • Letter: #
Question
#2 Design and implement a Name pairs class(or struct) holding (name,age) pairs where name is a string and age is a double. Represent that as a vector (called name) and a vector (called age) member. Provide an input operation read names() that reads a series of names. Provide a read ages() operation that prompts the user for an age for each name. Provide a print() operation that prints out the (name[i],age[i]) pairs (one per line) in the order determined by the name vector. Provide a sort() operation that sorts the name vector in alphabetical order and reorganizes the age vector to match. Implement all
Explanation / Answer
how does this problem work?
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.