#include #include #include using namespace std; int main() { string a[] { //East of this avenue are "Fifth Avenue", // 1 to 99 inclusive "Park Avenue (or Fourth Avenue)", //100 to 199 inclusive "Third Avenue", //200 to 299 inclusive "Second Avenue", //300 to 399 inclusive "First Avenue", //400 to 499 inclusive "York Avenue (or Avenue A)", //500 to 599 inclusive "Avenue B" }; int n {size(a)}; //Where is 100 East 42nd Street? int number {100}; int street {42}; //assume East side if (number < 1 || number >= n * 100) { cerr << "street # " << number << " must be in range 1 to " << n * 100 - 1 << " inclusive.\n"; return EXIT_FAILURE; } int i {number / 100}; //subscript of an avenue cout << "between " << a[i] << " and " << a[i + 1] << "\n"; return EXIT_SUCCESS; }