Programming Exercises

1: Modify Listing 10.13 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 Stonewt class 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 one can add, subtract, and multiply Stonewt values. Test your class with a short program.
3: Rewrite the Stonewt class so that it overloads the relational operators. Write ...

Get The Waite Group's C++ Primer Plus, Third 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.