#include #include #include using namespace std; #include "prompt.h" // count # of lines, chars and blanks in input file int main() { int numChars = 0; int numLines = 0; int numBlanks = 0; char ch; string filename = PromptString("enter name of input file: "); ifstream input; input.open(filename.c_str()); if (input.fail() ) { cout << "could not open file " << filename << endl; return 0; } while ( input.get(ch) ) // reading char succeeds? { numChars++; // increment character counter if ('\n' == ch) // if current char is newline character { numLines++; } else if (' ' == ch) // if blank { numBlanks++; } } cout << "number of lines = " << numLines << endl << "number of characters = " << numChars << endl << "number of blanks = " << numBlanks <