Programming Exercises
1: | The Wine class has a String class object (Chapter 12) holding the name of a wine and ArrayDb class object (this chapter) of Pair objects (this chapter), with each Pair element holding a vintage year and the number of bottles for that year. For example, a Pair might contain the value 1990 for the year and 38 for the number of bottles. Implement the Wine class using containment and test it with a simple program. The program should prompt you to enter a wine name, the number of elements of the array, and the year and bottle count information for each array element. The program should use this data to construct a Wine object, then display the information stored in the object. |
2: | The Wine class has a String class object (Chapter ... |
Get C++ Primer Plus, Fourth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.