This is practice problem 1 from chapter 3 re'ampd in C++.