#include #include #include using namespace std; int main() { string a[][7] { {"5th", "Park/4th", "3rd", "2nd", "1st", "York/A", "B"}, //east side {"5th", "6th", "7th", "8th", "9th", "10th", "11th"} //west side }; int numberOfSides {size(a)}; //Where is 100 West 42nd Street? int number {100}; int street {42}; int side {1}; //0 for East Side, 1 for West Side if (side < 0 || side >= numberOfSides) { cerr << "Sorry, New York has only 2 sides: East and West.\n"; return EXIT_FAILURE; } if (number < 1 || number >= 600) { cerr << "Sorry, street # " << number << " must be in range 1 to " << 600-1 << " inclusive.\n"; return EXIT_FAILURE; } int i {number / 100}; //subscript of an avenue cout << "between " << a[side][i] << " and " << a[side][i + 1] << " Avenues\n"; return EXIT_SUCCESS; }