Design and implement a name_pairs class

Assignment Help Basic Computer Science
Reference no: EM131395673

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).

Reference no: EM131395673

Questions Cloud

Create functions for returning those data values : Create functions for checking a book in and out. Do simple validation of data entered into a Book; for example, accept ISBNs only of the form n-n-n-x where n is an integer and x is a digit or a letter. Store an ISBN as a string.
Quality of textbooks increased dramatically : Professors required each student to buy 10 notebooks, regardless of the price. The quality of textbooks increased dramatically from 2014 to 2016, with textbook companies bundling new online study aids with their books, but this quality change is h..
Whether definitions are stipulative or lexical - femikin : Determine whether the following definitions are stipulative, lexical, precising, theoretical, or persuasive.- "Femikin" means a female manikin.
What is monopolistic about monopolistic competition : 1. Give examples of industries that are monopolistically competitive. Find the news articles, books which explain these examples. 2. What is "monopolistic" about monopolistic competition? What is "competitive" about a monopolistically competitive..
Design and implement a name_pairs class : 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).
Should the united states maintain its position : The United States has maintained its stance. Should governments anywhere, all with imperfect human-designed and human-run justice systems, take human life? Should the United States maintain its position
How does your program deal with boundary conditions : COMP 2103X1- Does you program "blow up" on unexpected input, or does it deal with bad input in a "graceful" way? How does your program deal with boundary conditions, if there are any?
Describe how a change in the exchange rate affected : Question One: Using shifts in supply and demand curves, describe how a change in the exchange rate affected your industry in a hospital setting. Label the axes, and state the geographic, product, and time dimensions of the demand and supply curves..
Whether definitions are stipulative or lexical - sound : Determine whether the following definitions are stipulative, lexical, precising, theoretical, or persuasive.- "Sound" means a compression wave, in air or some other elastic medium, having a frequency ranging (for humans) from 20 to 20,000 vibration..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Show the relational schema design under each of those option

show the relational schema design under each of those options.

  Nominal rate of interest

The abc corporation earned a real rate return of 4.5 percent on an investment. In the economy, the nominal rate of interest ws 6 percent and the rate of infation was 3 percent. We can conclude that?

  New access database and set up a table named sales rep

Create a new Access database and set up a table named Sales Rep. Be sure to create attributes, set a primary key, select data types, and add descriptions as necessary. Use the following information:

  Write a c++ program that reads the data in the file created

The output should contain the total miles driven, total gallons of gas used, and average mpg for all cars. These totals should be displayed at the end of the output report.

  What is the output of the following loop

What is the output of the following loop? System.out.println("+----+"); for (int i = 1; i

  Describe valid advice for naming variables

Which of the given is valid advice for naming variables? To save typing, make most variable names one or two letters. to avoid conflict with names which others are using , utilize unusual or unpronounceable names.

  Find approximate distance between arkadelphia and alexandria

Minneapolis, Minnesota; Arkadelphia, Arkansas; and Alexandria, Louisiana lie on the same longitude line. The latitude of Minneapolis is 45° N, the latitude of Arkadelphia is 34° N, and the latitude of Alexandria is 31° N. The radius of Earth is ab..

  What are the advantages of flash memory over hard disk

1. what are the advantages of flash memory over hard disk storage? what are the advantages of hard disk over flash

  Necessary part of any business

1. It is common knowledge that employees are a necessary part of any business. Identify three (3) best practices in the user domain and suggest the control type(s) (technical or manual) that are best suited to monitor each best practice.

  How would you avoid the pitfalls posed by the inequalities

What is mental accounting and how does it impact consumer decision making?

  Megatrend of demographics

Evaluate the megatrend of demographics in the IT field. Give your opinion as to why IT managers must understand this megatrend when selecting talent for organizational positions.

  Application-plush packet institute of technology

IT governance is concerned with oversight and accountability. It ensures that information security is used properly to support business goals, especially strategic ones. Strong governance is effective and yields comprehensive security policies, pr..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd