Programming Exercises

1:Modify Listing 11.15 so that instead of reporting the results of a single trial for a particular target-step combination, it reports the highest, lowest, and average number of steps for N trials, where N is an integer entered by the user.
2:Rewrite the final Time class example (Listings 11.10,11.11 and 11.12) so that all the overloaded operators are implemented using friend functions.
3:Rewrite the Stonewt class (Listings 11.16 and 11.17) so that it has a state member governing whether the object is interpreted in stone form, integer pounds form, or floating-point pounds form. Overload the << operator to replace the show_stn() and show_lbs() methods. Overload the addition, subtraction, and multiplication operators so that ...

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.