Answer:
string sep = "";
for (i = 0; i < NUM_VALS; i++) {
cout << sep << hourlyTemp[i];
sep = ", ";
}
Step-by-step explanation:
Insert the snippet at the commented location.
With the absence of a join() method as found in other languages, it is always a hassle to suppress that separator comma from appearing at the beginning or the end of your output. This solution is nice since it doesn't require any magic flags to keep track of wether the first element was printed.