Chapter 4. More Basics

Now that we have seen how to write a simple program in C++, it's time to acquire some more tools. We'll extend our example program from Chapter 3 for finding the heaviest pumpkin. Eventually, we want to provide the weights of the three heaviest pumpkins, so that first, second, and third prizes can be awarded. It might seem that this would require just a minor modification of the previous program, in which we would keep track of the heaviest so far, second heaviest so far, and third heaviest so far, rather than merely the heaviest so far. However, this modification turns out to be a bit more complicated than it seems. Since this book is intended to teach you how to program using C++, rather than just how to use the C++ language, it's worth investigating why this is. First, though, here are the objectives of this chapter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset