#include #include //for the i/o manipulators setw, left, right #include #include using namespace std; int main() { //Create a new data type, named "month". struct month { string name; int length; double avg_temp; }; //Create an array of 12 const months: const month a[] { {"January", 31, 40.4}, {"February", 28, 42.2}, //assume non-leap {"March", 31, 50.8}, {"April", 30, 62.5}, {"May", 31, 71.4}, {"June", 30, 80.4}, {"July", 31, 85.9}, {"August", 31, 84.1}, {"September", 30, 76.0}, {"October", 31, 65.9}, {"November", 30, 54.2}, {"December", 31, 45.2} }; //Loop through the array with a plain old for loop. const size_t n {size(a)}; //the number of elements in the array for (int i {0}; i < n; ++i) { cout << left << setw(9) << a[i].name << " (month number " << right << setw(2) << i+1 << ") has " << setw(2) << a[i].length << " days.\n" << "The average temperature for the Rose Hill campus is " << a[i].avg_temp << " degrees F.\n"; } return EXIT_SUCCESS; }