#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 temperature; //2023 average, in farenheit }; //Create an array of 12 const months: const month a[] { {"January", 31, 43.5}, {"February", 28, 41.1}, //assume non-leap {"March", 31, 39.5}, {"April", 30, 44.5}, {"May", 31, 43.5}, {"June", 30, 40.6}, {"July", 31, 39.7}, {"August", 31, 38.9}, {"September", 30, 37.9}, {"October", 31, 40.6}, {"November", 30, 69.9}, {"December", 31, 35.9} }; //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 and has an average temperature of " << a[i].temperature << " degrees.\n"; } return EXIT_SUCCESS; }