#include #include #include #include using namespace std; int main() { //Create a new data type, named "month". struct month { string name; int length; }; //Create an array of 12 months: month a[] { {"January", 31}, {"February", 28}, //assume non-leap {"March", 31}, {"April", 30}, {"May", 31}, {"June", 30}, {"July", 31}, {"August", 31}, {"September", 30}, {"October", 31}, {"November", 30}, {"December", 31} }; //Loop through the array with a plain old for loop. int 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 " << a[i].length << " days.\n"; } return EXIT_SUCCESS; }