#include #include #include using namespace std; #include "prompt.h" // count # of lines in input file int main() { ifstream input; string s; // line entered by user int numLines = 0; int numChars = 0; string filename = PromptString("enter name of input file: "); input.open(filename.c_str()); if (input.fail() ) { cout << "could not open file " << filename << endl; return 0; } while (getline(input,s)) { numLines++; numChars += s.length(); } cout << "number of lines = " << numLines << ", number of characters = " << numChars << endl; return 0; }