#include // makes cin, cout available #include // needed to use strings string months[] = { "", "January" , "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; int lengths[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; // This version prints every character of the accumulated // total name string, along with its numeric ASCII code void main() { int totallength = 0; string totalname = ""; for (int i = 1; i <= 12; i += 1) { cout << months[i] << " has " << lengths[i] << " days.\n"; totallength += lengths[i]; totalname += months[i]; } cout << "The End\n"; cout << "totals: " << totalname << ", " << totallength << "\n"; for (int i = 0; i <= totalname.length(); i += 1) { cout << "character " << i << " is " << totalname[i] << " = " << (int)totalname[i] << "\n"; } }