// This program uses the CharRange class and demonstrates its // capabilities. This file should be combined into a project // along with the CharRange.h and CharRange.cpp files. #include #include "CharRange.h" using namespace std; int main() { char ch; // Holds user input CharRange input('J', 'N'); // Create a CharRange object named input // It will check for characters in the // range J - N // Prompt the user to enter a letter cout << "Enter any of the characters J, K, L, M, or N.\n"; cout << "Entering N will stop this program.\n"; ch = input.getChar(); // Continue allowing letters to be entered until a 'N' is input while (ch != 'N') { cout << "You entered " << ch << endl; ch = input.getChar(); } return 0; }