#include #include #include #include using namespace std; int main() { //Create a new data type, named "month". struct month { string name; int length; double temperature; //2023 New York City average, fahrenheit }; //Create an array of 12 months: month a[] { {"January", 31, 43.5}, {"February", 28, 41.1}, //assume non-leap {"March", 31, 44.6}, {"April", 30, 57.6}, {"May", 31, 62.7}, {"June", 30, 70.0}, {"June", 31, 79.0}, {"August", 31, 75.0}, {"September", 30, 69.4}, {"October", 31, 60.5}, {"November", 30, 46.7}, {"December", 31, 44.6} }; //Loop through the array with a plain old for loop. int n {end(a) - begin(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 " << a[i].length << " days and the average temperature in 2023 in NYC was " << a[i].temperature<< " degrees.\n"; } return EXIT_SUCCESS; }