#include #include using namespace std; // This assignment is worth 3 points int main() { ifstream inputFile; string fileName, str0; int wordCount = 0; cout << "Enter file name: "; cin >> fileName; cin.ignore(); inputFile.open(fileName); if(inputFile.fail()) cout << "File name not found. Try again." << endl; else { cout << "Now reading " << fileName << "..." << endl; while(inputFile >> str0) wordCount++; cout << "Done" << endl; cout << fileName << " word count: " << wordCount << endl; } inputFile.close(); return 0; }