Design and implement a Name_pairs class holding (name,age) pairs where name is a string and age is
Question:
Design and implement a Name_pairs class 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 “operations” as member functions. Test the class (of course: test early and often).
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 44% (9 reviews)
C Program include include include using namespace std class ...View the full answer
Answered By
Joash Mokaya
I am an experienced tutor with more than 7 years of experience. I have helped thousands of students pursue their academic goals. My primary objective as a tutor is to ensure that students have an easy time handling their academic tasks.
0.00
0 Reviews
10+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
In this project, we will make up a banking system. You are an employee of MadeUp Banking. Your job is to manage multiple bank accounts. Here, you would create new accounts, deposit to an account,...
-
Design and implement a C++ class called Module that handles information regarding your assignments for a specific module. Think of all the things you would want to do with such a class and write...
-
Design the door class which has the property of either open or shut. The door can also be opened and shut. Design another special type of door class called lockable door. Lockable door is like a...
-
is an acute angle such that tan() =1/3. What is the value of 1010. (sin + cos)? 3.
-
Rearrange the equation to solve for the indicated unknown. a. 7 .5b+2.5 Solve for b: b. 64 4 c. 3a .25V Solve for c: Solve for a:
-
Fastball Delivery Company acquired an adjacent lot to construct a new warehouse, paying $30,000 and giving a short-term note for $270,000. Legal fees paid were $1,425, delinquent taxes assumed were...
-
"Remote" for purposes of material and control deficiencies refers to: a. One out of 20 b. One out of 25 c. One out of 30 d. One out of 40 e. Some other description
-
Newcastle Mining Company (NMC) mines coal, puts it through a one-step crushing process, and loads the bulk raw coal onto river barges for shipment to customers. NMCs management is currently...
-
Can someone please help me with this case? You have been assigned to the audit of the financial statements of Coffee Break Ltd. (CB) for its year ending December 31, 2021. You are excited because t...
-
Consider the composite solid shown. Solid A is a thermally conductive material that is 0.5-cm thick and has a thermal conductivity, KA = 50 W=m K. The back side of solid A (x = 0) is thermally...
-
List sets of plausible operations for the examples of real-world objects in 9.1 (such as toaster).
-
Replace Name_pair::print() with a (global) operator < < and define == and != for Name_pairs.
-
Perform the indicated operations assuming all numbers are approximate and round the answer appropriately. Use the procedure shown in Example 11. Data from Example 11 For problems with multiple...
-
Explain the significance of proprietary trading.
-
What is the difference between a private-client representative and an institutional salesman?
-
What is an ETF?
-
You have 30,000 to put into savings. Discuss, with examples, some of the different risk-spreading investment schemes you could invest in.
-
What is asset management?
-
1- Describe the key information required to monitor a project, and how each piece of information would be analyzed (that is: what action would you take based on what the data told you?). Is different...
-
Explain the term global capital markets. This chapter primarily discusses global equity markets. What other types of financial instruments are traded in these markets? How important are global...
-
Referring to the CRC-32 polynomial in Table 10.4, answer the following questions: Table 10.4 a. Does it detect a single error? Defend your answer. b. Does it detect a burst error of size 16? Defend...
-
Referring to the CRC-8 polynomial in Table 10.7, answer the following questions: a. Does it detect a single error? Defend your answer. b. Does it detect a burst error of size 6? Defend your answer....
-
Which of the following CRC generators guarantee the detection of a single bit error? a. x 3 + x + 1 b. x 4 + x 2 c. 1 d. x 2 + 1
-
Rent, depreciation, and salaries are examples of: A. current assets. B. current liabilities. C. owners equity. D. operating expenses.
-
https://youtu.be/yY96hTb8WgI Watch the following Video. This shows the bad of everyday design. There are some really simple ways to fix these bad design decisions. Using what we went through in...
-
Ho H = Calc ine and alternative hypotheses. Wins occur with all different frequency in the different post positions. x- =U At least one post position has a different frequency of wins than the...
Study smarter with the SolutionInn App