In this chapter, sequences (arrays) of values, enumeration types, weather data, and board games are discussed.
Arrays
“If you don’t like the weather in these parts,” the old-timer said with a twinkle in his eye, “wait a few minutes.”
Let’s find out if he’s right: we’ll take 10 temperatures at 1-minute intervals and see the variation. I’ll start like this:
double temp1; sout << "Enter a temperature: "; sin >> temp1;
double temp2; sout << "Enter a temperature: "; sin >> temp2;
double temp3; sout << "Enter a temperature: "; sin >> temp3;
That’s getting old fast. Maybe there’s a better way to store 10 numbers. ...